Testing is an important part of software development, but how many tests is enough? Should you write a test for every possible value that could be submitted to a function? Property-based testing is a technique that can help you with this conundrum. Instead of writing a specific set of tests, write some generalized tests and let a tool randomly test inputs against your code.
I'll explain in more detail what property-based testing is, how it works, and show some practical examples using Eris, a new PHPUnit extension modeled after Haskell's QuickCheck library.