We Invented Independent Software Testing. Now AI Is Grading Its Own Homework.

Three AI agents build, test, and review software with green approvals, while the business owner’s chair sits empty beside unanswered requirements.
ai generated code testing featured

AI wrote the application.

AI wrote the tests.

AI reviewed the code.

All tests passed.

Unfortunately, nobody asked the business what the application was supposed to do.

That is the uncomfortable possibility behind increasingly automated software development. AI-generated code testing can produce useful evidence, identify defects, and reduce repetitive work. But when the implementation and its tests inherit the same mistaken assumption, a successful build can conceal incorrect business behavior.

Independent verification means checking software against expectations established separately from the implementation being evaluated. AI can participate throughout that process. The important question is where the definition of correct behavior comes from—and who can change it.

The technology changed. The vocabulary changed. The engineering principles didn’t.

AI Is Moving Beyond Writing Code

AI-assisted software development increasingly includes reviewing changes, investigating failures, proposing corrections, and participating in approval workflows.

On November 23, 2026, Anthropic introduced Claude Ship. It combines its generally available Code Review capability with two beta agents: PR Steward, which addresses failing checks, merge conflicts, and review feedback; and Claude Approvals, which evaluates changes against team-defined approval policies. Anthropic recommends starting its approval capability in observe-only mode. Existing repository permissions and branch rules remain relevant. Anthropic’s Claude Ship announcement

These capabilities address real engineering work. Developers spend substantial effort investigating failures, responding to reviews, and preparing changes for release.

The architectural concern arises when organizations automate those activities without preserving the distinction between:

  • Implementing a business requirement.
  • Establishing the expected result.
  • Verifying the implementation.
  • Authorizing a release.

One workflow can coordinate all four. They still represent different responsibilities.

A dashboard that displays four green checks cannot explain whether those checks depend on four independent sources of evidence—or one assumption copied four times.

Why AI-Generated Code Can Pass Tests and Still Be Wrong

Consider a fictional customer-service application.

The approved business requirement states:

Automatic refunds may not exceed $500. Larger refunds require manager approval.

An AI coding assistant mistakenly implements a $1,000 automatic refund limit. It then generates unit tests from the application’s behavior.

One test submits a $600 refund and expects automatic approval.

The application approves it.

The test passes.

The code and test agree. The business requirement disagrees.

This illustrates the difference between verifying consistency and verifying intended behavior. The test demonstrates that the application produces the expected result encoded in the assertion. It does not establish that the assertion represents the approved business rule.

Here is the same scenario with independently defined expectations:

Refund requestApproved business expectationIncorrect application behavior
$499.99Eligible for automatic approval, subject to other rulesAutomatically approved
$500.00Eligible for automatic approval, subject to other rulesAutomatically approved
$500.01Requires manager approvalAutomatically approved
$600.00Requires manager approvalAutomatically approved

The last two cases expose the defect because their expectations come from the approved requirement.

A passing test can confirm the wrong expectation.

That limitation applies to human-written tests too. AI makes it easier to generate an implementation and a large collection of tests that share the same interpretation.

The Test Oracle Problem: Who Determines the Right Answer?

Software testing has a name for the source or mechanism used to determine whether an observed result is correct: a test oracle.

The oracle might be a specification, an approved example, a mathematical relationship, or another dependable reference. Research on the test oracle problem predates today’s coding assistants and examines the difficulty of determining correct outcomes in automated testing. The Oracle Problem in Software Testing: A Survey

In an enterprise application, authoritative expectations might come from:

  • Approved refund and discount policies.
  • Contractual API behavior.
  • Accounting rules.
  • Security and tenant-isolation requirements.
  • Documented workflow transitions.

AI can help translate these sources into executable tests. It can identify ambiguity and suggest missing boundary cases.

But an inferred rule needs validation before it becomes an acceptance criterion.

If the assistant invents a refund threshold while writing the application, that threshold does not become authoritative because the assistant also wrote a test for it.

When the AI Fixes the Test Instead of the Code

Now suppose the $600 refund test correctly expects manager approval.

The application automatically approves the refund, so the test fails.

The developer asks the assistant to fix the failure.

The assistant changes the expected result to automatic approval.

The pipeline turns green.

The refund defect remains.

This fictional example illustrates an objective-setting problem. “Make the tests pass” leaves room for changes that remove the signal instead of correcting its cause.

A failing test can indicate an implementation defect, an incorrect expectation, an environment problem, or an intentional requirements change. The correct response depends on which explanation is supported.

