domains / families / software-engineering / property-based-testing

property-based-testing

combined

Property-based testing with fast-check (TypeScript/JavaScript) and Hypothesis (Python). Generate test cases automatically, find edge cases, and test mathematical properties. Use when user mentions property-based testing, fast-check, Hypothesis, generating test data, QuickCheck-style testing, or finding edge cases automatically. Writes, reviews, and debugs property-based tests — Hypothesis, fast-check, proptest, jqwik, rapid, and Echidna or Medusa for Solidity invariants. Use whenever tests should cover a whole input domain instead of a hand-picked list of examples: encode/decode and serialize/deserialize pairs, parsers, canonicalizers and normalizers, validators, numeric and Decimal types, comparators and sort order, data structures, and smart-contract state invariants. Also use when adding cases to an existing @given, fast-check, or proptest suite, when judging whether existing property tests assert anything real, and when a generator has shrunk a counterexample and you need to tell a wrong property from a genuine bug. Not for coverage-guided binary fuzzing (libFuzzer, AFL), mutation-testing campaigns, static analysis, benchmarking, or end-to-end UI tests.

When to use

Skill page

Conflict

The two skills cover the same domain but with distinct, non-overlapping material. The first (trailofbits) is a high-level strategic guide focusing on property selection, strength ordering, avoiding tautologies/vacuity, and a decision framework for when to use PBT. It references external files for implementation details. The second (Vibe-Skills) is a low-level implementation guide providing specific code examples, installation commands, and generator syntax for fast-check (TypeScript) and Hypothesis (Python). Neither contains the other's core value: the first lacks the concrete code syntax, and the second lacks the strategic decision-making framework and property strength hierarchy. Combining them creates a complete skill that covers both the 'when/what' and the 'how'.