An Introduction to Property-based Testing
summary
Shows how jQu annotated property tests and Spock Genesis generators replace dozens of examples by generating and checking thousands of cases (he runs 1,000 random cases). Demonstrates a real bug: an else-based compare misses a case and is fixed with min/max logic; shrinking reduces failures to small inputs like 0 -99 -98; switching shorts to ints exposes integer overflow so the oracle is adjusted. Includes a GitHub repo of Java/Groovy examples and concrete generator patterns and assertions.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 1:49What is property testing
- 8:24Motivating example
- 15:45How property testing works
- 22:09Temperature converter example
- 30:11Teasing out properties
- 39:05Beyond unit tests
- 52:10Acceptance testing benefits
- 53:58Summary and key takeaways
related talks
43mTesting: Property-based testing - let your testing library work(...)
45mProperty based tests for the masses
20mUnlock The Power Of Property-Based Testing
46mProperty-based testing:You won't look at your tests the same way ever again
57mProperty Testing in Java
51mProperty Testing: Write Fewer Tests, Find More Bugs
58mProperty Based Testing: Concepts and Examples
30mProperty Based Testing: From Theory to Practice
