Discover why code coverage is essential for AI-generated code, helping teams enforce quality gates, identify testing gaps, and ship with confidence at scale.
.png)
Every engineering leader we talk to describes the same fundamental shift: code is getting cheaper to produce, and faster, than any team's ability to understand it. One agent can open a pull request, watch a test fail, patch it, and retry, burning through several CI cycles before a human ever looks at the change. Multiply the problem by a fleet of agents working in parallel and the volume of code moving through CI isn't growing linearly. It's compounding.
Building on our earlier look at agentic code quality, this post covers the Codecov acquisition and what we're seeing in our own pipelines.
The Software Factory is no longer a metaphor. It’s already taking shape. Agents are becoming the workforce, picking up tickets, alerts, and events and writing code at scale, with developers stepping in only at checkpoints. But a factory without quality control is just a machine for producing defects. Humans need strong quality signals and metrics to make the whole system viable.
A green build is no longer a good enough proxy for high-quality code. The scarce resource is now confidence.
A passing build tells you what passed, not what ran
Consider an agent that adds a new feature to a service and writes no tests or writes tests that cover only the happy path, or edits existing tests just to make them pass. The existing test suite still covers the existing paths, so it passes. The new feature ships untested, and the build stays green.
This is the gap Code Coverage closes. Test results say whether tests passed. Coverage says whether the code was actually exercised, and it can block pull requests that don’t meet your coverage criteria, which pushes developers and agents to add test cases until the gaps are closed. When code has just changed, knowing which lines were never tested is the most useful place to start improving quality.
This matters even more for agents. A developer can look at a build, recognize a flaky test, and judge whether an uncovered path is important to test. An agent can only act on the context we give it. A low percentage tells it something is wrong. Missed lines and uncovered branches tell it where to improve. The more specific the signal, the better the next iteration.
Why Coverage Is Critical in the Agentic Loop
Quality gates for AI-generated code have become a category of their own. They require strict checks, explicit recommendations, coverage-based conditions, and a clear view of known gaps in the solution. Together, these form the gate for what is tested and whether to ship.
This is why we acquired Codecov in June 2026. Codecov already gives engineering teams, across tens of thousands of repositories, a trusted view of how much of their code was tested and whether it meets their threshold to ship safely. In an agentic world, coverage data can't sit off to the side in a dashboard. It has to live in the delivery pipeline, where the decision about whether a change is merged is actually made. Coverage data works best when it's embedded in that pipeline, and we at Harness agree.
There are three reasons why code coverage is critical to the AI Delivery Lifecycle (AI DLC):
First, coverage becomes a release signal, not a report. Inside the Harness Software Delivery Knowledge Graph, coverage sits alongside deployment history, security reachability analysis, incident telemetry, and change history. That lets teams ask the questions that matter: what changed, how was it tested, and is it safe to ship? A coverage number in isolation is a metric. Coverage tied to a change, a service and a production history is a decision input.
Second, agents need to be held to a standard they can't quietly renegotiate. One of the subtler risks in agentic development is that an agent shown a failing test may be tempted to rewrite the test instead of fixing the code. Coverage enforced as a threshold in the pipeline, independent of the agent that produced the change, is exactly that kind of check.
Third, coverage provides an audit trail of tests implemented and executed. With software factories like Cosmos coming into the picture, a definitive audit trail of tests authored and executed becomes essential. With coverage thresholds enforced in the pipeline, code that doesn’t meet the bar doesn’t move toward production, and coverage reporting becomes the audit record for the agent.
What We've Learned So Far at Harness
Coverage is becoming a routine part of how teams build software at Harness. Between July and September, our Harness cluster recorded more than 30K coverage uploads across 700 pipelines, at a storage footprint of roughly 116 MB.
We are still in the early stages, but we are already seeing a considerable increase in coverage across the organization. It's the leading edge of a pattern we expect to grow as agents multiply the number of builds per change.
- Since adopting coding agents, we have seen a 7x growth in builds per pull request across our own repos
- Selecting relevant tests cut build time by 30% without missing failures that the full suite caught.
- Enforcing coverage thresholds in the pipeline caught both high-impact and subtle failures before merge that would otherwise have shipped with untested code.
The pattern is consistent: aggregate numbers hide the problem. A repository can look healthy while one code path trends the wrong way or a frequently changed file keeps accumulating untested code. That's why the useful view of coverage gets more specific as code moves faster: trends at the repository and branch level, uncovered lines at the file level, coverage thresholds that fail the build before a change moves on.
Quality is a set of signals, not a single score
But coverage is just one quality signal among many. A change can have strong coverage and still fail for other reasons: the wrong tests ran, a flaky test caused a failure, or integration tests don’t account for how users behave in the application.
So we're bringing these signals together inside the same build. Harness Builds uses Test Intelligence to run the tests that matter, code coverage to show what those tests exercised, and flaky-test detection to separate noise from real failures. Each tells you something different, and together they say far more than any single green checkmark.

Branch-level view: coverage over time, with per-directory coverage below.

File-level view: uncovered lines highlighted in red show exactly where a test is missing.
Evolution of CI with Coverage
Our evolution of CI isn't defined by how fast it can process more code. It's defined by how quickly CI can tell a team whether that code is ready for production. We give quality metrics based on this data.
- Feedback built for agents as well as humans. Specific, machine-readable signals (e.g., which tests mattered, what failed, what was exercised, where coverage dropped) so the loop of build, learn, and fix gets tighter with every iteration.
- Coverage woven into the Knowledge Graph. Real-time coverage tied to both repositories and changes flowing through the pipeline, enriched with deployment, security, and incident context, to assess release risk before code reaches production.
- Enforcement by default. Thresholds and policy gates that run in the pipeline itself, independent of whoever or whatever wrote the code.
- A clean handoff between human judgment and agentic execution. Agents handle the volume. Humans decide where the bar sits. The pipeline holds everyone accountable.
AI changes how fast we can write code. It doesn’t change the fact that someone has to know whether that code is good. In an agentic world, coverage, and the broader set of quality signals around it, is the way to give both humans and agents the confidence to ship high-quality code at scale to production.
Learn more about Harness Code Coverage, or read our earlier post, Agentic code is changing how we think about code quality.




