DEV Community

Amit Spitzer
Amit Spitzer

Posted on

We ran our AI-code checker on real bug fixes. Here is everything it got wrong.

AI coding agents say "done" a lot. Sometimes the work is done. Sometimes the tests pass and the change is still wrong.

Apex verify is a free, open-source tool that checks. It reads the task, writes its own tests without looking at the change, runs them on the old code and the new, and checks that nothing that worked before is now broken. Then it answers READY, NOT READY or UNKNOWN, with the evidence.

A tool like that is only worth using if you can trust its answer. So we stopped testing it only on examples we made, and started testing it on real work.

The test: real bug fixes, and a broken copy of each

We took merged bug-fix pull requests from GitHub projects, each linked to an issue. For each one:

  • The real fix is the change the maintainers merged. Apex should say READY.
  • A broken copy is the same fix with its most important piece removed. Apex should say NOT READY.

Apex only sees the issue text, never the tests the pull request added. Those tests are what we use to grade it: the real fix must pass them and the broken copy must fail them, or the case is dropped.

Out of 300 candidates, 85 met that bar. Most were dropped because the real fix did not pass its own tests in a clean install, which is a lesson of its own about how hard "just run the tests" is on a real project.

The results so far (30 of 85 cases)

What Apex said Cases
Right on both: READY for the fix, NOT READY for the broken copy 6
Caught the broken copy, UNKNOWN on the real fix 3
READY for the fix, UNKNOWN on the broken copy 2
Wrongly blocked the real fix 5
Passed the broken copy as READY 1
UNKNOWN on both 13

That is not a victory lap. Apex caught 13 of 30 broken copies and missed 1. But it also wrongly blocked 5 correct fixes, and it said UNKNOWN far too often.

UNKNOWN is the honest answer when Apex cannot prove anything. But a checker that mostly says "I don't know" does not help you much.

Every wrong answer is a bug in Apex

We treat each wrong verdict as a bug in our tool, find the cause, and fix it. From this first batch:

  1. Errors that belonged to someone else. On one project, Apex blocked a correct fix because the type-checker reported errors inside installed packages (node_modules) that clashed after install. Those are not the change's errors. Fixed.
  2. A message we never read. On a charting library, every check failed with "chart type bar is not registered". That was a mistake in our own check, not in the fix. But Apex read only the first line of the test runner's report, name: "Error", so its second look never saw the real message. Fixed.
  3. Checks that never got started. When every check fails the same way on the old code and the new, the checks never got past their own setup. Apex now writes one fresh set and tells it what went wrong. The fresh set counts only if it fails on the old code and passes on the new; otherwise the first answer stands.
  4. Tests we didn't count. Apex counted Python tests by looking for def test_, which misses async def test_. Check files made only of async tests were thrown away as "no tests". Fixed.

Each fix is checked against 354 labelled changes we already have, to make sure it changes no answer it shouldn't. We're now re-running the cases. The next post will show whether the numbers moved, including if they didn't.

Why we publish the bad numbers

Because you should be able to check any claim a verification tool makes about itself. The benchmark, the scripts and every result are in the repo.

Help us make it better

Apex verify is free and open source, and it will stay that way.

  • Try it on a change your AI agent made. No API key needed; it uses your signed-in Claude Code or Gemini CLI. Setup in the README.
  • Tell us when it's wrong. A change it wrongly blocked, or a broken change it passed, is the most useful thing you can send. Open an issue.
  • Star the repo so others can find it.
  • Support the work. Running these tests on real projects costs compute and model time. If Apex saves you a bad merge, you can buy us a coffee. Every one goes into making it better.

Top comments (0)