بنقرة واحدة
testing-strategy
// Prioritizes tests based on ROI and critical user journeys. Use when: deciding test coverage, selecting test types, or budgeting effort.
// Prioritizes tests based on ROI and critical user journeys. Use when: deciding test coverage, selecting test types, or budgeting effort.
Guides PRD, ADR, Design Doc, and Work Plan creation. Use when: planning features, writing specs, or creating technical documents.
Detects code smells, anti-patterns, and debugging issues. Use when: fixing bugs, reviewing code quality, or refactoring.
Applies coding standards for clean, maintainable code. Use when: writing functions, handling errors, refactoring, or reviewing code style.
Selects implementation strategy (vertical/horizontal/hybrid) with risk assessment. Use when: planning features or deciding development approach.
Designs integration and E2E tests with mock boundaries. Use when: writing E2E tests, integration tests, or reviewing test quality.
Validates approach and checks assumptions before/after tasks. Use when: starting work, encountering errors, or switching phases.
| name | testing-strategy |
| description | Prioritizes tests based on ROI and critical user journeys. Use when: deciding test coverage, selecting test types, or budgeting effort. |
Philosophy: 10 reliable tests > 100 unmaintained tests
Quality over quantity - focus resources on high-value tests that provide maximum coverage with minimum maintenance burden.
ROI Score = (Business Value × User Frequency + Legal Requirement × 10 + Defect Detection)
/ (Creation Cost + Execution Cost + Maintenance Cost)
Business Value (0-10 scale):
User Frequency (0-10 scale):
Legal Requirement (boolean → 0 or 1):
Defect Detection (0-10 scale):
Test Level Cost Table:
| Test Level | Creation Cost | Execution Cost | Maintenance Cost | Total Cost |
|---|---|---|---|---|
| Unit | 1 | 1 | 1 | 3 |
| Integration | 3 | 5 | 3 | 11 |
| E2E | 10 | 20 | 8 | 38 |
Cost Rationale:
Example 1: Payment Processing Integration Test
Business Value: 10 (revenue-critical)
User Frequency: 9 (90% of users)
Legal Requirement: 0
Defect Detection: 8 (high complexity)
ROI = (10 × 9 + 0 + 8) / 11 = 98 / 11 = 8.9
Decision: HIGH ROI → Generate this test
Example 2: UI Theme Toggle E2E Test
Business Value: 2 (cosmetic feature)
User Frequency: 5 (50% of users)
Legal Requirement: 0
Defect Detection: 3 (simple logic)
ROI = (2 × 5 + 0 + 3) / 38 = 13 / 38 = 0.34
Decision: LOW ROI → Skip this E2E test (consider unit test instead)
Example 3: GDPR Data Deletion E2E Test
Business Value: 8 (critical compliance)
User Frequency: 1 (rare user action)
Legal Requirement: 1 (legally mandated)
Defect Detection: 9 (high consequences if broken)
ROI = (8 × 1 + 1 × 10 + 9) / 38 = 27 / 38 = 0.71
Decision: MEDIUM ROI → Generate (legal requirement justifies cost)
Tests with HIGH priority regardless of strict ROI calculation:
Revenue-Impacting Flows
Legally Required Flows
High-Frequency Core Functionality
Budget Exception: Critical User Journeys may exceed standard budget limits with explicit justification.
Integration Tests:
E2E Tests:
Before generating higher-level test, ask:
Can this be unit-tested?
Already covered by integration test?
Example:
Before generating any test:
Decision Matrix:
Existing coverage found?
→ Full coverage: Skip new test
→ Partial coverage: Extend existing test
→ No coverage: Generate new test
See: .agents/tasks/acceptance-test-generation.md for detailed implementation process
Selection Rate: Tests generated / Total candidates
Average ROI: Average ROI of generated tests
Budget Utilization: Actual tests / Budget limit
Defect Detection Rate: Bugs caught / Total tests
Periodically review:
Adjust formula weights based on empirical data
❌ Gaming the System:
✅ Proper Usage:
❌ Analysis Paralysis:
✅ Practical Application: