Beyond Unit Tests: Taking Your Testing to the Next Level
summary
Uses property-based testing with Hypothesis to generate hundreds of inputs (and shrink failing cases) and uses dpcontracts runtime pre/postconditions to make functions self-checking. A generated test finds the max-product bug caused by negative numbers; a tail example gets a precise precondition/postcondition that detects invalid input and wrong output. Combining these techniques catches subtle edge cases, localizes bugs to the offending module, and verifies pure-function behavior (contracts are slower and intended for testing/development).
AI-written summary · about
chapters (15)
- 0:00Intro
- 0:32Welcome
- 2:05What are Unit Tests
- 2:50Beyond Unit Tests
- 4:54Property Based Testing
- 8:05Catching Regressions
- 8:46Finding Good Properties
- 11:35Integration Testing
- 12:46MyPI
- 14:15Static Type
- 16:02Type Check Version
- 16:58Post Condition
- 17:56Contracts
- 20:11Property Tests
- 27:42Formal Methods
related talks
27mTesting Beyond Examples: Property Based Testing with Hypothesis
01h 24mIntroduction to Property Based Testing
36mProperty-Based Testing: Unveiling the Truth on Test Reduction
50mProperty based testing with Hypothesis
01h 31mIntroduction to Property-Based Testing
41mProperty Based Testing in Python with Hypothesis
01h 07mSufficiently Advanced Testing
30mProperty Based Testing: From Theory to Practice
