Property-Based Testing: Unveiling the Truth on Test Reduction
summary
Property-based testing uses generators to describe inputs and assertions to describe properties, running hundreds of examples (Hypothesis defaults ~200–300) and shrinking failing cases to a minimal counterexample. Example: a custom sort implementation fails because generated arrays reveal an ordering bug; custom strategies can generate complex types (demo uses a dog class). Claims: it raises coverage and finds edge-case bugs, can cut time spent writing individual cases and sometimes reduce test code, but it increases the number of test executions. Use Hypothesis or FSCheck and apply selectively via risk-based testing.
AI-written summary · about
chapters (11)
- 0:00Introduction to testing
- 1:38Lessons from my son
- 4:00Common testing challenges
- 5:56Code vs test coverage
- 9:17Techniques for test design
- 11:53Limits of decision tables
- 17:36Property-based testing
- 21:25Shrinking and failing tests
- 24:03Customizing input strategies
- 27:27Test reduction efforts
- 30:12Risk-based testing and wrap up
related talks
51mProperty-Based Testing
30mProperty Based Testing: From Theory to Practice
01h 24mIntroduction to Property Based Testing
47mProperty-Based Testing
46mProperty-based testing:You won't look at your tests the same way ever again
23mProperty based testing is a mindset
23mFrom test to proof: introduction to Property Based Testing
47mProperty-based Testing or the Insufficiency of Unit Tests
