home / skills / shotaiuchi / dotclaude / review-test-coverage

review-test-coverage skill

/dotclaude/skills/review-test-coverage

This skill helps review test coverage across unit and integration tests, ensuring edge cases, quality, and maintainability.

npx playbooks add skill shotaiuchi/dotclaude --skill review-test-coverage

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
1.8 KB
---
name: review-test-coverage
description: >-
  Test coverage-focused code review. Apply when reviewing code for
  missing unit tests, integration tests, edge cases, error handling paths,
  test quality, and test maintainability.
user-invocable: false
---

# Test Coverage Review

Review code from a testing perspective.

## Review Checklist

### Unit Test Coverage
- Verify all public functions have unit tests
- Check boundary conditions and edge cases are tested
- Look for missing null/empty/error path tests
- Verify assertions are meaningful (not just "no exception thrown")

### Integration Test Coverage
- Check critical user flows have integration tests
- Verify API endpoints are tested end-to-end
- Look for missing database interaction tests
- Check external service integration points

### Test Quality
- Verify tests are independent (no shared mutable state)
- Check test naming clearly describes the scenario
- Look for flaky tests (timing, ordering, external dependencies)
- Verify proper use of mocks/stubs (not over-mocking)

### Edge Cases & Error Handling
- Check error paths are tested (exceptions, failures)
- Verify timeout and retry behavior is tested
- Look for race condition tests in concurrent code
- Check boundary values (0, -1, MAX, empty, null)

### Test Maintainability
- Verify test helpers/fixtures reduce duplication
- Check tests don't depend on implementation details
- Look for proper setup/teardown handling
- Verify test data is clear and self-documenting

## Output Format

Report findings with priority:

| Priority | Description |
|----------|-------------|
| Missing | Critical path without any test coverage |
| Incomplete | Test exists but misses important cases |
| Quality | Test exists but has quality issues |
| Enhancement | Additional test would improve confidence |

Overview

This skill performs a test coverage-focused code review to find gaps in unit and integration tests, edge cases, and test quality. It highlights missing critical paths, incomplete cases, and maintainability issues to improve confidence in the codebase. The report prioritizes findings so teams can act on the highest-risk gaps first.

How this skill works

The skill inspects source and test files to verify that public functions and API endpoints have corresponding tests, and that error and edge conditions are exercised. It evaluates test quality: independence, naming, flakiness risks, and proper use of mocks and fixtures. Finally, it categorizes findings into Missing, Incomplete, Quality, or Enhancement priorities for actionable follow-up.

When to use it

  • Before a release to ensure critical flows are covered
  • During pull request reviews to catch missing tests early
  • When adding new public APIs, modules, or services
  • When diagnosing flaky CI failures or unclear test coverage
  • During refactoring to ensure behavior remains validated

Best practices

  • Require unit tests for all public functions and boundary values (0, -1, MAX, empty, null).
  • Write integration tests for end-to-end flows and database/external service interactions.
  • Keep tests independent: avoid shared mutable state and ensure proper setup/teardown. Use fixtures and helpers to reduce duplication.
  • Make assertions meaningful: verify outputs and side effects, not just absence of exceptions.
  • Avoid over-mocking critical paths; prefer integration tests where external behavior matters. Test error and retry behavior explicitly.

Example use cases

  • Review a pull request that adds a new module to ensure all public functions have unit tests and edge cases covered.
  • Audit a legacy repository to identify untested critical endpoints and missing database interaction tests.
  • Investigate recurring flaky tests to find timing, ordering, or external dependency causes and propose fixes.
  • Assess test suite maintainability during a refactor to ensure tests rely on behavior, not implementation details.
  • Verify retry and timeout logic by adding tests for failure and recovery scenarios.

FAQ

What does 'Missing' priority mean?

A critical code path has no tests at all and requires immediate coverage to avoid regressions.

How do you detect flaky tests?

Look for tests that depend on timing, external services, ordering, or shared state; reproduce failures locally and check CI history for intermittent failures.