82 / 87 · 02 AI-Augmented Test Design · Write vs Generate: The Decision Matrix← prev⊞ allnext →☰ Read as one page
12.2The Decision Matrix
| Scenario | Write from Scratch | Generate + Curate | Why |
|---|---|---|---|
| Novel business logic with no existing patterns | Yes | No | AI has no reference for your unique domain rules |
| Standard CRUD endpoint tests | No | Yes | CRUD tests follow universal patterns AI knows well |
| Complex stateful workflows (e.g., payment flows) | Hybrid | Hybrid | Write the skeleton manually, AI fills in permutations |
| Data-driven tests (100+ input combinations) | No | Yes | AI excels at systematic enumeration |
| Tests requiring deep domain knowledge (financial calcs) | Write logic | AI generates permutations | You define the rules, AI explores the space |
| Regression tests for a known bug | Write | No | You need exact reproduction of the specific bug |
| Cross-browser/cross-device matrix | No | Yes | Combinatorial generation is AI's sweet spot |
| Security-critical tests (auth, encryption) | Hybrid | Hybrid | Write the security assertions, AI generates attack vectors |
| Flaky test debugging | Write | No | Requires understanding of non-determinism causes |
| Performance/load test scenarios | Hybrid | Hybrid | AI generates scenario variations, you tune thresholds |
Reading the Matrix
- Write from scratch when the test requires deep understanding of a specific problem that AI lacks context for.
- Generate + curate when the test follows a known pattern and the main value is in systematic coverage.
- Hybrid when the test structure requires human judgment but the details benefit from AI's breadth.