A better instruction would be:

Investigate the failing refund test against the approved $500 limit. Preserve the expected business behavior unless an authorized requirements change supports modifying it. Explain any proposed assertion change.

That gives the assistant a reference and makes a consequential decision visible to the reviewer.

Test maintenance remains necessary. The responsibility is to explain why an expectation should change.

What Recent AI Software Quality Research Actually Shows

TestMu AI’s November 2026 State of AI in Quality Engineering report offers a useful warning signal.

In a survey with 228 completed responses, 81% reported that their teams had merged AI-written code or tests they did not fully understand. Another 44% reported more escaped defects or production incidents as AI-generated code increased.

The report also found that respondents whose teams relied on a QA handoff without separate automated CI tests reported increasing escaped defects more frequently than those with such tests: 49% versus 38%. TestMu AI’s 2026 report

These figures require context. The survey was conducted through the vendor’s community channels, relied on self-reported experiences, and leaned toward organizations in India and SaaS companies. It describes the surveyed teams rather than the entire software industry, and the associations do not establish causation.

My engineering interpretation is narrower: increasing output deserves a corresponding examination of verification capacity.

Generating additional tests helps only when those tests examine meaningful expectations.

Independent Software Testing Can Be Automated

Independent testing does not require a person to inspect every generated line.

Independence concerns the source of expected behavior, the authority to change it, and the controls used to evaluate the implementation.

For example, a business owner can approve refund scenarios. AI can generate test code from those scenarios. An automated pipeline can execute the tests on every proposed change.

That workflow uses AI extensively while preserving a separately established definition of success.

Likewise, a security team can define tenant-isolation requirements, and AI can help create tests that attempt unauthorized cross-tenant access.

The practical question is:

Can the component being evaluated quietly redefine the conditions under which it passes?

If it can modify the implementation, weaken the acceptance tests, disable the checks, and approve the result without additional controls, independence is fragile.

Separate ownership, protected configuration, and reviewable evidence can strengthen it.

Why Another AI Reviewer Is Helpful but Insufficient

A second AI agent can provide useful review. It may identify a missing validation, an unsafe query, or an overlooked failure path.

It still needs the information required to judge the change.

If both the coding agent and reviewing agent receive an incomplete refund specification, neither is guaranteed to discover the missing approval rule.

Using another model or provider may introduce a different perspective. It does not supply an absent business requirement.

The strongest review combines implementation analysis with relevant requirements, contracts, security expectations, and operational context.

Ask the reviewer to identify which approved rule supports a consequential behavior. An unsupported answer should become an open question rather than an accepted assumption.

Code Coverage Is Not Requirements Coverage

A test suite can execute every line of a refund method while missing the $500 boundary.

It might test $100, $200, and $400. All three succeed. The method receives excellent line coverage.

The missing approval behavior remains unexamined.

Coverage indicates which code executed during testing. It does not establish that every important business obligation was represented or correctly asserted.

For AI-generated code testing, connect important requirements to concrete evidence:

RequirementUseful verification
Refunds above $500 require manager approvalTests at $500, $500.01, and a larger amount
Users cannot access another tenant’s refundsCross-tenant authorization tests
Repeated requests must not create duplicate refundsRetry and idempotency tests
Approval actions must be recordedAudit-event and persistence tests

These are proposed verification examples. Each organization must confirm the intended rules and relevant exceptions.

A shorter suite that checks the right obligations can provide stronger business evidence than a large suite that repeatedly confirms implementation details.

A Practical Architecture for Microsoft and .NET Teams

Consider an ASP.NET Core application using Entity Framework Core, SQL Server, and Microsoft Entra ID.

An AI assistant helps implement the refund workflow. The team establishes the approval rule separately and connects it to acceptance scenarios.

A practical delivery process could work as follows.

Establish approved behavior

The business owner confirms the refund threshold, eligible users, exceptions, and approval process. Developers resolve ambiguities before treating the scenarios as authoritative.

Generate and review the implementation

AI proposes application changes and supporting tests. The pull request identifies affected requirements and explains any changes to expected behavior.

Verify at the appropriate layers

Unit tests check rule boundaries. Integration tests examine persistence and transaction behavior. Authorization tests check access. Contract tests examine interactions with downstream payment services.

The team chooses the layers needed for the application’s actual risks.

Enforce release conditions

Required checks and reviews govern whether the change can proceed. The coding assistant operates within those controls.

Confirm production outcomes

Telemetry and reconciliation detect failed refunds, duplicates, missing approvals, and other business-impacting outcomes.

