Next-Gen App & Browser Testing Cloud
Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles

Measured defect rates for AI-generated code disagree by a factor of eight, because each study counted something different. Here is what breaks and which gate catches it.

Saurabh Prakash
Author

Sandeep Yadav
Reviewer
Published on: August 27, 2026
One number does most of the arguing about AI-generated code quality. CodeRabbit's December 2025 analysis of 470 open-source pull requests found that AI-assisted changes carried roughly 1.7 times more issues than human-only ones, and that figure now anchors most of what gets written on the subject.
It is a real finding from a real dataset, and it is also the narrowest of the four measurements available. The report counts issues rather than bugs, its taxonomy includes readability and formatting, and the counting was done by the vendor's own reviewer.
Set it beside the other datasets and the reported gap runs from 8 percent to 68 percent. Which end of that range matters to you is not decided by the study you cite, it is decided by which of your gates the extra defects walk past.
Key Takeaways
Independent studies all find more defects in AI-assisted code, and they disagree on the size by roughly a factor of eight. The spread comes from what each one counted: review findings on a diff, bugs attributed to a developer, and security issues inside already-vulnerable code samples are three different measurements.
What the headline numbers actually measure
Where the defects survive your pipeline
Measurably buggier than human-written code in every published dataset, with the reported gap running from 8 percent to 68 percent because the two ends do not measure the same thing. The most widely quoted figure is roughly 1.7 times more issues, and it comes from a single source that is worth understanding before you repeat it.
That figure originates in CodeRabbit's State of AI vs Human Code Generation report, published in December 2025. The study scored 470 open-source GitHub pull requests, 320 of them AI co-authored and 150 written by humans alone.
Across that set, AI-authored changes averaged 10.83 issues per pull request against 6.45 for the human-only group. Two qualifications belong next to the number wherever it is used.
An independent measurement points the same way with a smaller multiplier. Uplevel analysed engineering data from nearly 800 developers, tracking cycle time, pull request throughput, bug rate, and extended working hours rather than self-reported survey answers, and found that the group using GitHub Copilot introduced 41 percent more bugs.
The practical consequence is that the exact multiplier matters far less than where the extra defects land. That is a question about your gates, and it is separate from the question of whether AI review tooling reads a diff well, which we cover in AI code review vs verification.
Because none of them are counting the same object. One counts review findings on a diff, one counts bugs attributed to a developer cohort, and one counts security issues inside code samples already known to be vulnerable. Those three numbers were never going to converge.
| Source | What it counted | Sample | Result |
|---|---|---|---|
| CodeRabbit | Issues raised by its own AI reviewer on pull request diffs, including readability and formatting categories | 470 open-source pull requests, 320 AI co-authored | About 1.7 times more issues, 10.83 against 6.45 per pull request |
| Uplevel | Bugs introduced, measured from engineering metrics across nearly 800 developers | Developers with and without GitHub Copilot access | 41 percent more bugs in the Copilot group |
| Cotroneo, Improta and Liguori | Security issues per vulnerable code sample, human against model output on matched Python and Java tasks | 507,044 paired instances from 16,928 repositories | In Python, 1.62 issues per vulnerable human sample against 1.75 for ChatGPT and DeepSeek-Coder and 2.10 for Qwen |
| GitClear | Maintainability signals in changed lines, which are not defects at all | 211 million changed lines, 2020 to 2024 | Copy-pasted lines rose from 8.3 to 12.3 percent while refactored lines fell from 25 percent to under 10 |
The largest of the four is academic. Cotroneo, Improta and Liguori paired 507,044 code instances drawn from 16,928 open-source repositories and ran identical analysis over both sides, which is the closest anyone has come to a controlled comparison.
Their result is the least dramatic and the most narrowly scoped. In the Python half of the corpus, each vulnerable sample carried 1.62 security issues for human-written code, 1.75 for ChatGPT and DeepSeek-Coder, and 2.10 for Qwen, with the paper reporting Java separately and finding a wider gap there.
That is an 8 percent gap for one model family and 30 percent for another, which says the model you pick moves the number as much as the fact that a model wrote it. It also shows why these figures cannot be stacked: this one counts security issues inside samples already known to be vulnerable, while CodeRabbit counts every category of review finding across whole pull requests.
GitClear's work belongs in a different column entirely. It tracks how code is shaped rather than whether it is correct, and the shift it records over 211 million changed lines is toward duplication and away from refactoring.
The distribution is skewed rather than uniform. In CodeRabbit's dataset, logic and correctness issues were 75 percent more common in AI pull requests, error-handling gaps were nearly twice as common, and security findings ran up to 2.74 times higher. Five classes account for most of what teams actually hit.
The code compiles, runs, and does something adjacent to what was asked. A discount function that applies the percentage to the post-tax total rather than the pre-tax subtotal is correct in every mechanical sense and wrong in every business sense.
Nothing in a type checker, a linter, or a generated test suite disagrees with this class of defect, because none of those tools hold the requirement. It reaches production more often than any other category.
Models are trained on code that mostly demonstrates the working case, and they reproduce that emphasis. The typical path is handled well, and the boundaries around it thin out quickly.
A model's view of the platform is frozen at its training cutoff, and the web moves underneath it. This produces a defect class that almost no writing on AI code quality names, and it is the one that most reliably escapes continuous integration.
An agent asked for a function writes a function, and it rarely goes looking for the one that already exists three directories away. GitClear's analysis records the aggregate effect: copy-pasted lines climbed from 8.3 to 12.3 percent of changed code while refactored lines fell from 25 percent to under 10.
Duplication is not a defect on the day it ships. It becomes one on the day a fix lands in three of the four copies.
Error handling was nearly twice as likely to be flagged in AI pull requests in the CodeRabbit dataset, and the failure is usually structural rather than absent. A catch block exists, logs the exception, and returns as though nothing happened, which converts a loud failure into a silent one.
No single gate catches more than a slice, and the gates most teams already run are concentrated on the classes AI produces least dangerously. Mapping defect class to gate is more useful than adding another scanner.
| Defect class | Gate that catches it | Why the usual gates miss it |
|---|---|---|
| Intent drift | A human who holds the requirement, or an acceptance test written before generation | Every automated gate checks the code against itself, and the requirement is not in the code |
| Happy-path bias | Property-based and boundary tests written independently of the implementation | Generated unit tests exercise the same path the generated code was written for |
| Stale-training defects | Execution in real browsers and on real devices, across engines rather than one | Headless Chrome in continuous integration is the exact environment the defect is invisible in |
| Duplication debt | Static analysis with clone detection, tracked as a trend rather than a per-pull-request gate | Every copy passes review individually, and the cost only appears at the next change |
| Unhandled error paths | Fault injection, plus lint rules that reject a catch block with no rethrow or handler | Coverage counts the catch block as covered once any test enters it |
| Circular test coverage | Mutation testing, which measures whether the suite can detect a deliberate change | Coverage percentage rises with test volume and says nothing about detection power |
The scale of the exposure is now industry-wide rather than niche. Google Cloud's 2025 DORA report found that 90 percent of survey respondents use AI at work and that 30 percent report little or no trust in the code it generates, while reporting a positive relationship between AI adoption and delivery throughput alongside a continued negative relationship with delivery stability.
That combination is the whole problem in one sentence: more change arriving faster, with less confidence attached to each unit of it. Closing it means adding a gate the coding agent cannot satisfy by reasoning about its own output.
This is the gap Kane CLI is built for. It drives a real Chrome browser from the terminal or from inside a coding agent's own loop, takes objectives in plain English rather than selectors, and returns a pass or fail anchored to evidence such as DOM state, URL changes, network responses, screenshots, and console logs. Because the verdict comes from the rendered application rather than from the source, the agent that wrote the code cannot talk it into passing.
Only where the assertion comes from somewhere other than the implementation. When one model writes both the feature and its tests, the suite encodes a single interpretation twice, and agreement between the two proves consistency rather than correctness.
Developers already report the cost of this. In the Stack Overflow Developer Survey 2025, with 84 percent of respondents using or planning to use AI tools, the top frustration was AI solutions that are almost right but not quite, cited by 66 percent, and the second was that debugging AI-generated code is more time-consuming, cited by 45 percent.
The failure is visible in the shape of the assertion rather than in the syntax, which is why it survives review.
// Circular: the expected value is produced by the code under test.
test("applies the discount", () => {
expect(applyDiscount(100, 20)).toBe(applyDiscount(100, 20));
});
// Independent: the expected value comes from the requirement.
test("a 20 percent discount on 100 leaves 80", () => {
expect(applyDiscount(100, 20)).toBe(80);
});Generated end-to-end tests carry a second problem on top of the first. They tend to reach for hard-coded waits and positional selectors, both of which produce suites that pass locally and flake in continuous integration.
Mutation testing is the practical answer to circular coverage, because it changes the implementation deliberately and reports which tests noticed. A suite with high coverage and a low mutation score is measuring itself. The structural version of this argument, and where a second agent does and does not help, is in can coding agents test their own code.
Because continuous integration usually runs one engine, headless, at one viewport, and a stale-training defect is defined by the engines where the assumption no longer holds. The pipeline is not wrong about what it checked. It checked a surface the bug does not live on.
The shape this takes in practice is familiar. A team merges an agent-written component with passing unit tests and a clean linter, and the support tickets that arrive two days later all come from one browser, because the generated markup reached for a layout property its training data treated as universally supported and Chrome quietly forgave the difference.
The distinction is easy to see once you assert against the rendered page rather than the returned value. The run below is from build 102686377 on the TestMu AI cloud, driving Chrome on Windows 11 against the Simple Form Demo page of the Selenium Playground.
[nav] simple-form-demo loaded in 802 ms
[assert] #message rendered text = "verify rendered output, not source"
[assert] #message boundingBox = {"x":833.84375,"y":427.5,"width":382.15625,"height":24}
[assert] #message computed = {"display":"block","visibility":"visible","opacity":"1","color":"rgb(74, 74, 74)"}
[result] text present in DOM: true
[result] actually visible to a user: true
Both result lines are true here, which is what a passing check looks like. The reason to capture both is that they come apart independently: text present in the DOM and text visible to a user are two different claims, and a generated CSS change can flip the second while leaving the first untouched.
Coverage across engines is the part that cannot be simulated locally. TestMu AI's real device cloud provides 10,000+ real Android and iOS devices, alongside 3,000+ browser and operating system combinations, so a generated component can be exercised on the WebKit and older Android builds where stale-training defects surface.
That specific figure has no traceable primary source, and it is worth retiring from your slides. The chain runs from modern blog posts back to a citation of an IBM Systems Sciences Institute study that researchers have repeatedly failed to locate, most thoroughly by Laurent Bossavit in The Leprechauns of Software Engineering.
The empirical work that does exist is less convenient. Menzies, Nichols, Shull and Layman examined 171 software projects and found no evidence for the delayed issue effect, reporting that the effort to resolve an issue in a later phase was not consistently or substantially greater.
Two better-grounded numbers do the same rhetorical job honestly:
This matters more than pedantry when the argument is about AI-generated code. No published research measures the fix cost of an AI-introduced defect specifically, so any claim that they are more expensive later is an extrapolation. The defensible case for verification is that generated defects escape the gates you already run, not that they cost a mythical multiple to repair.
Every study quoted above measured somebody else's repositories, with somebody else's models and review standards. None of them is published as a method you can run, so the number that applies to your codebase is one you have to generate. Four weeks of tagging is usually enough to see a signal.
The output is a table of defect class against catching gate for your own codebase, which is the version of the earlier table that is actually worth acting on. If the classification step is unfamiliar, our guide to software bugs covers the taxonomy in more depth.
Note: Measuring an escape rate needs the escapes to be visible first, which means running the suite across the browsers and devices your users actually hold rather than the one your pipeline defaults to. TestMu AI runs that coverage on real hardware and keeps the evidence attached to each run. Start free.
Pick the single highest-traffic user flow that an agent has touched in the last month and put one rendered-surface check in front of it. That one change converts the class of defect that currently reaches your users into a failing check, and it takes an afternoon.
The Kane CLI getting started guide covers the first check end to end, including the headless flags and exit codes a pipeline needs. When you are ready to make it a merge requirement rather than an advisory step, setting up a continuous verification gate walks through the pipeline wiring.
Generated code is not going to stop arriving, and the multiplier in the headline was never the actionable part. Knowing which of your gates is blind to which defect class is.
Author
Saurabh Prakash is an Engineering Manager at TestMu AI (formerly LambdaTest), where he leads engineering on agentic AI development and scalable system architecture for the quality engineering platform. He has also contributed to Test at Scale, the company's open-source test intelligence platform. He brings over 9 years of experience across Node.js, Java, Spring, MVC, data structures, algorithms, and scalable system design, with earlier roles as SDE 2 at Zomato, Senior Software Engineer at LogicHub, and Software Development Engineer at Directi. Saurabh holds a B.Tech in Computer Science and Engineering from Delhi Technological University.
Reviewer
Sandeep Yadav is a Senior Software Engineer at TestMu AI (formerly LambdaTest), where he builds the platform's test intelligence and AI-native engineering systems. He has architected autonomous GitHub Apps, vector-search code intelligence, and self-diagnosing QA workflows, and designed distributed platforms that process 2M+ daily test executions and 1B+ events, turning high-volume test, log, and code data into intelligent, self-optimizing systems. He works on embedding reasoning models into production infrastructure to power autonomous review, root-cause analysis, and analytics workflows. He brings over four years of engineering experience with deep expertise in the Elastic Stack, Apache Kafka, and Redis. Earlier he engineered a GDPR-compliant, end-to-end-encrypted secure web-chat application at Mithi. A Facebook Hackercup 2021 Round 2 qualifier and merit-scholarship recipient, Sandeep holds a B.Tech in Electrical Engineering from Delhi Technological University.
Did you find this page helpful?
More Related Blogs
TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance