So what do you do when you write a test? Usually, you tell stories. You give examples like: for a given input I expect a given output. That’s certainly better than no tests but this approach has drawbacks.
First, you didn’t prove your code works in general – you only told some anecdotes and demonstrated it works for given examples. In other words, using those examples you’re trying to prove there are no bugs. Shouldn’t your tests help find bugs instead?
Second, you only covered some general cases and edge cases you know. What about edge cases you don’t know?
As you can see, even though you’re doing your best, you may still be missing a fundamental piece of testing. A piece that empowers you to describe behavior instead of output, to find bugs more effectively, and to test more cases with less code.
In my talk, I’ll show you how you can leverage the power of property-based testing to complement your testing tool belt and have even more confidence with the software you create.