3 ms·
Property based tests have caught 10-100x the number of buggy edge-cases than the handwritten unit tests I could have come up with. The material gains of getting
by kelseyfrog 5y ago
Property based tests have caught 10-100x the number of buggy edge-cases than the handwritten unit tests I could have come up with. The material gains of getting a combinatorial explosion of test cases from property composition is extremely underrated.
However, there seems to be a general skepticism around property based tests in my experience. Any idea where it stems from?
- dgb23 5y agoIMO, you have to code in a certain way to make them ergonomic or even worthwhile - which is also true for example tests. They have some overlap with example tests but have a different advantage. Example tests document function/interface usage and typical or historical errors/exceptions. Property based tests are more about data integrity and invariants.
- oxff 5y agoIt requires more mathematical / analytical thinking and code IME.