No test suite proves the absence of every defect. This architecture builds several forms of evidence around the behavior that matters.

Protect the Tests, Policies, and Pipeline

Protecting application code while leaving the verification process freely editable creates an obvious gap.

Changes to acceptance expectations, workflow definitions, approval policies, and deployment permissions deserve deliberate ownership.

GitHub rulesets support required checks, code-owner review, and dismissal of stale approvals after relevant changes. Required status checks can also be restricted to an expected GitHub App. GitHub ruleset documentation

Azure Repos provides branch policies for required reviewers and build validation. Microsoft’s guidance also addresses limiting bypass permissions and verifying that configured policies actually block unsuitable pull requests. Microsoft’s repository and pull-request security guidance

For an AI-assisted workflow, I would review:

  • Who can change authoritative acceptance tests.
  • Who can modify pipeline definitions and approval policies.
  • Whether required checks evaluate the current proposed change.
  • Whether later edits trigger fresh verification or review.
  • Which identities can bypass the controls.

Then test the configuration with a deliberately failing change.

A policy document describes an intention. An enforced, verified control changes what the workflow permits.

Match Human Review to the Consequences

A spelling correction and a refund authorization change carry different consequences.

Teams can define policies that allow routine changes to proceed automatically after suitable checks, while routing consequential changes to qualified reviewers.

Refund limits, authentication behavior, tenant boundaries, payment processing, and destructive data migrations warrant particular attention.

Human review also needs useful context. A reviewer approving hundreds of unexplained changes is a weak substitute for clear requirements and targeted evidence.

Show the reviewer what changed, which obligation is affected, what verification ran, and what uncertainty remains.

That makes expertise easier to apply.

Measure Delivered Software and Find the New Bottleneck

AI can accelerate code generation while unfinished features accumulate elsewhere.

If a business owner has not decided which refunds require approval, generating another implementation does not resolve the decision.

The queue grows. Coding activity rises. Users keep waiting.

Measure the entire delivery process:

  • Time from an accepted request to a successful release.
  • Time waiting for requirements decisions, review, and validation.
  • Rework caused by misunderstood behavior.
  • Production regressions and recovery effort.
  • Whether delivered features satisfy their acceptance criteria.

These measures help reveal whether AI assistance improves delivery or moves work into another queue.

Dave may still handle production incidents. He should also have a clear way to trace deployed behavior back to the requirement someone approved.

A Practical Starting Point for Your Next Pull Request

Choose one important business rule and trace it through a recent change.

  1. Find its authoritative source and accountable owner.
  2. Confirm that the rule is clear enough to test.
  3. Locate tests covering its boundaries and failure cases.
  4. Inspect whether the proposed change alters those expectations.
  5. Verify that the required checks and reviews cannot be silently bypassed.

If the only explanation for an expected result is “that is what the code currently does,” investigate further.

Start with the rule whose failure would create the most significant customer or business impact. Improve that path before expanding the process.

We Didn’t Invent Testing for Decoration

AI can help implement software, generate tests, investigate failures, and review changes. Those capabilities deserve a place in serious engineering workflows.

The application still needs to do what the business requires.

The tests still need meaningful expectations.

The release process still needs appropriate authorization.

A useful next step is straightforward: take one consequential business rule and verify that its definition, implementation, tests, and release evidence remain connected.

Otherwise, we may produce an exceptionally well-tested collection of incorrect business applications.

The technology changed.

The vocabulary changed.

The engineering principles didn’t.

Explore more practical enterprise AI engineering at AInDotNet.com.

Frequently Asked Questions About AI-Generated Code Testing

Can AI write both application code and tests?

Yes. The tests become more useful when their expectations are grounded in approved requirements, contracts, or other dependable references. Review whether generated tests check intended behavior or simply reproduce the implementation’s assumptions.

Does an AI code reviewer provide independent verification?

It can contribute a separate analysis. Meaningful independence also depends on its information, evaluation criteria, and authority. Another reviewer cannot reliably compensate for requirements it never receives.

Should developers ever change AI-generated tests?

Yes. Tests can contain defects, become obsolete, or reflect outdated requirements. Explain the reason for an expectation change and connect it to approved behavior.

Do passing tests prove that an application is correct?

They provide evidence about the scenarios and assertions executed under the tested conditions. Missing requirements, incorrect expectations, and untested interactions can still conceal defects.

author avatar
Keith Baldwin

Leave a Reply

Your email address will not be published. Required fields are marked *