3 ms·
The best thing, in my view, about property testing is that it allows you to state the properties you're testing for, as opposed to some examples of them. For e
by garethrowlands 6y ago
The best thing, in my view, about property testing is that it allows you to state the properties you're testing for, as opposed to some examples of them.
For example if I'm making a sqrt function, then I want sqrt(x) * sqrt(x) == x, for any x>=0.
Human beings are good at inferring the general rules from examples but sometimes it's easier to understand if you just say what the general rules is.
Also, unit tests that include example data can sometimes be dominated by that data. Removing the particular examples can sometimes remove a lot of distraction and verbosity.
It's not just that property tests find more bugs.