ai coding agents testing research

AI Coding Agents Are Bad at Testing. Telling Them to Try Harder Doesn’t Help.

TL;DR: Someone ran a proper experiment on whether you can make AI coding agents test their work better by asking them to. 26 different instructions, around 80 runs each, hidden tests. Almost nothing beat giving no special instructions at all — and several popular prompt “skills”, including one with 250,000 GitHub stars, made things worse. A separate test the same day found that 4 out of 10 agents never checked whether the thing they built actually looked right. If you can’t read the code your agent writes, this is the most useful research of the year for you.

What the research found

On 8 September, engineer Dan Luu published a study of whether AI coding agents can be told to test properly. The design is unusually careful: a fixed task (implementing Zstd compression in Rust), 26 different prompt conditions, four popular prompt “skills”, roughly 80 runs each, scored against hidden tests the agent never sees. He also pre-registered his predictions before running it, which is a standard of rigour most vendor benchmarks don’t attempt.

The instructions tested included test-driven development, property-based testing, fuzzing, mutation testing, formal-methods tools, and — genuinely — “Make no mistakes”.

The headline result:

“Nothing really wildly outperforms. However, Default (no additional instructions) does well above average.

Read that twice. Across 26 attempts to improve how AI coding agents verify their own work, the best-performing approach was, roughly, not bothering.

Three findings sharpen it:

  • Popular prompt “skills” underperformed. That includes one from a collection with 250,000 GitHub stars and 38,000 forks. Luu’s own quickly-written skill did fine — and his explanation is the useful part: his nudges agents away from their default behaviour, while the popular ones “seem more like tutorials”.
  • Test-driven development underperformed, as he predicted it would.
  • Formal methods produced theatre. Asked to prove code correct, agents proved trivia — including proofs of the form “A implies A”, which is true and worth nothing.

The bit that should worry you most

Not the rankings. This sentence:

“On xhigh, agents were generally able to get the tests they wrote to pass, but they wrote poor tests.”

His example: testing a feature that combines four different data streams, the agent fed it four identical streams — so any bug from mixing them up would sail straight through.

The tests pass. The code is broken. The two facts sit together comfortably, and nothing on your screen distinguishes them.

Luu’s broader conclusion is that AI coding agents “are really bad at testing and don’t seem to understand how to test reasonably by default”, and that naming a technique doesn’t fix it — they either write their usual tests inside an unfamiliar framework, or apply the technique superficially without getting any value from it.

A second test, a different way, the same answer

Published the same day, entirely separately, and about as different in method as you could ask: a developer ran one prompt — build a Three.js sci-fi hangar with hovering drones, animated lights and a cinematic camera path — across ten model and harness combinations, logging what each agent actually did.

Two columns in that table matter more than all the token counts:

Result
Runs that checked a screenshot of what they built6 of 10
Runs that never looked at the result at all4 of 10

Four out of ten agents built you a 3D scene and never once looked at it. One of them — running the newest, most expensive model available — spent 37 minutes and 1.3 million tokens, opened a browser, and still didn’t check the screenshots.

Different researcher, different language, different kind of task, same answer: AI coding agents are not reliably checking their own work.

Why it matters if you don’t code

If you can read code, a passing test suite is one signal among several. You skim the diff, you notice the four identical streams, you raise an eyebrow.

If you can’t read code, “the tests passed” is not one signal among several. It is the signal. It’s the green tick that tells you the thing is done — and this research says that tick is much weaker evidence than it looks.

That’s the whole story for our readers, and it isn’t a reason to stop. It’s a reason to change what you treat as proof:

  • A passing test is evidence the agent agreed with itself. AI coding agents write the code and write the exam. Those aren’t independent.
  • “It builds” and “it works” are different claims. So are “it loads” and “it does the right thing”.
  • Adding clever instructions to your prompt probably isn’t the fix. That’s the actual finding here, and it’s liberating: you can stop collecting magic phrases. Twenty-six of them were tested and the plain version did above average.
  • Be sceptical of prompt templates and “skills” you’re sold. A 250,000-star collection underperformed doing nothing. Length and popularity are not quality.

