maciver-hypothesis-testing
David MacIver Hypothesis Style Guide
Overview
David MacIver created Hypothesis, widely considered the most sophisticated property-based testing library available. Hypothesis improves on QuickCheck with better shrinking (using internal reduction rather than type-based shrinking), an example database for regression testing, and deep integration with Python's ecosystem. MacIver's philosophy emphasizes that property-based testing should be practical, integrated into normal development workflows, and produce genuinely useful minimal examples.
Core Philosophy
"The purpose of Hypothesis is to make it easier to write better tests."
"Shrinking should produce the simplest example, not just a smaller one."
"Every failing example should be saved and replayed forever."
MacIver believes that property-based testing fails when it's treated as exotic. Hypothesis is designed to integrate seamlessly with pytest, produce human-readable minimal examples, and remember every failure to prevent regressions.
Design Principles
- Integrated Shrinking: Shrinking happens during generation, not after—producing simpler examples.