> ## Documentation Index
> Fetch the complete documentation index at: https://docs.revolte.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Add and maintain test coverage

> Find coverage gaps, generate tests that follow your conventions and keep tests running on every build.

This guide takes you from a feature with thin tests to tests that run on every build. You review every test before it is merged.

**1. Find the gaps and generate tests**

Pick an existing feature, find where coverage is thin and generate tests that follow your project's conventions. See [Generate tests for existing code](https://docs.revolte.ai/use-cases/generate-tests.md).

**2. Review the generated tests**

Inspect the changed files before you accept them, using the diff summary and verification checklist. See [Review code changes](https://docs.revolte.ai/workflows/review-ai-changes.md).

**3. Run the tests in your pipeline**

Add a Test Suite stage so unit and integration tests run automatically, with the triggers and run policies you choose. See [Test Suite pipeline stage](https://docs.revolte.ai/yaml/repo-preferences/pipelines/test-suite.md). Add a [Code Quality stage](https://docs.revolte.ai/yaml/repo-preferences/pipelines/code-quality.md) for linting and static analysis.

**4. Gate every build**

Run code review, code quality and test checks before every build so gaps are caught before release. See [Configure pre-build workflows](https://docs.revolte.ai/yaml/repo-preferences/prebuild-workflow.md).

**5. Keep it going as code changes**

Ask for an independent review of a branch or pull request at any time. See [Standalone Code Review Agent](https://docs.revolte.ai/workflows/standalone-code-review.md).

## You are done when

* New tests are merged and pass in your pipeline.
* A failing test blocks the build before release.

## Next

> [card] [Ship from first commit to production](https://docs.revolte.ai/use-cases/engineering/first-commit-to-production.md)

> [card] [Modernize a legacy codebase](https://docs.revolte.ai/use-cases/devops/modernize-legacy-codebase.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.