Ievgen Ievdokymov

Written by: Senior AQA Engineer

Ievgen Ievdokymov

Updated: 04.12.2026

18 min read

AI-assisted development is the new norm. Yet, a large-scale study published in March 2026 analyzed more than 304,000 verified AI-authored commits across 6,275 GitHub repositories and found more than 484,000 distinct issues introduced by AI coding assistants. More than 15% of commits from every assistant they studied introduced at least one issue, and nearly a quarter of the tracked issues were still present in the latest version of the repositories.

Should we step back from using AI because of it? Not at all. Human-written code has a lot of bugs, too. The bigger takeaway is that, in many cases, the review process hasn’t been adjusted yet to catch issues commonly introduced by AI.

A QA process built around human-written code may cover many of the usual failure modes. But when an AI assistant does more of the implementation work, often applying the same review to a larger volume of code isn't enough.

There is no need to inspect every line generated by Copilot, Cursor, Claude Code, or another AI assistant. The key thing is to understand where AI-assisted development creates different risks and adjust QA accordingly.

Ready to take your software quality to the next level?

The claim everyone gets wrong: "more bugs" vs. "different failure patterns"

CodeRabbit's State of AI vs Human Code Generation report analyzed 470 real-world open-source PRs and found that AI-co-authored PRs contain about 1.7x more issues overall than human-only PRs. Logic and correctness issues rose by 75%, security vulnerabilities were up to 2.74x higher, and formatting problems were 2.66x higher.

These figures serve as a signal, but they don't tell a QA team what to change in its pipeline. The data on defect categories is more useful here. Different types of problems require different checks, and a QA process focused on traditional failure patterns may not catch all of the issues AI-assisted development introduces.

Spending 40% more time on code review may not catch a logic drift problem. Adding a contract test at the API boundary might. This article explains why that distinction matters and what QA teams can do about it.

API testing with Playwright. A Practical guide for QA engineers

Learn more

Why is the failure mode structurally different?

The difference starts with how the code gets produced.

An AI assistant generates code from the context available to it. That might include a developer's prompt, the files the tool has retrieved, relevant documentation, and parts of the codebase. It doesn't have the full history of why the system works the way it does.

By recognizing patterns during its training and in the code it can see, the model creates syntactically clean and locally plausible code. The problem is that some of the context a human engineer carries around never made it into that context. Examples include a business rule discussed three months ago at a meeting, a non-documented upstream data contract, a concurrency assumption baked into a queue consumer, a deployment topology that makes one code path safe and another one not, etc.

This is the mechanism behind what researchers at Apiiro found when they tracked tens of thousands of Fortune 50 repositories from December 2024 through June 2025. Syntax errors in AI-generated code dropped 76% over that period, and simple logic bugs fell 60%. Along with that, privilege escalation paths rose 322%, and architectural design flaws increased 153%. The model got really good at avoiding issues linters already catch, but it still fails when it comes to the things that require reasoning about a system it can't fully see.

What a human bug looks like

A human bug is often scattered and personal. One developer forgets a null check on a Tuesday. Another misreads an API spec. Someone else makes a wrong assumption about how a particular library behaves.

These mistakes can show up as isolated, odd-looking lines in a diff. That's why code review works reasonably well for many of them. A reviewer can spot the suspicious line, explore the decision behind it, and ask the developer to fix it.

Of course, human bugs aren't always that easy to catch. But there is often a specific implementation decision to challenge.

What an AI bug looks like

When it comes to AI-generated bugs, they can be harder to spot because the code itself may look all right.

For example, you can ask an AI assistant to implement user deletion in several different services. If the prompt doesn't explain how deletion is supposed to work across the system, the assistant has to fill in the gaps. One implementation might remove the user record, another might also remove related data, and a third might preserve some records for audit purposes.

While each implementation can seem totally fine on its own, the problem often becomes visible when you look at the system as a whole.

That's the important difference. The failure may not lie in a particular line of code but in the assumption that connects that line to another service, a data contract, a state transition, or a production environment. And that's where a line-by-line diff review has its limits.

When the code is correct but the underlying assumption is wrong, reviewing the code itself isn't always enough. A QA team also needs to test the assumptions behind it.

Five failure categories your QA process should catch

