| type | skill |
| lifecycle | stable |
| inheritance | inheritable |
| name | test-quality-analysis |
| description | Analyze test code quality to detect coverage-only tests, test smells, and low-value assertions. Use when asked to "analyze test quality", "find coverage-only tests", "audit our tests", "are these tests valuable", "find test smells", or "which tests should we delete". Scores tests 1-5 on real value and produces prioritized improvement reports. |
| applyTo | **/*.test.*,**/*.spec.*,**/test/**,**/__tests__/** |
| tier | standard |
| currency | 2026-04-22T00:00:00.000Z |
Test Quality Analysis
Detect tests that exist solely for coverage metrics, identify test smells, and score test value.
When to Use
- Auditing test suite quality before a release
- Suspecting tests inflate coverage without catching bugs
- User asks "are these tests any good" or "find useless tests"
What This Skill Is NOT
- Not
refactor: That improves production code. This evaluates test code.
Detection Heuristics
Detect the project's test framework by scanning test files for import/require statements and config files, then apply these patterns:
Critical (Score 1-2)
| Pattern | Why It's Bad |
|---|
| No assertions — test calls methods but never verifies outcomes | Exercises code without proving it works |
| Trivial assertions — asserts on constants or always-true conditions | Always passes regardless of behavior |
| Exception swallowing — catches all errors silently | Hides failures; test can never fail |
| Self-referential — asserts input equals output when transformation is identity | Tests nothing meaningful |
Warning (Score 2-3)
| Pattern | Why It's Concerning |
|---|
| Over-mocking — every dependency mocked; no real code executes | Tests the mock setup, not behavior |
| Coverage touching — calls methods systematically without verifying behavior | Covers lines without testing logic |
| Weak verification — checks type/shape only, not content | Misses value-level bugs |
| Missing negative path — only happy path tested | Won't catch error handling bugs |
Minor (Score 3-4)
| Pattern | Check For |
|---|
| Missing edge cases, incomplete verification, poor naming, test duplication, brittle setup | |
Value Scoring