One PR. 800K+ lines of unit tests, deleted.
Sherwood from Sazabi posted that screenshot in October and the timeline argued about it for weeks. Then Kun Chen ran a DeepSWE experiment: ban the agent from writing tests, and the success rate went slightly up while token spend went down. Someone at Momentic hand-reviewed 1,000 AI-written unit tests and kept 96.
So "unit tests are dead in the AI era" has more or less become the new consensus among heavy agent users.
I went through a lot of the threads on both sides, and the more I read, the more it felt like two different claims were getting blended into one.
Look at the tests people are actually complaining about: mock out every dependency, then assert a function was called once. Cover config combinations that can never happen, just to bump coverage. Write the code first, then have the agent reverse-engineer tests from it.
Google's Testing Blog called these "change-detector tests" back in 2015 and said flat out they have negative value. DHH's "test-induced design damage" post from 2014 was aimed at the same kind of thing.
So "bad unit tests are useless" was the consensus long before LLMs. What AI did was make them 100x cheaper to produce.
Going from "AI writes bad unit tests" to "unit tests are useless" is like going from "airport sushi is bad" to "sushi shouldn't exist."
So what actually changed? I'd say three things.
1. The same model writes the questions and the answers. Test expectations used to come from requirements. Now the agent writes the implementation, then writes tests that restate it. Both are wrong in the same way, and CI is still green.
2. Code got cheap. An agent can rewrite a module several times a day. Tests coupled to internals go red every time, fixing them gets handed back to the agent, and the easiest fix is to loosen the assertion. Kent Beck has said he struggles to stop agents from deleting tests. In the ImpossibleBench paper, GPT-5 in some setups chose to game the tests more than half the time instead of fixing the bug.
3. Humans can't review it all. OpenAI's Harness Engineering post says it plainly: once code throughput went up, the bottleneck became human QA. Nobody reads a PR with 300 new tests line by line.
Notice that none of these three says "AI doesn't make mistakes."
The strongest argument from the delete-them camp is that frontier models are already solid at local logic, so unit tests are checking the one thing the model is best at. I don't buy it. EvalPlus expanded HumanEval's test cases by 80x and GPT-4's pass rate dropped from 88.4% to 76.2%. The model didn't get dumber. The original tests were just too weak to catch the bugs. The numbers are a bit old, but the point stands: edge cases, empty inputs, ordering bugs are exactly what unit tests catch most cheaply.
Roughly how I handle it now:
Delete: tests reverse-engineered from the implementation, heavy-mock tests, tests that assert call order. If you're unsure, run mutation testing. If a test stays green when you break the code, it can go.
Keep: pure logic, edge cases, money, permissions, state machines. A human sets the expected values from the requirements, and the agent doesn't get write access to those files.
New job: tests are now the agent's objective function. Write a failing test, have the agent implement, don't let it touch the test file. That's straight out of Anthropic's Claude Code best practices. Kent Beck's version: a suite that runs in 300ms can stay on the whole time the agent works, so you know the second it breaks something.
Also, deleting unit tests doesn't remove the verification work. It moves it up to integration and E2E. Nate Berkopec's reply to Sherwood nailed it: not a dumb idea, but you'll need a lot more testing at the higher levels.
AI didn't kill unit tests. It killed the write-something-so-the-box-is-checked kind.
Tests were always for whoever touches this code three months from now. These days that's probably an agent, and it needs a fixed answer key more than any human ever did.
Is your team still letting agents write unit tests? Did you delete them or keep them?
We deleted 800k lines of unit tests from the @sazabi monorepo earlier this week. Three hypotheses: 1- Unit tests "lock-in" slop code by making it hard to change or remove 2- Unit tests slow down dev cycles by making your agent do more work locally and by increasing CI times 3- Unit tests waste money by making your agent generate more tokens and by adding useless CI runs Will report back soon with the results!在 X 查看被引用的帖子
来源:Zuckjet · x.com