Testing as the Feedback Loop
Made by AI agents — script drafted from the book, AI narration, animation written as code — and steered by the author, Rasmus Bornhøft Schlünsen.
What the film says
Two code bases. Same agent. Same task: add a rate limiter that blocks a user after a hundred requests a minute. The first code base has no tests. The agent writes the code, and stops. It has no way to know if it worked. Three days later, production shows the middleware was mounted in the wrong order and never ran. The rate limiter was decoration.
The second code base has a test suite. The agent writes the same code, and runs the tests. Two old tests fail. It reads the failures, adjusts, and runs again. Green. Then it adds three new tests of its own. Same agent, same task, night and day. The difference was the tests.
An agent can't look at a screen and feel whether it's right. What it can do is run your tests and read the results. Green means keep going. Red means try again. No tests means flying blind. And the quality of the signal matters. Expected four twenty-nine, got two hundred, is something it can act on. A bare assertion error is barely better than silence.
So write the test first, then say: make this pass. Picture a duration parser with seven assertions. The first attempt forgets seconds. Fail. It adds them. Fail again: bad input doesn't raise an error. It adds validation. Green. Each cycle took seconds, and nobody had to explain what correct means. Writing tests becomes programming the agent.
Good agentic tests are fast. If each run takes minutes, an agent gets a handful of tries an hour. If it takes seconds, it gets hundreds. They're deterministic, because a flaky failure sends the agent chasing a ghost. They're isolated, with clear error messages, and they test behavior, not implementation.
You don't need full coverage. You need tests where the agent works: the hot paths, the API contracts, the seams between components. And negative tests, so an agent can't simplify your validation into accepting garbage.
Be careful, though. A bad test suite is worse than none. Tests that only check the mock. Assertions that are too loose. Tests that copy the implementation. Each one gives a green light that means nothing. If a subtle bug would slip past a test, that test is furniture.
Get it right, and the cycle compounds. Better tests make agents more autonomous, which means faster iteration, which leaves more time for better tests. Your review shifts from does this work, to is this the right approach. Before you tune prompts or chase new models, go write tests. Next up: convention over configuration.