What actually works with AI coding agents

Nothing in the research says agents are useless — Luu’s point is that they’re unguided, which is a different and more fixable problem. What follows is the practical translation for someone who can’t audit the code.

  1. Test it yourself, as a user. Click the thing. Submit the form badly. Put a comma in the name field. Your five minutes of poking beats the agent’s self-written test suite, because you’re not the one who wrote the code.
  2. Give it a real example to check against, not a technique to follow. “Here’s a file that should produce this exact output” is worth more than “use property-based testing”. Specific beats sophisticated.
  3. **Ask it what it didn’t test.** A surprisingly effective question, and one an agent will often answer honestly.
  4. Look at whether it actually ran anything. If your tool shows commands and screenshots, check that it opened the result. Four in ten didn’t.
  5. Don’t buy the prompt pack. The evidence says the elaborate version isn’t beating the plain one.

Who should care (and who shouldn’t)

  • Shipping an app real people use: the group this matters most for. What AI coding agents give you is a green tick, not a QA department.
  • Building an internal tool: lower stakes, same habit. Ten minutes of using it badly is your best test.
  • Learning to build: genuinely good news. You are not missing a secret prompt. There isn’t one.
  • Using AI for copy, chat or one-off snippets: not relevant — no tests involved.
  • Choosing your first tool: don’t pick on testing claims. No tool has solved this, and the 60-second quiz sorts you on things that actually differ.

Our take

This is the most useful research on AI coding agents we’ve covered in weeks, and it lands somewhere unexpected: it takes work off your plate.

Our readers are told constantly that they’d get better results with the right prompt, the right framework, the right downloadable skill file. Here is a careful experiment saying most of that is noise — that the plain instruction did above average, and the elaborate popular ones did worse. If you have been quietly assuming everyone else knows a trick you don’t, they largely don’t.

What replaces it is less glamorous and more reliable: verification of what AI coding agents produce has to come from outside the agent. The agent wrote the code and the test, so it can’t be the independent check. You can. Five minutes of using the thing badly is worth more than any instruction you could add to the prompt.

It also sharpens a point we’ve made twice before. We wrote in August that the scaffolding around a model matters more than the model, and last week that the model gets chosen for you anyway. Here is the same lesson with numbers on it: the newest, priciest model in that ten-way test spent 37 minutes and still didn’t look at what it made. Capability isn’t the missing piece. Checking is.

One honest caveat, since we’ve spent a week arguing about how to read other people’s numbers. Both of these are individual researchers publishing their own work, not peer-reviewed studies — Luu’s is far more systematic, with pre-registered predictions and 80 runs per condition; the ten-way test is one task run once per combination. We’re treating them as strong, checkable evidence pointing the same way, not as settled fact. Both publish enough detail for you to disagree with them, which is more than most benchmarks offer.

Not sure which tool fits what you’re building? Take the 60-second Vibe Coding Tool Finder quiz

FAQ

Do AI coding agents test the code they write?

They write tests, but the research suggests those tests are often weak. Dan Luu’s study found agents “were generally able to get the tests they wrote to pass, but they wrote poor tests” — in one case feeding four identical data streams into a feature designed to combine four different ones, so any mix-up bug would pass unnoticed.

Can I make AI coding agents test better by changing my prompt?

Mostly no. Across 26 instructions — including test-driven development, property-based testing, fuzzing and formal methods — nothing wildly outperformed, and giving no special instructions scored above average. Several popular prompt “skills” did worse than the plain version, including one from a collection with 250,000 GitHub stars.

So how do I know the code actually works?

Check it from outside the agent. Use the thing yourself as a real user would, give the agent a concrete example with a known correct output rather than a technique to follow, ask it what it didn’t test, and confirm it actually ran or opened what it built — in one ten-way test, four of ten agents never looked at the result at all.

Similar Posts