← ClaudeAtlas

property-testinglisted

Catalog of property-test invariants and proptest patterns for Rust. Use when writing tests during /keeler:tdd or strengthening tests after /keeler:mutants — whenever code has an invariant worth pinning (round-trips, ordering, idempotence, bounds, merging) or a surviving mutant points at a general gap rather than a missing example.
minikin/keeler · ★ 4 · Testing & QA · score 77
Install: claude install-skill minikin/keeler
# Property-Testing Patterns A property test doesn't check one example — it states a law and lets randomness hunt for a counterexample. When a mutant survives, ask first: "is there a _law_ this mutant breaks?" — one strengthened property usually kills a whole family of mutants that example tests would need one-by-one. ## Invariant catalog Scan the code for these shapes; each maps to a ready-made property: | Shape in the code | Law to pin | | ----------------------------------- | --------------------------------------------------------------------- | | Parse + Display pair | **Round-trip**: `parse(display(x)) == x` | | Normalization / canonicalization | **Idempotence**: `f(f(x)) == f(x)` | | Sort / merge / dedup | **Shape**: output sorted, no overlaps/duplicates (check `windows(2)`) | | Aggregation (`len`, `sum`, `count`) | **Consistency**: `len() == iter().count()`; total equals sum of parts | | Membership + construction | **Cross-check**: `contains(p)` ⇔ some input covers `p` | | Saturating / clamping arithmetic | **Bounds**: result within `[min, max]` for any input | | Order-insensitive operations | **Permutation**: shuffling input doesn't change output | | Two implementations (fast + naive) | **Oracle**: `fast(x) == naive(x)` for al