The 100% test coverage loop
A goal-based coding-agent workflow that identifies uncovered behavior, adds meaningful tests, and stops when the full suite passe…
A goal-based coding-agent workflow that identifies uncovered behavior, adds meaningful tests, and stops when the full suite passes at 100% coverage.
Use when
Use this when 100% coverage is an explicit project requirement and the repository has a trustworthy coverage command, clear exclusions, and a test suite that can be run repeatedly.
The loop
Add tests until we have 100% test coverage.
Steps
- Run the complete test suite with coverage and save the baseline report.
- Prioritize uncovered branches and behavior by risk instead of file order.
- Add tests that assert meaningful outcomes, failure paths, and boundary conditions.
- Repeat until the full suite passes and the configured coverage report reaches 100%.
Verification
The full test suite passes at 100% coverage. Use the project's coverage report as the source of truth.
Why it works
A concrete coverage target gives the agent a measurable stopping condition and makes skipped code visible. Risk-first ordering keeps the work focused on behavior that matters.
Maintain The 100% test coverage loop?
Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.
[](https://getagentictools.com/loops/100-percent-test-coverage-loop?ref=badge)