UnitTestGame pairs you with a maliciously compliant AI bot. It writes the laziest code that satisfies your unit tests. And nothing more. Your job: write unit tests until the program is right.
I want to add this unit test.
powerMode(20) === "NORMAL MODE"
function powerMode(batteryLevel) {
return "NORMAL MODE"
}
I want to add this unit test.
powerMode(19) === "LOW POWER MODE"
function powerMode(batteryLevel) {
if (batteryLevel >= 20) return "NORMAL MODE"
return "LOW POWER MODE"
}
No lectures. No quizzes. Just an AI bot exploiting every hole in your unit tests.
See what the function is supposed to do, in plain input → output terms.
The AI bot ships the laziest code that satisfies exactly what you tested.
Spot the edge case it dodged, and add a unit test that exposes it.
Repeat until there's no shortcut left. Level completed!
It plays like a game. It sticks like a habit. It changes your way of testing.
The AI bot is maliciously compliant. Every move is a lesson about your blind spot.
Start with battery levels. End up untangling speed displays and parking fees.
A level board tracks what you've unlocked, so you always know what's next.
Converse in English, Dutch, German, French, Spanish, or Italian.
Let the AI bot write programs in JavaScript, TypeScript, Python, Java, C#, PHP, or Ruby.
Runs entirely in the browser. No account, no install, no dependencies to fight with.
Each one looks simple. Until the AI bot finds another range you forgot to test.
The AI bot shows you first. Then it's your turn.
One birthday. Two possible outcomes.
Three thresholds stand between calm and storm.
Price and quality, working against each other.
A full cart, a member card, or both at once.
Everyone knows FizzBuzz. The bot doesn't.
An exception to the exception to the rule.
Every side length changes the verdict.
The physical display has limits. Find them all.
Free, flat, or by the minute. What now?
No sales pitch. Just answers.
Yes. No ads, no tracking, no paywall. Just a free game.
JavaScript, TypeScript, Python, Java, C#, PHP, and Ruby.
English, Dutch, German, French, Spanish, and Italian.
Nope. It runs entirely in your browser. Without external libraries.
Nope. You can only play anonymously.
Your progress is saved in your browser. It doesn't leave your computer.
Yes. The source code is available on GitHub.
This game is created by a CS teacher. For the love of programming and testing.
Click the button, follow the instructions, and see what the AI bot tries to get away with.
Play UnitTestGame for free →