QA engineers don't need to become the second code reviewer. They need to know where code review has blind spots and make sure those areas are covered in their pipeline.

We’ve grouped those blind spots into five categories. They aren’t exclusively AI-related. Human developers can introduce all five too.

The difference is that in AI-assisted development, they are introduced more easily without an obvious mistake appearing in the diff.

That's why spending more time reviewing AI-generated code isn't the best solution. Instead, QA teams should use these failure categories to identify which quality gates are needed to catch problems that a code review may miss.

1. Logic drift

AI can turn an incomplete requirement into an implementation by filling in the gaps. The logic applied may result in valid code that doesn’t match an actual business rule.

This is especially easy to miss when the requirement describes the happy path, leaving exceptions, limits, or state transitions implicit.

For example, if you ask AI to apply a $10 discount to the order total, it may apply the promotional discount after tax, not before it, technically matching the request while breaking a rule finance assumed was obvious.

The tricky part is that the tests can make the problem harder to spot rather than expose it. If AI generates both the implementation and an example-based unit test, the test may share the same interpretation. So, both can be wrong in exactly the same way.

This makes independently defined business rules and invariants extremely useful.

Instead of checking one expected result:

// Example-based test
test('applies discount correctly', () => {
  const result = calculateTotal({
    subtotal: 100,
    discount: 10,
    taxPct: 8
  });
  expect(result).toBe(97.2);
});

you can test the rule itself across a range of inputs with a property-based testing tool such as fast-check:

import fc from 'fast-check';

test('discount is always applied before tax', () => {
  fc.assert(
    fc.property(
      fc.integer({ min: 100, max: 10000 }),
      fc.integer({ min: 0, max: 100 }),
      fc.integer({ min: 0, max: 30 }),
      (subtotal, discount, taxPct) => {
        const discounted = subtotal - discount;
        const expected = discounted * (1 + taxPct / 100);
        expect(
          calculateTotal({ subtotal, discount, taxPct })
        ).toBeCloseTo(expected, 2);
      }
    )
  );
});

The key thing here isn't simply that the test generates more inputs but that the expected behavior is defined independently of the implementation. This way, the test is more likely to catch logic drift.

2. Interface assumption mismatches

An AI model can make incorrect assumptions about how an interface behaves, especially when the full contract isn't available in the context used to generate the code. An upstream API might return null where the generated code expects an empty array. A field might be marked optional in the schema but required by a downstream service. Another service might introduce a new enum value that the implementation doesn't know how to handle.

The code can still compile and pass its unit tests, especially when those tests use mocks that reproduce the same assumptions made during implementation.

Diagram showing a mismatch at the integration boundary.

API contract tests, schema validation, and consumer-driven contract testing, such as Pact, are what can help you catch bugs of this category. Integration tests against representative responses are useful too, particularly for external APIs where you don't control the other side.

One more important aspect to mention is that a component can be correct according to its own tests and be wrong at the boundary where it meets another component. That's why interface behavior also needs to be checked independently of the implementation.

3. Happy-path bias / missing edge cases

AI is very good at addressing obvious scenarios. Ask it to implement a file upload, and you'll probably get code that handles a valid file of the expected size and format. That doesn't tell you what happens when the file is empty, too large, corrupted, duplicated, or uploaded twice.

The same pattern appears everywhere: valid input gets handled; unusual input is left to whatever behavior falls out of the implementation. Having not been burned by a null timestamp or a retry storm, AI doesn't defend against one.

Fortunately, there is a range of techniques for attacking this blind spot: boundary-value analysis, negative testing, equivalence partitioning, and property-based testing, where the input space is large or difficult to enumerate. Mutation testing can also expose weak test suites by checking whether small changes to the implementation still leave the tests green.

4. Security regressions

Veracode's 2025 GenAI Code Security Report tested output from more than 100 LLMs across four languages and found security flaws in 45% of generated samples, with the failure rate exceeding 70% for Java specifically.

Security problems are particularly dangerous because the code can be functionally correct. An AI-generated endpoint may return the right data, handle errors properly, and pass all its functional tests while failing to enforce authorization correctly. It may also trust input that should be validated or expose information through logs or error responses.

SAST tools such as Semgrep or CodeQL, dependency and secret scanning, DAST for running applications, and targeted authorization/security tests are helpful here. For high-risk functionality, don’t rely only on automated scanners but also execute threat modeling and security review before release.

