Property Testing

Property-based tests: fast-check with Vitest in TypeScript, Hypothesis with pytest in Python. Writes new property tests, exposes a property in code that seems to have none, reviews existing property tests for ones that assert nothing, and triages a failed property test into a wrong property, an ambiguous spec or a real bug. Use it when the owner asks for property tests or for inputs the existing tests miss: "write property tests for this parser", "find the edge cases this function misses", "test the invariants", "tests are green but prod breaks on odd input", "model-based test for this state machine or cache", "do these property tests check anything real", "my property test failed, is it a bug or a wrong property". Also use it on your own in test-first work when the function has an inverse, normalizes or sorts, does arithmetic over money or limits, parses data through a schema, or holds state. Not for binary fuzzing (libFuzzer, AFL), mutation testing, benchmarks or end-to-end UI tests.

nyxandro Updated

File contents

nyxandro/property-testing-skill/tree/main/property-testing commit d7e99ce6c5

Frequently asked questions

npx skillmds@latest add nyxandro/property-testing