Skip to content
QualityLogic logo, Click to navigate to Home

Don’t Let AI Grade Its Own Tests: Four Articles on Verifying AI-Generated Tests

Home » Blogs/Events » Don’t Let AI Grade Its Own Tests: Four Articles on Verifying AI-Generated Tests

I’ve written a lot about testing AI-generated code over the past three months, focusing on the importance of a strong specification and the practical limits of having a complete spec early in development. No matter how good your specification is, you will still need to test the generated code, but traditional test strategies don’t hold up very well given the velocity at which AI can generate code. In recent weeks, a rich body of articles has addressed this bottleneck in verifying AI-generated tests. I’ve summarized four of them below.

How the Claude Code Team Has AI Check Its Own Work

How the Claude Code team thinks about verification: This article by Addy Osmani distills the Claude Code team’s experience removing the verification bottleneck. It boils down to giving Claude a way to verify its own work by actually running the change end to end, keeping the checks out of reach of the change they judge, and recognizing that not all tests are created equal. The article singles out end-to-end tests, property tests, and differential tests as the most worth investing in. And, perhaps most importantly, repeatedly failing tests require human attention. Claude writes roughly 90% of the code on the Claude Code team, and we can all learn a lot from folks at the frontier of AI code generation. The article is filled with gems of wisdom.

Verifying AI-Generated Tests the Agent Can’t Game

Stop Reviewing AI’s Code. Review Its Tests: This member-only Medium article by Itai Spector does a wonderful job of explaining how agents cheat on tests and how to guard against each of these cheating methods, starting with writing the tests in a separate session and locking them so the agent can’t touch them. It then makes a case for where review energy is best focused: reviewing the specification and the AI-generated test cases, and scanning the test diffs for cheats. Perhaps the most insightful comment in the article is that human code review is still mandatory at the interface boundaries with other people’s work. That isn’t because the reviewer will catch the bug, but because the blast radius there is broader than just your own work, and the shared understanding that review produces matters most at those seams. This article has the strong feel of someone speaking from hard-won experience.

What a Passing Test Actually Proves

Spec Passes, Product Fails: The Evidence Matrix: Another member-only Medium article, this one from Jaroslaw Wasowski, perhaps the most prolific author on the topic of AI spec-driven development. The article distinguishes between verification (did we build the product right?) and validation (did we build the right product?). The key takeaway is that each type of test has a scope. For instance, measuring code coverage confirms the code was run, but it doesn’t mean anyone checked the result. Or take mutation testing: it determines whether a test detects injected code damage, but it doesn’t confirm the expectation is correct. This is a useful counterweight to Spector, who leans on mutation score as his best measure of test quality. Confirming the expectation, Wasowski argues, takes someone outside the implementation loop approving the expected result before the tests are generated. Otherwise, the code and the test can share the same wrong interpretation. His big-picture recommendation is to add a small evidence section to each requirement in the spec, outlining what the evidence does and does not cover. This article is packed with great insights and suggestions, as are most of the articles Wasowski writes.

Proving the Checks Actually Ran

More Confidence, Not More Code Review: This blog post on the Code Telemetry website by Elliot Gardiner approaches the problem from another angle. Even if you take all the wonderful suggestions in the three prior articles, focusing human effort on the most productive areas and building independence into the AI’s own testing efforts, how do you really know what the AI actually tested? That is where observability comes in. The company’s Grader product takes telemetry data from the AI execution environment and maps it to the expected AI test behavior. Was a test run? Was a test tool used? Were test results stored? The telemetry data won’t tell you the code is correct or that the tests were sufficient, but it will give you recorded evidence, independent of the agent’s own say-so, that the expected checks were run and how they came out. There are all kinds of nuances around this, as the article explains, but in regulated industries, having this kind of evidence inspires confidence in the ultimate assertion that the code was validated against its requirements.

My Takeaway

Each of these authors, in their own way, is showing us faster, smarter, more creative ways to deal with the bottleneck created by the velocity of AI code generation. Read together, they answer four different questions: how does the AI check its own work, how do you keep those checks honest, what does a passing check actually prove, and how do you show the checks really ran. The common thread is independence. AI does most of the testing, but it doesn’t get to write its own answer key, edit its own tests, or vouch for its own results. Human attention moves away from reading every line of code and toward the specification, the expected results, the interface boundaries where the blast radius is largest, and the evidence that requirements were actually validated.

I read a lot of these articles each month, and not all are worth your time. I share some of the ones that are, along with my take on them, in the State of AI QA Newsletter. If this roundup was useful, subscribe here.

Author:

Jim Zuber, Chief Technology Officer

Over the past four decades, Jim Zuber, co-founder and Chief Technology Officer at QualityLogic, has established himself as a leading innovator in developing testing standards and methodologies for industries such as smart energy, imaging, telecommunications, and software technology.

Jim’s career in technology began with his role as co-founder and CTO at Blue Chip Software, where he developed the official simulation software for the American Stock Exchange, co-branded with the Amex itself. The company was successfully acquired by Compton’s New Media in 1986. Following this, Jim co-founded and served as president of Genoa Technology, guiding it to prominence as a trusted provider of test solutions within the computer and telecommunications sectors. The merger of Genoa Technology with Revision Labs Inc. laid the foundation for what would become QualityLogic.

At QualityLogic, Jim has been instrumental in architecting innovative testing products and solutions that have set industry benchmarks. His expertise in creating practical and effective testing methodologies continues to shape QualityLogic’s reputation as a leader in QA and software testing standards.

Jim remains actively engaged in advancing QualityLogic’s technology initiatives, regularly contributing insights and thought leadership in AI technologies, software testing, and industry standards.