Testing and AI

AI Writes the Code. Who Tests It?

April 2026

A quiet assumption is spreading in software development teams: AI tools are now so capable that testing is becoming less important. Copilot writes the code, the AI generates the tests, the pipeline runs green. What could possibly go wrong?

Quite a lot, it turns out.

AI-assisted development is a real leap in productivity. But it does not eliminate quality risk. It shifts it, into new areas, new forms, and often completely out of sight. Understanding where the risk moves is the starting point for the insight that independent testing has never been more important than it is today.

The quality echo chamber

When an AI generates both production code and the associated tests, a structural problem arises: the system validates its own logic against itself. Tests turn green, but they may not be testing the right things.

In traditional software development there is a natural form of quality assurance: the person who writes the tests is usually not the same person who wrote the code. This creates friction, and friction finds defects. In a fully AI-driven pipeline, this separation breaks down completely.

This is not a hypothetical scenario. Research by Qodo shows that missing context is the most frequently cited quality problem with AI-generated code, named by 65% of developers both for test generation and for code reviews [1]. The problem is not that AI code fails obvious checks. The problem is that the gaps between what was intended and what was built become invisible to the system that built it.

An external test team has no shared history with the codebase. No anchoring in the AI’s assumptions. No conflict of interest between delivery speed and quality. That is not a limitation; it is the core of the added value.

Code that looks right but is not

AI-generated code has a characteristic defect profile that makes traditional review processes less effective. The code is syntactically clean, well formatted and often passes basic automated checks. The problems arise at the semantic level: wrong business logic, missing security controls, subtle edge cases that were not specified in the prompt and that the AI did not anticipate.

The Cloud Security Alliance describes the problem aptly: the most dangerous AI-generated errors do not look like errors at all. They arise in the gaps between logic, business context and edge cases, and are harder to detect because the code looks correct [2].

The Veracode GenAI Code Security Report 2025 provides a concrete example: AI routinely generates API endpoints without input validation, not because the code is “wrong” in the obvious sense, but because the prompt did not explicitly ask for it [3]. The absence of security controls is not a syntax error. It does not trigger a linter. It requires a tester who knows what the system should do, not only what it currently does. Veracode’s analysis of more than 100 language models on 80 real coding tasks found that 45% of all generated code samples contained OWASP Top 10 security vulnerabilities, and that this rate has remained completely constant despite better models.

The data on scale is clear: CodeRabbit’s analysis of 470 real GitHub pull requests shows that AI-generated code contains about 1.7 times more defects than human-written code [4]. Not just more defects, but more severe ones. Critical defects occur 1.4 times as often. Logic and correctness problems are 75% more frequent. Performance defects occur almost 8 times as often.

Organizations that deploy AI-generated code at high speed, without adapted test processes, systematically increase their production defect rate. They usually only notice this when the cost of failure is already high.

The debt that accumulates unnoticed

There is a third risk that is less visible than the others and in the long run possibly the most consequential.

AI produces code faster than teams can build the understanding needed to change, test or debug it safely. Researchers have named this dynamic: cognitive debt describes the erosion of shared mental models in a team; intent debt denotes the lack of documented rationale and constraints. An article published in March 2026 by Margaret-Anne Storey at the University of Victoria puts it in a nutshell: generative AI does not remove the challenges of software development, it shifts them [5].

Technical debt, the kind that shows up in code quality metrics, may even decrease with AI support. But the debt that accumulates in people’s heads, and in the missing documentation of why decisions were made, grows silently and continuously. Teams often only realize how much understanding they have lost when something breaks unexpectedly. Related research by Shaw and Nave (2026) describes this phenomenon as “cognitive surrender”: the uncritical adoption of AI outputs, which inflates confidence even when the AI is wrong and makes errors invisible until they show up in production [6].

For an external testing partner, this dynamic has an important consequence: an external team does not accumulate cognitive debt over a codebase. Every engagement starts with an independent, unanchored perspective. In a world in which internal understanding continuously erodes, that becomes a structurally lasting advantage, not just a project-related convenience.

Regulation is catching up

For organizations in regulated industries there is now a fourth, formally binding dimension.

