QA Strategy and Metrics Skill
Metadata (Tier 1)
Keywords: strategy, testing pyramid, quality, metrics, technical debt, complexity, maintainability, coverage principles
File Patterns: N/A (conceptual skill)
Modes: code_review, testing_frontend, testing_backend
Activation: Conceptual queries about testing strategy, quality metrics, or technical debt.
Instructions (Tier 2)
Testing Pyramid
E2E (5-10%)
Integration (15-20%)
Unit Tests (70-80%)
Rationale:
- Unit: Fast (ms), cheap, high confidence in individual components
- Integration: Moderate speed (seconds), tests component interactions
- E2E: Slow (seconds-minutes), expensive, fragile, but validates real workflows
Anti-Pattern: Inverted pyramid (too many E2E tests)
- Slow CI/CD pipeline
- Flaky tests due to external dependencies
- High maintenance burden
Cyclomatic Complexity (CC)
Formula: CC = E - N + 2P
- E = edges in control flow graph
- N = nodes
- P = connected components
Interpretation:
- 1-5: Low risk, straightforward logic
- 6-10: Moderate complexity, well-structured
- 11-20: Complex, consider refactoring
- 21+: Very complex, MUST refactor
When to refactor:
- Function has CC > 15
- Function has multiple responsibilities
- Difficult to write tests (need many mocks)
Code Coverage Metrics
Statement Coverage: % of code lines executed
Branch Coverage: % of decision paths taken (if/else, switch)
Function Coverage: % of functions called
Critical Insight: 100% coverage ≠ 100% tested
- May miss edge cases
- May not test error handling
- May not validate business logic
Focus Areas:
- Error handlers (try/except, catch)
- Boundary conditions (null, empty, max)
- Complex conditionals
Maintainability Index (MI)
Formula (simplified):
MI = 171 - 5.2 * ln(HV) - 0.23 * CC - 16.2 * ln(LOC)
- HV = Halstead Volume (code complexity)
- CC = Cyclomatic Complexity
- LOC = Lines of Code
Ranges:
- 85-100: Highly maintainable
- 65-84: Moderately maintainable
- 0-64: Difficult to maintain
Technical Debt
Formula: Debt = (Cost to Fix) * (Impact if Not Fixed)
Types:
- Code Debt: Poor structure, duplication
- Test Debt: Low coverage, missing tests
- Documentation Debt: Missing/outdated docs
- Architectural Debt: Design constraints
When to Pay Down:
- High-traffic code paths
- Before major refactoring
- Security-sensitive areas
1---2name: qa-strategy-and-metrics3version: "1.0"4description: >5 Testing pyramid, quality metrics, and technical debt management strategies.6 PROACTIVELY activate for: (1) Designing testing strategy, (2) Evaluating code quality metrics,7 (3) Managing technical debt, (4) Analyzing test coverage approaches, (5) Calculating complexity.8 Triggers: "testing strategy", "testing pyramid", "quality metrics", "technical debt", "cyclomatic complexity", "maintainability", "coverage principles"9core-integration:10 techniques:11 primary: ["systematic_analysis"]12 secondary: ["structured_evaluation"]13 contracts:14 input: "none"15 output: "none"16 patterns: "none"17 rubrics: "none"18metadata:19 source: https://skillmd.com/skills/agentient/qa-strategy-and-metrics20---2122# QA Strategy and Metrics Skill2324## Metadata (Tier 1)2526**Keywords**: strategy, testing pyramid, quality, metrics, technical debt, complexity, maintainability, coverage principles2728**File Patterns**: N/A (conceptual skill)2930**Modes**: code_review, testing_frontend, testing_backend3132**Activation**: Conceptual queries about testing strategy, quality metrics, or technical debt.3334---3536## Instructions (Tier 2)3738### Testing Pyramid3940```41 E2E (5-10%)42 Integration (15-20%)43 Unit Tests (70-80%)44```4546**Rationale**:47- **Unit**: Fast (ms), cheap, high confidence in individual components48- **Integration**: Moderate speed (seconds), tests component interactions49- **E2E**: Slow (seconds-minutes), expensive, fragile, but validates real workflows5051**Anti-Pattern**: Inverted pyramid (too many E2E tests)52- Slow CI/CD pipeline53- Flaky tests due to external dependencies54- High maintenance burden5556### Cyclomatic Complexity (CC)5758**Formula**: CC = E - N + 2P59- E = edges in control flow graph60- N = nodes61- P = connected components6263**Interpretation**:64- 1-5: Low risk, straightforward logic65- 6-10: Moderate complexity, well-structured66- 11-20: Complex, consider refactoring67- 21+: Very complex, MUST refactor6869**When to refactor**:70- Function has CC > 1571- Function has multiple responsibilities72- Difficult to write tests (need many mocks)7374### Code Coverage Metrics7576**Statement Coverage**: % of code lines executed77**Branch Coverage**: % of decision paths taken (if/else, switch)78**Function Coverage**: % of functions called7980**Critical Insight**: 100% coverage ≠ 100% tested81- May miss edge cases82- May not test error handling83- May not validate business logic8485**Focus Areas**:86- Error handlers (try/except, catch)87- Boundary conditions (null, empty, max)88- Complex conditionals8990### Maintainability Index (MI)9192**Formula** (simplified):93```94MI = 171 - 5.2 * ln(HV) - 0.23 * CC - 16.2 * ln(LOC)95```96- HV = Halstead Volume (code complexity)97- CC = Cyclomatic Complexity98- LOC = Lines of Code99100**Ranges**:101- 85-100: Highly maintainable102- 65-84: Moderately maintainable103- 0-64: Difficult to maintain104105### Technical Debt106107**Formula**: Debt = (Cost to Fix) * (Impact if Not Fixed)108109**Types**:1101. **Code Debt**: Poor structure, duplication1112. **Test Debt**: Low coverage, missing tests1123. **Documentation Debt**: Missing/outdated docs1134. **Architectural Debt**: Design constraints114115**When to Pay Down**:116- High-traffic code paths117- Before major refactoring118- Security-sensitive areas