Domain Invariants & Property-Based Testing for the Masses
summary
Argues that property‑based testing works on legacy, non‑FP stacks (demonstrated in Java 6) by writing generators for custom domain objects and wiring them to existing xUnit assertions; shows concrete examples (bowling scorer, prescriptions, GPS coords), builds generators by copying test fixtures, and runs randomized runs with configurable tries. Uses shrinking to minimal counterexamples so failures are actionable; finds real surprises (male patient flagged as pregnant), exposes hidden invariants, and integrates PBT for characterization and domain‑rule tests.
AI-written summary · about
chapters (7)
- 0:00Start
- 0:19What Is a Property
- 1:25What Is an Invariant and What Is a Tautology
- 4:44Test-Driven Development
- 19:13Contract Programming
- 29:37Property Based Testing
- 41:36Integration Tests
related talks
48mDomain Invariants & Property-Based Testing for the Masses
45mProperty based tests for the masses
01h 24mIntroduction to Property Based Testing
42mInvariants are everything
58mProperty Based Testing: Concepts and Examples
46mProperty-based testing:You won't look at your tests the same way ever again
54mAn Introduction to Property-based Testing
47mProperty-based Testing or the Insufficiency of Unit Tests
