← Back to Writing

Production Code Is Dead. Long Live Test Code.

March 7, 2026 · 5 min read

Twelve years ago, DHH wrote "TDD is dead. Long live testing." and the internet lost its mind. He was right — but he was early. In 2026, it's not just TDD that's dead. It's the entire concept of production code as the most valuable thing you write.

I build and ship products every day using Claude Code, Codex, and Gemini. I've written thousands of AI-assisted prompts across dozens of projects. And the single clearest insight from all of it is this: the code that matters most is no longer the code your users see. It's the code that makes sure the code your users see actually works.

Test code is the new production code.


Building From Zero to One Has Never Been Easier

Let's be honest. Generating logic is becoming a commodity.

Last year, I shipped an entire screen recording engine, UI framework, and export pipeline — solo. Features that used to take a team of five an entire sprint now take me an afternoon. Claude Code writes the implementation. Gemini reviews the architecture. Codex catches the edge cases. I orchestrate. The code appears.

This isn't bragging. This is Tuesday. Increasingly, any developer with a $200/month AI subscription and a clear problem statement can do something similar. A teenager can scaffold a SaaS skeleton in a weekend. A non-technical founder can prompt their way to a working prototype before their seed round closes.

Zero to one has never been cheaper. One to a hundred is accelerating.

The bottleneck is shifting. It's less about "can you build it" and more about "does it actually work — and will it keep working when you change something?"


Production Code Is No Longer Your Moat

This is the part that makes people anxious, and it should.

If anyone can generate production code at near-zero marginal cost, then production code is no longer a competitive advantage. It's table stakes. Like having a website in 2005 — you need one, but having one doesn't make you special.

So what is the moat?

I think the answer is stability. Reliability. The confidence that when you ship, it works. When you refactor, nothing breaks silently. When your AI generates 500 lines of code in 30 seconds, you know — not hope, know — that it does what it's supposed to do.

That confidence comes primarily from one place: test code.

Yes, there's a broader verification stack — types, linters, static analysis, staging environments, observability, feature flags. All of those matter. But tests are the executable specification. They encode intent in a machine-verifiable format. Everything else checks form. Tests check behavior.

Here's an analogy that I find clarifying. Think about how AI itself improves. In reinforcement learning, the loop is: generate an output, evaluate it against criteria, feed back the result. The reward model in RLHF isn't exactly a test suite — but it plays an analogous role. It's the evaluative signal that drives convergence. Without it, the model just generates plausible-looking garbage.

The leverage in software is shifting the same way — from the code that creates behavior to the code that verifies behavior. From output to oracle. From production to proof.


Spend 50% of Your Tokens on Tests. I'm Serious.

Here's my actual, opinionated position: if you're using AI to build software, you should be spending at least half your time and tokens writing tests. Not production logic. Tests.

I know that sounds extreme. Let me explain why I believe it.

When an AI writes your production code, there are two possible outcomes. Either the code works, or it doesn't. If it doesn't work and you have no tests, you find out when users find out. That's a disaster.

If it doesn't work and you have tests, you find out in seconds. That's the difference between a five-minute fix and a five-alarm fire.

But it goes deeper than catching bugs. Tests are the specification. When you write a test first — or alongside your prompt — you're encoding your intent in a machine-verifiable format. You're telling the AI not just "build me a login system" but "build me a login system that rejects passwords under 8 characters, rate-limits after 5 attempts, and handles Unicode usernames." The test is the spec and the spec is the test.

In an AI-accelerated world, where code is generated faster than any human can read, tests are the only thing standing between your product and chaos.

I've watched this go wrong up close. Last quarter, I used Claude Code to refactor the export pricing logic in ScreenKite. The AI rewrote the module cleanly — all the old behavior preserved, or so it looked. Everything compiled. The app ran fine. But the rounding strategy changed from round half up to round half even. The difference: maybe a cent here and there. Nobody noticed for six weeks, until a user's invoice didn't match their receipt. A single test asserting export_price(9.995) == 9.99 would have caught it in seconds.

That's not a hypothetical. That's my codebase. And I've heard similar stories from other teams shipping AI-generated code without tests.

Test code is invisible. Users never see it. Investors never ask about it. It doesn't make the demo look better. That's exactly why it's undervalued. And that's exactly why the teams that take it seriously will win.


Tests as the Feedback Loop

The RL analogy from earlier isn't just philosophical — it has practical implications for how you work with AI coding tools.

Your AI agent generates code. Your test suite evaluates it. The feedback loop — red test, fix, green test — functions like the reward signal in reinforcement learning. Not literally the same mechanism, but structurally analogous: both are iterative optimization against evaluative criteria.

If your test suite is thin, your AI agent is flying blind. It generates something that looks right. You have no signal to tell you whether it actually is right. So you ship and pray.

If your test suite is comprehensive, the AI has a clear objective function. It can iterate, self-correct, and converge. The tests aren't just catching bugs — they're guiding the generation process.

This is why I say test code is the most important code you write. It's not just a safety net. It's the guidance system.

You might object: "But LLMs will never learn my specific project. They don't have local memory." I used to think this too. I now believe it's wrong.

Your codebase is not just code. It's memory. Every test you write teaches the AI what correct behavior looks like in your specific context. Every doc file, every AGENTS.md, every architecture decision record — these are persistent local memory that survives between sessions. When you update your project's documentation and test suite, you're not just maintaining software. You're training a local reward model. You're encoding your strategy, your edge cases, your hard-won lessons into a format the AI can actually use.

The teams that figure this out will have AI agents that genuinely understand their codebase — not because the models got smarter, but because the local context got richer. Tests, docs, and memory files are the three legs of that stool.


A Call to Rebalance

I don't have all the answers. This is my opinion, formed from building real products with AI every day. You're welcome to disagree — and I mean that.

But here's what I believe:

We're entering an era where generating code costs almost nothing. Maintaining code costs everything. And the most reliable way to maintain code at scale — especially code you didn't hand-write, code that changes constantly, code that three different AI models touched — is to have a test suite that tells you what's still true and what isn't. Types help. Linters help. Staging helps. But tests are the core executable contract.

The developers who thrive won't be the ones who prompt the fastest. They'll be the ones whose code still works six months later. And the secret to that is embarrassingly simple: spend your tokens on tests. Boring, invisible, critical tests.

Production code is dead. Long live test code.


I write about AI, building in public, and running a micro-company with my wife from Edmonton. Follow me at @RealMikeChong.