The EU AI Act, whose requirements apply in stages [7], prescribes for high-risk systems, which include critical infrastructure, financial services, healthcare, education and employment, demonstrable, documented, independent quality assurance. Not just quality. Provable quality, with an audit trail, carried out by a party that can credibly claim independence from the development process. The range of fines extends up to 35 million euros or 7% of global annual turnover.

Internal teams are structurally badly positioned to deliver this. Regulation does not only create compliance overhead; it creates a formal requirement for exactly the kind of external, neutral testing that has always been the core of independent quality assurance.

For organizations within scope, this is no longer an optional quality attribute. For others it is an early signal: the development of software regulation is clearly moving toward documented, auditable quality processes.

What this means in practice

Developers themselves know that something is wrong. The Stack Overflow Developer Survey 2025, which surveyed almost 50,000 developers in 177 countries, found that 46% distrust the accuracy of AI tools [8]. Only 3% report high trust in AI-generated output. And yet the same developers ship AI-generated code in unprecedented volumes, because review capacity does not keep pace with generation speed. The DORA State of AI-Assisted Software Development Report (2025) adds another dimension: AI adoption now has a measurably negative relationship with the stability of software delivery, and organizations with fragmented quality processes see AI accelerating their technical debt instead of reducing it. [9]

This is the classic pattern that creates demand for professional services: a recognized problem that cannot be solved internally. The bottleneck is not awareness. It is capacity and independence.

Testing AI-generated software requires more than applying existing test frameworks to a new kind of code. It requires understanding the specific defect profile of AI-generated code: where the risks concentrate, how semantic defects differ from traditional ones, and how to assess whether a system does what users and the business actually need, not just what the AI has interpreted from the prompt.

The decisive positioning

There is a simple way to describe what is happening: the more development is automated, the more testing becomes the last reliable quality control instance. It is the only systematic check whether code actually does what it is supposed to do.

This is not a pessimistic view of AI but a realistic one. AI-assisted development is a real productivity breakthrough, and like every productivity breakthrough in software history, it increases the importance of the quality processes that accompany it.

Independent test partners, without conflict of interest, without accumulated blind spots, with credible neutrality for compliance purposes, are structurally positioned to fill the gap that AI development creates.

The question “AI writes the code, who tests it?” has a clear answer. It should not be the same system that wrote it.

About the author

As Chief Process Officer at TestSolutions GmbH, Florian Fieber is responsible for test process management of the whole organization as well as the training area with the TestSolutions Academy. He has worked in quality assurance of software systems for almost 20 years and (co-)founded several training and consulting companies in that time. His focus as a consultant and trainer is test management, test process management and test process improvement.

After studying media informatics and business informatics, he first worked as a software developer for enterprise applications and as a research associate at the Technische Fachhochschule Berlin. Since then his focus has developed from test analysis and test automation via test management to process improvement and today covers all aspects of quality assurance across the entire software lifecycle.

Since 2018 he has been a member of the German Testing Board (GTB) and is committed to the further development of the ISTQB Certified Tester scheme. From 2020 to 2022 he was deputy chair, and since 2022 he has been chair of the GTB.

Sources

[1] Qodo, State of AI Code Quality (2025) – qodo.ai/reports/state-of-ai-code-quality

[2] Cloud Security Alliance, Understanding Security Risks in AI-Generated Code (July 2025) – cloudsecurityalliance.org

[3] Veracode, GenAI Code Security Report 2025 – veracode.com

[4] CodeRabbit, State of AI vs Human Code Generation (December 2025) – coderabbit.ai

[5] Storey, M-A., From Technical Debt to Cognitive and Intent Debt (March 2026) – arxiv.org/abs/2603.22106

[6] Shaw & Nave, Thinking Fast, Slow, and Artificial (2026) – ssrn.com/abstract=6097646

[7] EU AI Act, Regulation 2024/1689 – digital-strategy.ec.europa.eu

[8] Stack Overflow, Developer Survey 2025 – survey.stackoverflow.co/2025

[9] DORA, State of AI-Assisted Software Development (September 2025) – cloud.google.com

More posts

View all →