Test Optimization Methodology (core)
Mission
Minimize tests, maximize value, reduce feedback time, maintain quality.
(Ale, 2026-04-28: "Bisogna minimizzare i test, massimizzare il valore per ridurre il tempo di feedback, mantenendo la qualità.")
This skill operationalizes that mission. Apply during DELIVER COMMIT, scheduled audits, or /nw-optimize-tests invocations.
This is a lean core. The methodology lives in 7 one-job modules. Load the module whose trigger matches the situation; never re-inline its content here.
Module loading table (module → trigger)
| Module |
Kind |
Trigger — load when |
nw-test-optimization-behavior-counting |
KNOWLEDGE |
"what counts as a behavior here / how many distinct behaviors does this scope expose" |
nw-test-optimization-anti-patterns |
KNOWLEDGE |
"is this test an anti-pattern — block at review" |
nw-test-optimization-consolidation |
KNOWLEDGE |
"I have redundant tests — how do I collapse them without losing coverage" |
nw-test-optimization-budget-gate |
PROCEDURE |
"should I author more tests / is this scope's count above budget" |
nw-test-optimization-paradigm-match |
KNOWLEDGE |
"which test paradigm fits this test shape — before authoring/migrating" |
nw-test-optimization-coverage-validation |
PROCEDURE |
"before declaring an optimization done, prove no coverage was lost" |
nw-test-optimization-scope-selection |
KNOWLEDGE |
"invoked without a specific scope — what do I attack first" |
Path form: ~/.claude/skills/{module}/SKILL.md.
Composition
- COMPOSES (KNOWLEDGE):
nw-test-optimization-behavior-counting, nw-test-optimization-anti-patterns, nw-test-optimization-consolidation, nw-test-optimization-paradigm-match, nw-test-optimization-scope-selection.
- COMPOSES (PROCEDURE):
nw-test-optimization-budget-gate, nw-test-optimization-coverage-validation.
What This Methodology Does NOT Cover
- Test infrastructure (fixtures, conftest, plugins) — that is platform-architect or troubleshooter scope
- Production code refactoring —
/nw-refactor and the crafter scope
- New test authoring — crafter scope (DELIVER wave)
- Adapter integration tests — different rules apply (real I/O, no parametrize-collapse there); see
nw-hexagonal-testing skill
Cross-References
nw-tdd-methodology — Mandate 1 (Observable Behavioral Outcomes), Mandate 5 (Parametrize Input Variations)
nw-tdd-review-enforcement — reviewer block conditions
nw-mutation-test — coverage-preserving validation via mutation kill rate (DEPRECATED/opt-in, FR-1 — not a default step; green ATs + EXAMINE are the truth)
nw-property-based-testing — PBT paradigm, falsifier-gate for closed-world domains
nw-test-design-mandates — universe-per-layer, state-delta + Universe matrix (§263-270)
nw-test-refactoring-catalog — refactoring patterns for test code structure
- Overtesting investigation, 2026-04-28 — empirical evidence (~580 removable tests, 18% of unit suite, the gap is enforcement decay + loose behavior definition). Findings restated here in full; the write-up itself was an nWave-internal analysis note and is not part of any shipped or published tree, so do not look for a file.
- Empirical speedup commits 2026-05-18:
c2637f6c8 (parametrize-collapse 8.9×), defc07f0d (single-lifecycle 2.4×), e97c94663+a90606d6b (CVE+timeout+tiktoken)
1---2name: nw-test-optimization-33description: Methodology for minimizing test count while maximizing behavioral coverage - lean core composing behavior-counting, anti-patterns, consolidation, budget-gate, paradigm-match, coverage-validation, scope-selection modules4---56# Test Optimization Methodology (core)78## Mission910> Minimize tests, maximize value, reduce feedback time, maintain quality.11> (Ale, 2026-04-28: "Bisogna minimizzare i test, massimizzare il valore per ridurre il tempo di feedback, mantenendo la qualità.")1213This skill operationalizes that mission. Apply during DELIVER COMMIT, scheduled audits, or `/nw-optimize-tests` invocations.1415This is a lean core. The methodology lives in 7 one-job modules. Load the module whose trigger matches the situation; never re-inline its content here.1617## Module loading table (module → trigger)1819| Module | Kind | Trigger — load when |20|--------|------|---------------------|21| `nw-test-optimization-behavior-counting` | KNOWLEDGE | "what counts as a behavior here / how many distinct behaviors does this scope expose" |22| `nw-test-optimization-anti-patterns` | KNOWLEDGE | "is this test an anti-pattern — block at review" |23| `nw-test-optimization-consolidation` | KNOWLEDGE | "I have redundant tests — how do I collapse them without losing coverage" |24| `nw-test-optimization-budget-gate` | PROCEDURE | "should I author more tests / is this scope's count above budget" |25| `nw-test-optimization-paradigm-match` | KNOWLEDGE | "which test paradigm fits this test shape — before authoring/migrating" |26| `nw-test-optimization-coverage-validation` | PROCEDURE | "before declaring an optimization done, prove no coverage was lost" |27| `nw-test-optimization-scope-selection` | KNOWLEDGE | "invoked without a specific scope — what do I attack first" |2829Path form: `~/.claude/skills/{module}/SKILL.md`.3031## Composition3233- COMPOSES (KNOWLEDGE): `nw-test-optimization-behavior-counting`, `nw-test-optimization-anti-patterns`, `nw-test-optimization-consolidation`, `nw-test-optimization-paradigm-match`, `nw-test-optimization-scope-selection`.34- COMPOSES (PROCEDURE): `nw-test-optimization-budget-gate`, `nw-test-optimization-coverage-validation`.3536## What This Methodology Does NOT Cover3738- Test infrastructure (fixtures, conftest, plugins) — that is platform-architect or troubleshooter scope39- Production code refactoring — `/nw-refactor` and the crafter scope40- New test authoring — crafter scope (DELIVER wave)41- Adapter integration tests — different rules apply (real I/O, no parametrize-collapse there); see `nw-hexagonal-testing` skill4243## Cross-References4445- `nw-tdd-methodology` — Mandate 1 (Observable Behavioral Outcomes), Mandate 5 (Parametrize Input Variations)46- `nw-tdd-review-enforcement` — reviewer block conditions47- `nw-mutation-test` — coverage-preserving validation via mutation kill rate (DEPRECATED/opt-in, FR-1 — not a default step; green ATs + EXAMINE are the truth)48- `nw-property-based-testing` — PBT paradigm, falsifier-gate for closed-world domains49- `nw-test-design-mandates` — universe-per-layer, state-delta + Universe matrix (§263-270)50- `nw-test-refactoring-catalog` — refactoring patterns for test code structure51- Overtesting investigation, 2026-04-28 — empirical evidence (~580 removable tests, 18% of unit suite, the gap is enforcement decay + loose behavior definition). Findings restated here in full; the write-up itself was an nWave-internal analysis note and is not part of any shipped or published tree, so do not look for a file.52- Empirical speedup commits 2026-05-18: `c2637f6c8` (parametrize-collapse 8.9×), `defc07f0d` (single-lifecycle 2.4×), `e97c94663`+`a90606d6b` (CVE+timeout+tiktoken)