5. Silent architectural drift

This is the hardest category to spot in a PR.

AI can fulfill a feature request by introducing a new dependency, duplicating logic that already exists elsewhere, bypassing an existing service boundary, or introducing state where the architecture expects a stateless component.

Yet, as a result, you may have a working feature, green tests, and code that looks clean. The issue shows up later when two services implement the same rule, a supposedly stateless component starts depending on local state, or a new dependency creates a failure mode that the original design didn't account for.

So, is there a chance to spot issues of that kind? Yes. Just use architecture fitness functions, dependency analysis, architectural rules enforced with tools such as ArchUnit or dependency-cruiser, and architecture review for changes that cross defined system boundaries. Code ownership rules and dependency policies can also catch some of these changes before they are merged.

While architecture isn't QA's responsibility, a QA team should know about architectural drift. It doesn't need to decide whether an architecture is good. The mission is to recognize when a change has increased the regression or integration surface and adjust the validation accordingly.

Key failure categories
Failure category
Why code review can miss it
Quality gate / artifacts that catch it

Logic drift

Generated code can be valid while reflecting the wrong business rule. AI-generated tests may share the same interpretation.

Acceptance and business-rule tests, state-transition tests, and property/invariant tests such as fast-check

Interface assumption mismatches

The code can compile and pass unit tests with mocks that reproduce the same incorrect assumptions about another component's contract.

API contract tests, schema validation, and consumer-driven contract testing such as Pact; integration tests for external APIs

Happy-path bias / missing edge cases

Though the main scenarios work, unusual inputs, boundaries, retries, duplicates, or failure conditions may never be exercised.

Boundary-value analysis, negative testing, equivalence-partition tests, and property-based testing; mutation testing to check whether the test suite actually catches small implementation changes

Security regressions

The feature can work correctly for an authorized user while failing under unauthorized access, malformed input, or other abuse scenarios.

SAST (Semgrep, CodeQL), dependency and secret scanning, DAST, and targeted authorization/security tests; threat modeling for high-risk changes

Silent architectural drift

The change can work and pass tests while introducing unwanted dependencies, bypassing service boundaries, duplicating logic, or changing where state lives.

Architecture fitness functions, dependency rules and analysis (ArchUnit, dependency-cruiser), architecture review for boundary-crossing changes, and dependency/code-ownership policies

The review process gap: why "have a human check it" doesn't work anymore

For years, human code review has been focused on human mistakes like typos, obvious off-by-ones, forgotten imports, and questionable implementation choices. Yet, AI models create code, avoiding many of those visible errors. Usually, AI-generated code is well-formatted, consistently named, and structured in a way that looks like something a competent developer would write. And that's the problem.

Why does reviewer confidence go up while code reliability goes down?

CodeRabbit's research that we've already mentioned found that AI-generated PRs had more issues overall, while the code itself often looks consistent and only breaks local patterns around naming, clarity, and structure on a closer look. This creates an odd combination: the code looks easy to read while carrying more underlying problems.

A reviewer instinctively pays more attention to code that looks suspicious. Strange naming, messy structure, inconsistent formatting, or a huge diff make them stop and take a closer look. AI-generated code often doesn't give you those warning signs. As a result, there might be a potential mismatch between how reliable the code looks and how thoroughly its assumptions have actually been checked.

2x2 matrix plotting how code looks against whether assumptions are verified.

A reviewer might see an API integration with sensible error handling, familiar patterns, and a few solid-looking tests and move on. They may not think to ask whether the upstream service can return a value the implementation doesn't handle, because nothing in the diff looks suspicious.

That's why the point isn't that human review has become useless, but that the usual signals humans have used during review are less useful for deciding where to take a closer look in AI-generated code.

It’s time to change a review checklist

Formatting and structure are still important for maintainability. But reviewers should stop treating them as strong evidence of correct implementation.

Instead, they should ask:

  • What data does this code assume it will receive?

  • What happens if the upstream contract changes?

  • Which business rules does this implementation rely on?

  • Are any important constraints being inferred rather than explicitly verified?

  • What happens when the operation is retried, duplicated, delayed, or run concurrently?

  • What existing services or user flows could be affected by this change?

  • What happens when someone tries to use this functionality without the required permissions?

