CLSkills
Testingintermediate

Test Coverage Analyzer

Share

Analyze test coverage gaps and suggest tests to write

Test Coverage Analyzer

Analyze test coverage gaps and suggest tests to write

Analyze test coverage gaps and suggest which tests to write next.

Instructions

  1. Run coverage report:
# JavaScript (Jest/Vitest)
npx jest --coverage --coverageReporters=text
# or
npx vitest --coverage

# Python
pytest --cov=src --cov-report=term-missing

# Go
go test -coverprofile=coverage.out ./...
go tool cover -func=coverage.out
  1. Identify gaps — focus on:

    • Uncovered branches: if/else paths not exercised
    • Uncovered functions: public functions with 0% coverage
    • High-risk uncovered code: error handlers, auth checks, payment logic
  2. Prioritize by risk:

    PriorityWhat to testWhy
    CriticalAuth, payments, data mutationsSecurity & correctness
    HighBusiness logic, API endpointsUser-facing behavior
    MediumUtility functions, formattersCatch edge cases
    LowLogging, analytics, UI stylingUnlikely to cause bugs
  3. Generate test suggestions: For each uncovered function, write a test skeleton with the cases needed.

Target Coverage

  • Overall: 80%+
  • Critical paths (auth, payments): 95%+
  • New code: 100% (enforce in CI with --changedSince flag)

Quick Info

CategoryTesting
Difficultyintermediate
Version1.0.0
AuthorClaude Skills Hub
testingcoverageanalysis

Install command:

curl -o ~/.claude/skills/test-coverage-analyzer.md https://claude-skills-hub.vercel.app/skills/testing/test-coverage-analyzer.md