Testing: Property-based testing - let your testing library work(...)
summary
Shows property-based testing in Java using jqwik, demonstrating generators that create 1000 samples per property, custom arbitraries for LocalDate built from long ranges, and combinators to produce domain objects. Finds a leap-day bug and uses shrinking to minimal counterexample to simplify failures, then reruns with the saved seed reproducibility to confirm the fix. Covers assumptions and frequency weighting for realistic data and where properties fail to replace example tests.
AI-written summary · about
chapters (15)
- 0:00Introduction to property-based testing
- 5:44What is property-based testing
- 8:59Property-based testing libraries
- 11:28First property-based test example
- 15:18Why property-based testing shines
- 17:08Generators in property-based testing
- 23:30Custom generators for domain types
- 24:37Assumptions and frequencies in generators
- 27:11Challenges of property-based testing
- 30:43Patterns for writing properties
- 33:15Alternate wording and invariants
- 35:21Symmetry and non-determinism
- 37:50Documenting with example-based tests
- 38:53Strategies to start with property-based testing
- 40:38Summary and further resources
related talks
21mProperty-based testing - let your testing library work for you
54mAn Introduction to Property-based Testing
31mProperty-based testing - let your testing library work for you
57mProperty Testing in Java
58mProperty Based Testing: Concepts and Examples
51mProperty Testing: Write Fewer Tests, Find More Bugs
20mUnlock The Power Of Property-Based Testing
17mProperty Based Testing: the real truth!
