property-testinglisted
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