Introduction to Property Based Testing
summary
Property‑based testing claims that specifying invariants rather than cases uncovers real edge‑case failures: Hypothesis drives generation (default ~100 examples) and shrinking to minimal counterexamples, finds Unicode decode and datetime parsing bugs (year/month swap), catches subtle divide/zero and Mercurial encode/decode failures, and surfaces misunderstandings of library contracts. The tooling includes pytest integration and a test generator hypothesis write that scaffolds useful tests. Common effective properties are round‑trips and does not raise an exception checks; metamorphic tests even expose hundreds of compiler bugs.
AI-written summary · about
chapters (32)
- 0:00Start
- 1:41What Is Testing
- 3:49Sorting
- 8:38Property-Based Testing
- 10:10Advantage of Property-Based Testing
- 17:32Mercurial
- 19:51Collections
- 20:18List Strategy
- 20:54Tuples Strategy
- 23:00Map Strategy
- 27:53Json Strategy
- 30:01Regular Expression Support
- 37:12Live Demo
- 40:56Common Test Tactics
- 41:38Round Trip Properties
- 42:30Ramp Trips
- 45:00Validate the Output
- 45:31Mathematical Properties
- 45:58Stateful Testing
- 46:43Metamorphic Relations
- 47:05Metamorphic Testing
- 49:35Exercises
- 53:15Gzip Compression
- 1:03:26Custom Strategies
- 1:04:46Debugging
- 1:08:35Random Number Generators
- 1:12:27Target Function
- 1:14:15Continuous Deployments
- 1:14:49Q a Exercises
- 1:20:03How Do You Migrate an Existing Test Suite
- 1:22:41Testing Machine Learning Code
- 1:23:46Schema Thesis
related talks
01h 31mIntroduction to Property-Based Testing
27mTesting Beyond Examples: Property Based Testing with Hypothesis
01h 23mIntroduction to Property-Based Testing
36mProperty-Based Testing: Unveiling the Truth on Test Reduction
46mProperty-based testing:You won't look at your tests the same way ever again
23mFrom test to proof: introduction to Property Based Testing
50mProperty based testing with Hypothesis
26mProperty Based Testing the Python Way
