All essays

Governance · Delivery

Testing Automation Is a Verification Question

Most developers don't fully trust AI-generated code. Fewer than half verify it before it ships. More automated testing is the obvious fix, and it treats the symptom.

Shikhar Agarwal · August 28, 2026 · 5 min read

Sonar's 2026 State of Code Developer Survey, more than 1,100 developers, found that 96 percent don't fully trust AI-generated code. Only 48 percent actually verify it before it ships. Most people who see that gap conclude the fix is more automated testing. I think that's treating the symptom.

Why the obvious fix doesn't fix it

More coverage, more test suites, more of the pipeline running on its own, all of that helps, but it runs into a problem specific to this moment: increasingly, the same AI that wrote the code is also writing the tests for it.

A 2026 systematic review presented at ICSE, covering 101 sources on AI-assisted coding quality, found this pattern common enough to name: tautological testing, where a test written by the same model that wrote the implementation validates what the code actually does, not what it was supposed to do. If the implementation has an off-by-one error, the generated test can assert the wrong value with complete confidence, and the coverage number still looks excellent.

Coverage is not the same thing as verification.

What actually changes

Testing automation matters. It catches regressions, it scaffolds coverage, it does real work. What it can't do is replace an independent check on whether the build matches what was actually asked for.

  • Acceptance criteria defined before the AI generates the implementation, not reverse-engineered from the AI's code after the fact.
  • A verification gate, a deliberate checkpoint where the pipeline can't proceed on the AI's word alone, in place before anything end user facing ships.
  • Coverage thresholds set higher for AI-generated code than human-written code, not lower, because AI tends to pass the happy path and miss the edge case that actually matters.

Within a year, I'd expect coverage thresholds to become something vendors negotiate over explicitly, the same way SLAs and security requirements are negotiated today, instead of a number a team quietly sets for itself and rarely revisits.

The fast layer will keep generating tests at the pace of code. The slow layer is asking whether those tests are checking the right thing.

Sources

Get the next one

From the same thread