Six AI Coding Agents. Coverage Rose. Defects Didn't Fall.

AI Coding
Published on
Written byMayank Singh
Six AI Coding Agents. Coverage Rose. Defects Didn't Fall.

TL;DR: Six coding agents increased test coverage on the same 100 SWE-bench Pro tasks, but the defect signal did not fall. Treat agents as bounded executors. Judge them by context-specific defects, escaped production defects, and evidence verified by others, not test volume.

A versioned prompt and defect-first release contract turn model capability into a controllable system.

Key Takeaways: - Coverage shows where code ran, not whether tests protected product behavior. - Faros AI traced the largest failure driver across about 4,000 failures to one prompt sentence. - Use defect rubrics, mutation checks, canaries, and incident feedback to govern delegation.

Six Agents, One Harness: Coverage Up, Defects Flat

Illustration for Six Agents, One Harness: Coverage Up, Defects Flat

Six AI coding agents raised test coverage on the same 100 SWE-bench Pro tasks, yet the defect signal did not fall. More AI-generated code and more tests can coexist with unchanged production risk. The first question is whether the comparison itself was fair.

Controlled Comparison

Faros AI tested six models under one harness. Each model received the same 100 SWE-bench Pro tasks. - `gemini-flash-lite-3.1` - `claude-haiku-4-5` - `gpt-5-mini` - `gemini-flash-3` - `gemini-pro-3.1` - `claude-opus-4-7`

Each patch was graded against its task rubric. This created a controlled comparison, not a universal vendor leaderboard.

1task_set: swe-bench-pro
2task_count: 100
3harness: shared
4grading: task_rubric

With the harness fixed, grading fairness becomes the next question.

Like-for-Like Grading

Like-for-like grading removed one obvious confound. Agents did not receive an easier task or a weaker standard. The setup supports comparisons within the study, but it does not establish a universal model winner.

Model behavior and training shape outputs, a pattern explained by AI coding agents and the training behavior behind their outputs. The result also fits the warning in AI coding assistants quietly weakening engineering metrics.

Even with fair grading, the study's central metric split in an unexpected direction.

The Paradox

The paradox began when activity and risk moved apart. Coverage showed where tests exercised code, not whether assertions captured real product behavior.

Here, reported coverage rose while the rubric-based defect signal stayed flat. More execution did not remove more observed defects. That separates activity metrics from risk actually removed.

Yet the evidence supports a narrower claim than production safety would require.

Evidence Boundary

The observed defects came through task rubrics, not live production monitoring. The study did not establish a rate of escaped production defects, so it cannot support that finding.

CTOs should adopt escaped production defects as the outcome metric and use coverage to locate gaps. If more coverage did not remove more defects, the reassuring number is measuring the wrong thing.

That mismatch explains why rising coverage can hide defects instead of exposing them.

Why Rising Test Coverage Can Mask Production Defects

A passing test can be worse than no test when it certifies the wrong assumption. Coverage rewards execution, while production safety depends on meaningful oracle quality. The first false sense of security comes from the gap between those two measures.

Coverage Is Not Oracle Quality

Executing a code path proves only that the path ran. It says nothing about whether the assertion captures product truth.

A broad test suite can touch every major branch while checking only visible behavior. That creates activity without assurance.

The missing assurance starts with context the test never received.

The Missing Context

AI-generated tests covered broad paths while missing subtle, context-specific scenarios that experienced testers know to check. Context can involve ordering, partial failure, retries, or behavior inherited from another module.

How AI/ML training shapes AI-generated code and test assumptions helps explain why the same assumptions can recur across implementation and tests.

Those omissions appeared repeatedly, forming predictable defect clusters.

Predictable Defect Clusters

Faros AI found recurring clusters around four behavior types: - Error handling: Expected failures can escape as uncaught errors. - Edge cases: Boundary values and unusual sequences remain unstated. - Null and undefined: Happy-path assumptions overlook absent states. - Concurrent access: Sequential tests can miss shared-state races.

These problems were more prevalent in AI-generated code than in human-written code.

Their shared pattern points to a deeper problem with how agents and tests reason together.

Shared Blind Spots

Implementation and tests generated from the same assumptions are correlated evidence, not independent validation. If both artifacts misunderstand the product, they can agree on the wrong behavior.