So the key change that needs to be done is moving from checking if code looks right to checking what assumptions this code makes and where those assumptions are verified. This calls for changing what QA teams spend time on and introducing dedicated QA gates where assumptions can be tested independently.

Refining your QA pipeline for AI-generated code

Taking into account how much AI-generated code is actually running through pipelines today, it makes sense to adjust the QA approach accordingly if it hasn’t been done yet. There’s no need to build a completely new QA process. Just look at where AI-generated code can slip past the checks you already have and strengthen those parts of the pipeline.

Based on our experience, we recommend using the following four-phase process.

Phase 1: Establish a baseline

Before changing your QA gates, evaluate your current pipeline.

Track escaped defects, defect categories, regression rates, and the time it takes to detect and fix production issues. If AI-generated code already makes up a certain portion of development, don't worry about creating a perfect “pre-AI” baseline. Use your current numbers as a starting point and track how they change as AI adoption grows.

Phase 2: Check assumptions

Undeniably, this phase is strategically important. Define where AI is most likely to make a reasonable-looking but wrong assumption.

When it comes to business-critical logic, add acceptance, business-rule, and property-based tests where relevant. At service boundaries, use API contract tests, schema validation, or consumer-driven contracts such as Pact.

This way, you can test things that AI-generated implementation and unit tests might have assumed without verification.

Phase 3: Move security checks earlier

If security scanning is performed mainly at the end of the software development cycle, move the most relevant checks closer to the change.

Run SAST, dependency, and secret scanning as blocking PR checks for appropriate repositories or highly sensitive areas. Also, add targeted authorization and negative security tests for functionality where access control or data breach is a big concern.

Phase 4: Track what changes as AI usage grows

Once AI is regularly used, start looking for patterns to understand which tool is better.

Where attribution is available, record the AI tool and model used for creating or changing a piece of code, along with the resulting defect category. This can show whether certain assistants or model versions are associated with particular problems.

Team size / AI adoption level
Recommended starting gate

A small team with light AI use (under 20% of commits)

Phase 1 baseline + property tests on key business logic

A mid-size team with moderate AI use (20-50%)

Phase 2 contract tests + Phase 3 PR-gated SAST

A large team with AI-heavy or mandated adoption (over 50%)

All four phases, with longitudinal tracking split by tool and model

What this actually costs, and where the ROI math breaks

Adapting QA for AI-generated code isn't free. Contract tests, property-based tests, security gates, and additional regression coverage take time to build and maintain.

The question is whether that investment costs less than dealing with the failures those controls are meant to catch. A contract test that catches an interface mismatch in CI may take minutes to fix, while the same problem found in production can require investigation, a hotfix, and regression testing.

The difference is even bigger in regulated products. IBM's 2025 Cost of a Data Breach report puts the average breach at $7.42 million in healthcare.

Still, that doesn't mean every additional QA check is a smart investment. For low-risk functionality, extensive testing may be more costly to maintain than the failures it prevents.

So, the main idea isn't to spend more on QA because AI is involved but to put the right quality gates that catch failures that would be expensive to discover later.

If your QA process hasn't been redesigned for AI-assisted development, that's a gap DeviQA can close. You can start from a QA audit scoped to your actual AI adoption level.

Book a strategic QA consultation

FAQ

Does AI-generated code have more bugs than human code?

Not in every case, but research suggests AI-generated and AI-assisted code can introduce more defects in certain areas than human-written code. What is important for QA teams is that the types of failures can differ. AI code often looks clean and passes surface-level checks while making incorrect assumptions about business rules, interfaces, edge cases, architecture, etc.

What tests catch AI-generated code failures that code review misses?

Contract tests at service boundaries, property-based tests for business invariants, mutation testing to expose weak test assertions, and PR-gated static analysis for security issues.

Should AI write its own tests?

Not without an independent check. A model that misreads a business rule when writing the implementation will likely misread it the same way when writing the corresponding test, which is how code and test end up agreeing with each other while being wrong.

Ievgen Ievdokymov

About the author

Ievgen Ievdokymov

Senior AQA engineer

Ievgen Ievdokymov is a Senior AQA Engineer at DeviQA, focused on building efficient, scalable testing processes for modern software products.