Introduction to Property-Based Testing
summary
Introduction covers property-based testing using Hypothesis and pytest with runnable examples that actually find bugs: a NaN case breaking sort, floating-point mean turned infinite for two huge floats, binaryornot failing due to chardet, Mercurial round‑trip crashes, and JSON/gzip round trips. Tutorial shows tools like strategies, map/filter, composite, Atheris/HypoFuzz and shared example DBs, explains settings and determinism, and notes defaults like 100 examples per test and a 200ms deadline while demonstrating tests that reproduce failures and then shrink them.
AI-written summary · about
chapters (8)
- 0:00Property-based testing intro
- 1:03What is PBT and why it matters
- 10:56PBT finds bugs in code
- 11:58Installing Hypothesis
- 37:18Describing data with strategies
- 1:00:00PBT test tactics
- 1:22:07PBT in production tips
- 1:31:04Q&A
related talks
01h 24mIntroduction to Property Based Testing
01h 23mIntroduction to Property-Based Testing
27mTesting Beyond Examples: Property Based Testing with Hypothesis
51mProperty-Based Testing
41mProperty Based Testing in Python with Hypothesis
23mFrom test to proof: introduction to Property Based Testing
26mProperty Based Testing the Python Way
36mProperty Based Testing: From Theory to Practice
