Section 08 · Monitoring & Health

Testing & Code Metrics

Test coverage, testing practices, and code quality metrics for maintaining reliable, maintainable code

6 items 4 critical 2 recommended

This guide walks you through auditing a project's test coverage, testing practices, and code quality metrics.

The Goal: Confidence in Change

Every code change is validated by automated tests. Quality cannot silently degrade.

  • Enforced — CI fails when coverage drops below threshold
  • Complete — bug fixes include regression tests, features ship with test coverage
  • Critical-path — e2e tests cover revenue-impacting journeys (auth, checkout, core flows)
  • Measurable — complexity metrics tracked with established baselines
  • Automated — test and lint commands documented for agents and developers alike

Before You Start

  1. Confirm you're in the target repository's root directory
  2. Know the project's test framework (Jest, Vitest, pytest, etc.)
  3. Have dependencies installed (pnpm install or equivalent)