Property Based Testing for Better Code

TDD leads to better production code, but it has its limitations. We can only write so many tests, and the more tests we maintain, the more tests we change with new requirements. Can we do better? I say yes. Property-based testing is a technique out of functional programming, one that works in any language. In this talk, I’ll use examples in ScalaCheck to demonstrate principles everyone can use: generation of every possible input, calculation of satisfactory output, and automation of hundreds of checks in a single test case. Property-based testing is much harder than the example-based tests we’re used to. That’s the point: compel us to think harder about the problem, leading to better production code. Come see how property-based testing can press you and your code to higher levels of correctness and simplicity.