# Property-based testing Also: property testing, generative property testing, QuickCheck-style testing. Metamorphic relations, differential checks, and state-machine models are related approaches. Fuzzing or parameterized examples alone do not imply properties. - Fit: pure functions, parsers, serializers, transformations, pipelines with useful laws. - Derive laws from intent: idempotence, round trips, information preservation, equivalent transformations. - Define valid domains and invalid-input behavior. Generate boundaries, empty/large values, malformed structures, and relevant combinations. - Avoid vacuous properties, excessive discarded cases, and laws copied from implementation. - Round trips can hide paired bugs. Keep independent compatibility examples and distinct known regressions. During curation, replace repetitive example matrices with laws where protection remains. Properties are oracles, not an escape from defining correctness. Use shrinking/minimization and existing replay facilities for understandable counterexamples. Bound input sizes, case counts, and runtime through project profiles. Retain failure evidence; do not rerun randomly until green. Properties can exercise integration boundaries too. Finite passing runs ≠ proof for every input. ## Sources - [Hypothesis](https://hypothesis.readthedocs.io/en/latest/) - [Choosing properties](https://fsharpforfunandprofit.com/posts/property-based-testing-2/) - [Replay, shrinking, and controls](https://hypothesis.readthedocs.io/en/latest/reference/api.html)