diff options
| author | Craig Jennings <c@cjennings.net> | 2026-04-19 17:07:29 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-04-19 17:07:29 -0500 |
| commit | c5b41a3fb69b61d8c43fa814b349d02672c0c66e (patch) | |
| tree | 7caec38ad3418f7fbf51d071e6373c4fd150544d /.claude/rules/testing.md | |
| parent | 7eb56084cc543d3455d277ef766302b1ad922b74 (diff) | |
| download | chime-c5b41a3fb69b61d8c43fa814b349d02672c0c66e.tar.gz chime-c5b41a3fb69b61d8c43fa814b349d02672c0c66e.zip | |
chore(claude): sync validate-el.sh JSON channel + pairwise rule from rulesets
Diffstat (limited to '.claude/rules/testing.md')
| -rw-r--r-- | .claude/rules/testing.md | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/.claude/rules/testing.md b/.claude/rules/testing.md index f67ace2..b91b76c 100644 --- a/.claude/rules/testing.md +++ b/.claude/rules/testing.md @@ -58,6 +58,26 @@ Every unit under test requires coverage across three categories: - Resource exhaustion - Malformed data +## Combinatorial Coverage + +For functions with 3+ parameters that each take multiple values (feature-flag +combinations, config matrices, permission/role interactions, multi-field +form validation, API parameter spaces), the exhaustive test count explodes +(M^N) while 3-5 ad-hoc cases miss pair interactions. Use **pairwise / +combinatorial testing** — generate a minimal matrix that hits every 2-way +combination of parameter values. Empirically catches 60-90% of combinatorial +bugs with 80-99% fewer tests. + +Invoke `/pairwise-tests` on the offending function; continue using `/add-tests` +and the Normal/Boundary/Error discipline for the rest. The two approaches +complement: pairwise covers parameter *interactions*; category discipline +covers each parameter's individual edge space. + +Skip pairwise when: the function has 1-2 parameters (just write the cases), +the context requires *provably* exhaustive coverage (regulated systems — document +in an ADR), or the testing target is non-parametric (single happy path, +performance regression, a specific error). + ## Test Organization Typical layout: |
