AI-assisted testing: who decides what is correct?

An agent can run a test while a program decides whether it passes. The harder question is whether the test checks the right thing. Separating those responsibilities helps explain both the value and the limits of AI-assisted testing.

If an agent starts a test, does the model judge the result?

A question from the discussion captures the confusion (translated excerpt):

So these are mostly LLM-driven tests, rather than code-driven tests—is that right? Instead of rule-based tests, the LLM generates tests for the situation.

Three roles are being mixed together: who designs a check, who runs it, and who decides whether the result is acceptable. An agent can organize the process while an ordinary program still makes the pass-or-fail decision.

SituationThe model's roleHow the result is judged
Running existing automated testsChoose commands, run tests, and read failuresAssertions in the test code compare actual and expected values
Generating and running testsPropose scenarios and write test codeThe generated program runs assertions; the quality of the tests still needs review
Inspecting screenshots or reviewing codeCompare the work with requirements, find anomalies, and explain themModel judgment may miss issues, raise false alarms, or be inconsistent

For example, Python's standard test framework runs tests and checks expected results through methods such as assertEqual. These checks do not need to ask a model to decide what is correct each time. Whether a person or AI originally wrote the test code is a separate question. Python documentation

The Claude Code team's account also describes tests, builds, interface checks, and subagent review together. It describes a combination of checks; it does not establish that most tests rely on a model's judgment at runtime. Team account

Why can passing tests still leave the wrong behavior?

Consider search on a book website: entering a nonexistent title should return zero results and show a clear empty-state message. This is an illustrative example.

A person first confirms the expected behavior, and AI can write a test for it. During the test, a program checks the result count and message text. After a later change to the filtering logic, rerunning the test can catch a regression. AI helped design and run the check, but the acceptance criteria are now written into a program.

If AI initially assumes that a failed search should show every book, it may write a test for the wrong behavior. Passing all tests only shows that the implementation satisfies those tests. It does not establish that the tests cover the requirements or that the requirements are appropriate.

Specific examples, expected results, and missing scenarios still need review. Model review can add another perspective, but another agent may share the same misunderstanding. Adding an agent does not automatically provide independent evidence.

Which practices are worth adopting for a personal project?

The follow-up concerns a personal project (translated excerpt):

How useful would this be for someone at my stage? Or would it have a much bigger effect in a large team?

Large teams can benefit from shorter review queues, consistent checks, and allocating attention by risk. A personal project can adopt parts of this process too, mainly to reduce repeated manual checking and catch regressions during later changes. This is a judgment about the project's needs; the actual benefits have not been measured.

  • For behavior that changes often, such as search, filtering, and data loading, define a few inputs and expected results, then have the agent run the checks and retain their output.
  • When changing an interface, open the actual page and inspect empty states, mobile layouts, and key interactions. Programmatic assertions can cover part of this work; visual quality and usability still need direct inspection.
  • For changes spanning several files or unfamiliar logic, consider a subagent review with a clear scope, asking for file locations, problems, and evidence. Very small changes may not justify the extra time and cost.

Before adding a check, ask which errors it can find and whether it will be useful again. That helps set the depth of verification and control its cost.