# QA for AI-generated code: review, tests and a regression safety net

> Testing AI-Generated Code: QA Services | Zapple.Tech. Canonical page: <https://zapple.tech/services/ai-generated-code-testing/>

Your developers ship faster with AI coding assistants, and review and tests have not sped up to match. You get an audit of one module that shows what its current tests would miss, then the missing tests and a regression check in CI that stops a breaking change at the pull request.

## What you can order

- **Review of AI-written code**: Engineers read what the assistant produced against what was asked for, and report what does not match.
- **Tests that can fail**: Generated tests often confirm what the code does instead of what it should do. Existing tests are checked by breaking the code on purpose; missing ones are written from the requirement.
- **[Automated regression testing in CI](https://zapple.tech/services/regression-automation-testing/)**: A safety net that runs on every change, so a fast assistant cannot quietly break what worked yesterday.
- **Review rules for AI-assisted pull requests**: Short, written rules for what the author and the reviewer do when the code came from an assistant.

## What changes when an assistant writes the code

Review and testing were designed for code that a person wrote slowly and understood. Code from an assistant
differs in ways that matter to QA.

- **It reads well and can still be wrong.** Names are tidy and comments are confident. A subtle logic error
  or a misread requirement does not show up on a quick read.
- **Nobody holds the whole picture.** The developer prompted it and skimmed it. When it breaks, no one remembers
  why it was written that way.
- **Its tests share its blind spots.** If the same assistant wrote the code and the tests, the tests often confirm
  what the code does instead of what it should do.
- **Volume goes up.** More changes per week means more to review, and review time does not grow with it.

The answer is not slower development. It is checks that run on every change and a second pair of eyes on the code
that carries risk.

## How the audit tests the tests

A test suite can be green and still protect nothing. The audit finds out by changing the code on purpose, a
technique known as mutation testing, and watching which tests fail.

| Deliberate fault | A useful test | A weak test |
|:-----------------|:--------------|:------------|
| Rounding changed from half-up to down | Fails on the invoice total | Passes, because it only checks that a number is returned |
| Permission check removed from an endpoint | Fails for the user without the role | Passes, because it only calls the endpoint as an admin |
| Off-by-one in a date range | Fails on the last day of the month | Passes, because its sample dates are mid-month |

Every fault that no test catches becomes a line in the map of untested behaviour.

## What the review covers

| Area | Example checks |
|:-----|:---------------|
| Requirement match | The code does what was asked, including the cases the prompt did not mention |
| Existing behaviour | A change did not alter something that worked, shown on a regression set |
| Dependencies | Libraries and functions exist, are used as documented and were chosen on purpose |
| Boundaries | Input validation, error handling, permissions and data handling |
| Consistency | The new code follows the structure and conventions of the code base |

For end-to-end coverage of the product built from this code, see
[end-to-end testing with AI agents](/services/agentic-e2e-testing/); for a review of your whole test process, see
[QA audit and assessment](/services/audit-and-assessment/).

## What QA does not solve for AI-generated code

Tests and review lower the chance of shipping a defect. They do not turn unreviewed code into reviewed code, and they do not replace your developers' ownership of what they merge.

- It cannot prove the code is correct. Tests show that specific behaviours hold; behaviour nobody tested stays unknown.
- It cannot restore a missing requirement. If nobody can say what the code should do, the tests can only record what it does today.
- Code review is not a security assessment. Obvious security flaws are reported; there is no penetration test and no certification.
- It does not slow down or police your developers' use of AI assistants. It checks the output.
- Poor design and tangled code are reported, but a rewrite is your decision and your developers' work.

## How the work runs

1. **AI-written code audit** (About one week): One service or module written largely with AI assistants. We read the code, run it, and measure what the existing tests would catch by putting deliberate faults into it.
2. **Pilot** (Two to six weeks): The highest-risk paths of that module get tests and a regression check in your CI, and your team starts using the review rules on real pull requests.
3. **Ongoing** (Monthly): Zapple.Tech engineers review the riskiest AI-assisted changes and extend the tests as the code base grows, working in your pull requests.

## FAQ

### Is AI-generated code worse than code written by people?

We do not claim that. The risk is different: it arrives faster and reads well, so it is easy to merge without enough checking. The audit measures your code, not a general rule.

### Our developers already review pull requests. What does this add?

A reviewer reads a diff. The audit also runs the code, breaks it on purpose to see whether the tests notice, and checks the behaviour against the requirement rather than against the code beside it. It is done by someone who did not prompt the assistant.

### Can you tell which code was written by AI?

Not reliably, and it matters less than it seems. The module to audit is chosen with you, from your commit history, your team's knowledge and where the business risk sits.

### What access do you need?

Read access to the code under audit and to your CI configuration, and a developer who can answer questions about the requirements. For the pilot, the work goes through pull requests in your repository.

### Do you put our code into an AI tool?

Only tools you approve. If your rules say code must not leave your environment, the audit is done without any external AI service.

### Who does the work?

Zapple.Tech test automation engineers, who write the unit, API and integration tests themselves. The company's founders are the founders of CodeceptJS and Codeception, two open-source testing frameworks.

### How long does it take?

The audit takes about a week for one module. The pilot runs two to six weeks, depending on how many risky paths the audit found and how testable the code is today.

### How much does it cost?

Prices are not published. The quote depends on the size of the module, the language and how much test infrastructure already exists. Describe the code base and your team and you get a scoped quote within one business day.

[Request an audit quote](https://zapple.tech/services/ai-generated-code-testing/#start)