Require context from experienced engineers or testers before accepting the agent's view of correctness.

Such weak evidence demands a reporting model built around risk, not one headline number.

Better Reporting

Replace one repository-wide percentage with segmented views for failure paths, boundary conditions, null states, concurrency, and regressions from past incidents.

1coverage:
2 role: diagnostic_only
3
4risk_slices: - error_paths - boundary_conditions - null_states - undefined_states - concurrency - incident_regressions

Coverage can show where AI-generated code was exercised. Escaped production defects show whether that exercise changed business risk. The recurring failure clusters point to a deeper issue: agents need better direction.

The strongest clue lay in a single prompt sentence.

One Sentence Dominated ~4,000 Agent Failures

The largest failure driver wasn't model capability. It was prompt design.

Faros AI clustered about 4,000 agent failures across the six models. Its failure analysis identified one prompt sentence as the largest driver, not a capability gap.

That finding requires careful handling before teams act on it.

Editorial Precision

The abbreviated source does not reproduce that sentence, so no quotation can be reconstructed from it. Check the original post for the exact wording before copying it into an internal template.

Even without the exact wording, the result reveals a clear mechanism.

The Mechanism

When behavioral boundaries stay implicit, an agent can complete the visible request while missing context-specific expectations. That is a system-design failure, even when every individual response looks competent.

The link between model behavior, inference, and AI training constraints and output quality makes prompt design a systems concern.

This mechanism shifts the comparison from model choice to system design.

System Over Model

The CTO question isn't which agent is smartest. It's which system produces clear requirements, exposes edge cases, and verifies the patch.

This changes the unit of comparison from a model to a delivery system. The model executes instructions. The surrounding system must make the boundaries explicit.

Treating that system as a controlled input starts with the prompt.

Prompt as Production Code

Version prompts like source code. Change one instruction at a time, then rerun the same tasks and rubric.

Every prompt must state: - The objective. - Affected behavior. - Expected failure modes. - Required evidence. - The stop condition.

1objective: "State the user-visible behavior to change."
2affected_behavior: "List every affected path and invariant."
3failure_modes: "List error, boundary, null, undefined, and concurrency cases."
4required_evidence: "Name the tests and outputs that prove the change."
5stop_condition: "Stop when the rubric passes and required evidence exists."

Do not declare a model winner from this experiment. Treating the prompt as a controlled variable leads to a practical fix: replace test-count reporting with a defect-first evaluation contract.

The practical fix needs a contract that can reject weak patches.

Build a Defect-First Evaluation Contract for AI Coding Agents

Illustration for Build a Defect-First Evaluation Contract for AI Coding Agents

A good contract should reject a weak patch before production, not explain it after an incident. It should turn hidden expectations into reviewable evidence.

The contract must start with tasks that reveal those hidden expectations.

Representative Task Set

Start with internal tasks containing production bug patterns, cross-module behavior, and known edge cases. Public benchmarks are controls, not substitutes for your system's context.

Representative tasks alone cannot prove which agent performed better.

Controlled Baseline

Run AI agents and the human baseline against the same harness, repository snapshot, rubric, and tool permissions. Prompt or workflow differences then remain visible rather than contaminating the comparison.

That control only works when every task uses the same acceptance structure.

Copyable Acceptance Contract

Use one acceptance structure across tasks:

1changed_behavior: "Describe the user-visible behavior that changed."
2normal_path: "Define expected behavior for valid input."
3failure_path: "Define expected behavior for a handled failure."
4edge_cases: "List boundary conditions that must remain correct."
5null_undefined: "List absent states and required handling."
6concurrency_retry: "Define ordering, retry, or concurrency behavior, or mark not applicable."
7residual_risk: "State what remains unverified."
8
9regression_test:
10 fails_before_patch: true
11 passes_after_patch: true

The structure creates evidence, but teams still need to score each risk separately.

Grading Dimensions

Score these dimensions separately: - Task-rubric completion. - Context-specific scenario coverage. - Defect-prone behavior. - Test strength. - Artifact completeness.

Do not collapse them into one quality score. A single score hides which control failed.

Test strength needs a direct check beyond a passing assertion.

Mutation Testing

