AI Quality Assurance Software Testing

When AI Writes the Code and Grades Its Own Homework: Why Manual Test Cases Still Matter

Monday, 31 Aug 2026 6 min read 10 views

Here's a scene that's becoming familiar on AI-agent-driven teams: you hand off a feature, the agent writes the code, runs the tests, hits a failure, and quietly patches the tests until everything turns green. Look at the dashboard and everything looks healthy — build passes, pipeline is green, tests confirm the system works.

Works according to what, though?

That's the uncomfortable question surfacing in the age of agentic coding. When the same process produces both the implementation and the evidence that the implementation is correct, who actually verifies it independently?

Self-authored tests: convenient, but possibly just a mirror of the code

Traditionally, automated tests were meant to act as an independent referee — describing the behavior a system should have, and raising an alarm when the code deviated from it.

The trouble is that when an AI agent writes the code and also writes or edits the tests, that independence quietly disappears. The agent builds the feature, runs the tests, sees a failure, and adjusts the tests until they pass. It sounds reasonable, but the end result can be a test suite that simply describes whatever the current implementation happens to do — not one that verifies what it's supposed to do.

The risk gets sharper when the agent infers the expected behavior straight from the source code itself. If the implementation contains a misunderstanding, the tests generated from it will happily rubber-stamp that same misunderstanding. At that point the test suite isn't a verification tool anymore — it's just a reflection of the code.

A very practical warning sign: teams start noticing an agent burning ten-plus minutes every session just patching end-to-end tests — rewriting assertions, swapping selectors, regenerating snapshots. Self-healing tools can fix the mechanical part (a test doesn't break just because the UI shifted slightly), but they can't fix the more important part: whether the intended behavior behind that test is still correct. Constant test patching is usually a sign that the team never had a clear, code-independent definition of expected behavior — and an agent has no way to tell an intentional product change apart from a genuine regression.

Other teams in the industry have converged on a similar observation from their own angle: when one agent writes both the code and the tests for that code, the two outputs share the same blind spot. If the agent misreads the requirement, the resulting tests will simply confirm the misreading instead of catching it. That's part of why some teams now insist on a fully separate verification agent — different context, different prompt, different goal from the one writing the code — rather than letting an agent grade its own work.

So is the answer to go back to writing test cases by hand?

Not in the sense of "a human clicking through every step by hand at release time" — that's a common misreading. What's actually being proposed is test cases expressed independently of the automation code: written in plain language, Markdown, Gherkin, or any format that product people, engineers, and QA can all read and review — and that an AI agent can read too.

A good manual test case spells out: the business scenario, the preconditions, what the user does, the expected outcome, the relevant negative and edge cases, and which requirement or acceptance criterion it's verifying.

Because it's written to be readable without understanding the test framework, it becomes something like a shared contract among everyone involved — including the AI. It can be reviewed before the code is written, signed off with stakeholders, and version-controlled like any other delivery artifact. And crucially: editing a Markdown scenario is far cheaper than repeatedly debugging a complicated E2E test.

A saner division of labor for agentic workflows

A better approach separates three distinct jobs: who defines the intended behavior, who implements it, and who verifies it — instead of letting one agent do all three inside the same closed loop.

In this setup, requirements and acceptance criteria answer "why does this feature need to exist." Manual test cases — drafted by QA or a dedicated agent — turn that intent into concrete, reviewable scenarios. The development agent implements the behavior, and can flag something in the test case that looks ambiguous, but it shouldn't be able to silently redefine the expectation itself. A separate automation agent then generates E2E checks from the approved test case, not from the current UI or code. And if anyone — including an agent — wants to change a test case, a dedicated review layer checks whether that change is actually authorized by an approved requirement, or whether it's really just a way of quietly legitimizing a regression.

It sounds like extra overhead, but the goal is simple: stop one agent from writing something wrong, rewriting the test to match the wrong thing, and then giving itself a passing grade.

Why this matters more than it seems

AI agents really can generate code fast, and that speed is genuinely appealing. But speed doesn't mean the system's behavior has actually been verified. Without an independent layer describing expected behavior, teams can easily fall into an implement-fail-fix-regress loop — where the more AI gets used, the more time gets spent reconciling tests with code instead of protecting what the product actually needs to keep working.

On the other hand, a well-managed set of manual test cases — reviewed, versioned, clearly tied to requirements — cuts down on repeated E2E repair work, reduces the risk of quietly accepting a regression, and prevents multiple agents from generating overlapping, duplicate tests. It's also what lets a CTO see at a glance which requirements are actually protected, and lets a QA engineer immediately spot where edge-case coverage is missing.

Put simply: in the agentic era, manual test cases aren't a step backward from automation. They're the contract that keeps automation from quietly rewriting the rules on its own.

 

Sources:

Ready to Transform Your Business?

Let's discuss how we can help you leverage AI and digital transformation for your enterprise.

Frequently asked questions

Does "manual test case" mean a human has to click through every step by hand?
No. "Manual" here means the test case is written in plain language/Markdown/Gherkin, independent of the automation code — reviewable by humans and AI alike, not necessarily executed by hand.
Why is it risky to let one AI agent write both the code and its tests?
Because both outputs share the same blind spot: if the agent misreads the requirement, the resulting tests will simply confirm that misreading instead of catching it.
Does this workflow slow development down?
Not meaningfully — editing a Markdown test case is far cheaper than repeatedly debugging an E2E test, and it prevents the costlier implement-fail-fix-regress loop later on.
If the product changes, who's allowed to update a manual test case?
Anyone proposing a change — including an AI agent — needs an approved requirement or acceptance criterion behind it. A separate review layer checks whether the change is legitimate or is quietly masking a regression.

Share this article