What this is about
When an AI writes code, a report or a batch of images for you, you need to know whether it is right. The usual signal is a green tick: tests passed, the job finished, no errors. This article explains why a green tick can be empty, and gives three simple checks you can run even if you are not an expert.
Why it matters
An AI is good at producing something that looks finished. It is less good at telling you honestly when it is not. A fast, confident, wrong result is more dangerous than a slow, unsure one, because you stop looking.
We learned this the expensive way. The failures that hurt us most were not crashes. They were tests that said PASS while checking nothing, and jobs that said success while producing noise.
How it goes wrong: real cases
A test that said PASS over an error
In a game project of ours, a test failed with "Node not found: Shelters." The cause was a parse error in one script. The embarrassing part: the four-map rebuild had printed PASS, with the same parse error sitting in its own log. Nothing in that build looked at it.
A run that selected nothing
Our test script lets you run only the tests you name. A name that matches nothing runs nothing, and the script exits with success. A green result from zero tests is still green.
A gate that stopped every test
A safety check that scans for stray hard-coded numbers found three in a new file, and stopped. As a result, no tests ran at all. That one was loud, at least. The quiet version is worse: a check that never looks.
Clocks that lie
Two of our bugs shared a cause. A test timed the server with the client's wall clock. A stalled server then looked like one with nothing to drain. The test measured the wrong clock.
A job that succeeded with noise
We benchmarked an image model. The fastest arm took 12 seconds against 34 for the slowest, and it looked like the winner. Every image it made was RGB static. The job exited 0, wrote a file and logged no warning. The cause was one setting at the wrong strength. We caught it by looking at the pictures.
The guard we added was a cheap statistic. Pixel variance on pure noise was five times higher than on any real render.
Three checks anyone can run
Check 1: can it fail?
Break something on purpose and see whether the check notices.
If a test says your code is right, change one line to be wrong and run the test again. If it still passes, it was not testing that line. Our own tooling for porting programs does this at scale: our mojo-port checker compares a new program against the original on output and exit status, and then runs mutants, which are small deliberate breakages. A good check must kill them.
For a beginner, the same thing in one line: if you cannot make the check fail, you do not know that it works.
Check 2: look at the thing itself
Open the output. Not the summary, not the log, the output.
If an AI made ten images, look at three. If it made a table, read five rows. If it fixed a page, load the page. Many of our worst mistakes were caught by one human glance, one step after the number was written down.
Add one cheap number where you can. For images, variance or file size. For text, length or the count of lines. Wrong outputs often look wrong in a single statistic.
Check 3: compare with something independent
Do not let the AI mark its own work. Compare the result with something it did not produce.
A known answer, a second tool, the old version, or a number you work out by hand. In our port checks, the original program is the reference. When the two agree on many inputs, you have real evidence. When you have no reference at all, say so, and call the result unverified.
A short routine
- Read what the AI claims it did, in one sentence.
- Run the check, and then break something on purpose and run it again.
- Open the output and look at a few examples.
- Compare with one independent reference.
- Write down what you checked. If a step is missing, write "unverified."
Glossary
- Test: a small program that checks one thing and says pass or fail.
- Exit code: a number a program returns when it ends. Zero usually means success.
- Mutant: a copy of a program with one small deliberate fault, used to see whether the tests catch it.
- Reference: a trusted answer or program you compare against.
- Variance: how spread out a set of numbers is. Pure noise is very spread out.
- Gate: a check that must pass before the next step.
Try it
- See how a port is checked. The mojo-port repository describes how we check a Mojo port of a Python tool against the original. Read the README for the order of checks: output, exit status, then mutants.
- Break one test. Pick any test you rely on, change the thing it tests so it is wrong, and see whether it fails.
- Read our honest cases. On our blog, "Tests That Passed for the Wrong Reason" and "Jobs That Succeed and Are Wrong" tell the longer stories.

Comments
No comments yet.
Log in to comment.