Surprise yourself with Property Based Testing
summary
Randomized tests that compare a reimplementation against a known‑good oracle find real bugs: a Rust Motorola 68k emulator run with ~1,600 QuickCheck-style properties (covering many of ~65,000 opcodes) runs ~4 hours, produces 16 PRs against Masashi, and surfaces subtle CPU and timing mismatches. Stateful checks reproduce LevelDB defects as command sequences (17‑step then 33‑step repros). Tooling details matter: generators to craft inputs, shrinking to minimize counterexamples, and seeding or nightly runs tame non-determinism.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 1:07Why Property Based Testing
- 5:24What is a property
- 6:32Example vs property testing
- 8:18From example to property
- 11:29Defining PBT clearly
- 13:19Tooling support
- 20:26Stateful PBT explained
- 26:10LevelDB case study
- 27:15Criticisms and concerns
- 29:02Making property based testing work in practice
- 33:44Finding properties
- 34:27Three ways to derive
- 39:24Dual implementation
- 40:10Tools and resources
- 41:56Summary








