Property-based testing - let your testing library work for you
summary
Property-based testing with jqwik runs about 1000 cases of smart, adversarial input per property (configurable) and automatically shrinks counterexamples to a minimal failing case. Example: a discount function error surfaces on 29 February (leap-year handling) where generated dates cause an exception. Workflow requires writing generators or assumptions for sensible domain values, accepting non-determinism (record seeds to reproduce failures), and weighing extra upfront domain questions and build-time cost against finding subtle edge-case bugs.
AI-written summary · about
chapters (10)
- 0:00Introduction to property testing
- 1:54Example-based vs property-based tests
- 4:03Defining properties for testing
- 6:14How property tests work in practice
- 8:20Why property testing finds hidden bugs
- 9:23Challenges of property-based testing
- 11:51Coming up with good properties
- 12:35When to use property-based tests
- 13:58Balancing test strategies
- 15:27Q&A on property testing
related talks
43mTesting: Property-based testing - let your testing library work(...)
41mWriting bulletproof code with property-based testing
58mProperty Based Testing: Concepts and Examples
46mProperty-based testing:You won't look at your tests the same way ever again
30mProperty Based Testing: From Theory to Practice
17mProperty Based Testing: the real truth!
57mProperty Testing in Java
51mProperty Testing: Write Fewer Tests, Find More Bugs