Following Orangebeard's testing-evidence approach, add mutation testing. A mutation changes behavior in a way that a correct test should detect. If the test still passes, its signal is weak.

Weak test signals must block the release path. The next challenge is detecting those weak signals before code ships.

CI Gate

Run the release sequence in this order:

  1. Agent patch.
  2. Baseline tests.
  3. Rubric scenarios.
  4. Mutation check.
  5. Human approval.
  6. Canary deployment.
  7. Defect log.

Any missing context-specific case blocks release, regardless of overall coverage. Track escaped production defects, recurring categories, context misses, mutation results, review effort, and rework.

These practices extend enterprise AI/ML training and evaluation practices from models into agent-generated code. An evaluation contract still fails if a plausible but defective patch can bypass it in the delivery pipeline.

Gate AI-Generated Code Before It Can Escape

A polished patch can still escape because the delivery pipeline trusts the agent that produced it. Independence, not politeness, must decide whether code ships.

The first control is where and how the agent can execute.

Isolated Execution

Run agents on isolated branches with constrained permissions and locked dependencies. Retain prompts, tool calls, patches, and test output for later audit.

1execution:
2 branch: isolated
3 permissions: constrained
4 dependencies: locked
5
6retention: - prompt - tool_calls - patch - test_output

The same discipline appears in production safeguards for AI-trained coding systems: constrain execution, verify independently, and preserve evidence.

Execution control still leaves one question: who verifies the result?

Independent Verification

Review the agent's tests against a separately authored scenario set. Include: - Error handling. - Edge cases. - Null and undefined states. - Concurrent access.

This avoids the skipped checks described in three reviews your AI-native refactor skips. A separate author breaks the shared-assumption loop.

Independent scenarios become stronger when each regression test proves the defect existed.

Regression Proof

Demand evidence that each regression test fails against pre-patch behavior and passes after the change. A test that passes in both states cannot prove that the patch fixed the defect.

Proof of the fix still does not determine how much release friction the risk warrants.

Risk-Based Release

Apply mutation testing, focused human review, canary deployment, and rollback controls to high-risk modules. Allow lower-risk changes a lighter path, but keep traceable evidence for every agent-generated release.

Use canary controls as evidence gates, not automatic approval buttons.

Release controls work only if their outcomes feed back into future prompts and tests.

Closed Feedback Loop

Tag every agent-generated release and connect it to subsequent incidents. Feed escaped-defect categories back into prompt templates, rubric items, and test fixtures.

That feedback creates the evidence needed to expand delegation safely. The next test is whether this governance model holds as agent ownership expands.

Enterprise Rollout

Once AI-generated code is gated by defect evidence, the CTO can judge delegation by outcomes rather than activity.

That shift requires a dashboard built around production outcomes.

Measure Escaped Defects, Not Agent Activity

Most agent dashboards measure motion. They count generated lines, completed tasks, and passing checks while production risk stays hidden.

The operating change starts with the metric that best captures risk.

The Operating Change

Make escaped production defects the north star. Keep test coverage as a diagnostic guardrail.

Evaluate agents on whether they remove context-specific failures. That approach connects code delivery to long-running enterprise AI systems and operational governance.

The north star still needs supporting signals that show where risk remains.

Better Executive Metrics

Review these signals together: - Escaped defects. - Recurring error, edge-case, null, undefined, and concurrency failures. - Context-scenario misses. - Mutation results. - Review time and rework. - Rollback rate. - Delivery cycle time.

Do not blend them into one score. The pattern matters more than any single metric.

Read together, those signals can guide which level of agent ownership fits each task.

Smarter Delegation

Use the evidence to sort work into three lanes: - Agent-owned: The agent can complete the task end to end. - Agent-owned with review: A second reviewer checks context-sensitive behavior. - Human-led: Context outweighs the speed advantage.

Delegation becomes an evidence-backed operating decision, with the next release testing where the boundary should move.

About the author

MS
Mayank Singh
Software Developer, Levitation Infotech

Mayank Singh is a software developer at Levitation Infotech, where he builds web and AI-powered applications across the company’s fintech, healthcare, and enterprise projects.

Supercharge Your Success with Our Expertise

Amplify Your Business with Our Expertise. Explore Services Tailored for Your Success.

Get In Touch