Developers are starting to move away from unit tests en masse due to AI and vibecoding.
Abandoning unit tests, AI generates code and tests, quality issues, the importance of E2E testing, new developer roles, risk management in testing
Not so long ago, the rule "write more unit tests" was practically universal. Tests were considered the foundation of reliable code: they run quickly, allow for error isolation, and protect the application from regressions. Now, this idea is being reconsidered!
In the age of AI, the problem looks paradoxical: artificial intelligence has learned to write not just code, but the tests for it as well. And if the same model creates both the implementation and the verification of that implementation, a high number of passing tests no longer necessarily signifies high software quality.
When does AI write both the code and the tests?
Imagine a simple task. A developer asks an AI to implement an order cost calculation. The model creates a function and then generates 20 unit tests for it.
All tests pass. At first glance, the task is complete. But what happens if the AI misunderstood the business rule?
Suppose a discount should only apply to orders over €100. The model mistakenly decides that the discount applies to all orders. It will write a function with this logic and is then perfectly capable of creating tests that confirm exactly that.
The result is a nasty situation: the tests are green, the code works exactly as the tests check, but the business receives the wrong result.
This is one of the main criticisms of over-reliance on unit tests in AI-driven development.
A test can prove that a program conforms to the test. But it doesn't necessarily prove that the program meets the requirements.
Is AI changing the economics of testing?
Previously, writing 20 good unit tests was a significant part of a developer's workload. You had to devise scenarios, write the code, check edge cases, debug errors, and maintain the tests after changes.
Now, AI can create dozens of tests almost instantaneously.
Therefore, a new question arises: if the cost of writing a test has nearly vanished, is it really necessary to simply write more of them?
Or is it more important to understand exactly what they are capable of proving?
A Checksum study published in July 2026 illustrates the scale of the problem. Among 105 engineering managers, 61% reported encountering a production incident related to AI-generated code in the previous 90 days. Furthermore, 74.3% stated they had to roll back code due to issues that were not caught by their unit tests.
At the same time, trust in AI is growing: 7,8.1% of study participants reported trusting AI-generated code more than they did a year ago.
It's a paradox. Companies are increasingly using AI to write software, but are simultaneously forced to pay more attention to verifying the results.
Unit tests vs. the real product
This is exactly where end-to-end testing re-enters the discussion.
A unit test can check an individual function:
calculatePrice(100, 20) = 120
But it doesn't check what happens to that calculation within the entire system.
An E2E test can run a full scenario:
Пользователь добавляет товар в корзину, применяет промокод, оплачивает заказ, получает чек, в чеке правильная сумма
Such a test is much closer to the actual behavior of the product.
This is why some developers are now suggesting shifting the balance toward integration and E2E tests. Not because unit tests have become useless, but because AI-generated code introduces an additional risk: the model might correctly test an incorrect implementation.
That said, completely abandoning unit tests would be a mistake.
If an application contains a complex algorithm, tax calculations, payment processing, data parsing, or other isolated business logic, a unit test remains a very efficient way to quickly verify many variations.
The question is more about something else: what exactly do we want to verify?
Will the old testing pyramid need a redesign?
The classic model looked roughly like this: many unit tests at the base, fewer integration tests in the middle, and a small number of expensive E2E tests at the top.
The logic was clear: unit tests are cheap and fast, so it's profitable to cover most of the code with them.
But AI is changing the cost structure of this model.
AI can create a hundred unit tests in seconds. However, it can just as quickly create a hundred tests that verify the details of a specific implementation rather than the business requirements.
Therefore, a new approach might look different: unit tests where they actually provide a signal, integration and contract tests for component interaction, E2E for critical user scenarios, and separate requirement validation by humans.
This is no longer a matter of the "unit tests are mandatory" dogma.
It is a matter of risk management.
The irony: AI makes unit tests cheaper and less valuable at the same time
The most interesting change is that AI isn't destroying unit tests. It is destroying their scarcity.
When a developer spent several hours creating tests, the number of tests itself was a meaningful metric.
Now, AI can create hundreds of them.
As a result, the quantity of tests is becoming an increasingly uninformative metric.
You can have 10,000 green tests and still suffer a production error because no one checked the primary user scenario.
You can have far fewer unit tests but achieve great coverage of critical business processes through integration and E2E checks.
And here, a new developer role emerges.
If previously a significant portion of the work involved writing code and tests, now more time may be spent defining correct constraints, verifying architecture, and validating system behavior.
AI is very rapidly transforming the developer from someone who writes every line of code into someone who must understand the system they are building in the first place.
Microsoft, for example, is already developing GitHub Copilot Testing for .NET, which helps automatically create unit tests in Visual Studio. In other words, the industry is moving in two directions simultaneously: AI is making automated test generation massive, while developers are starting to debate whether these tests are sufficient to verify actual product behavior.
Perhaps that is why the main question of the AI era will not be: "Is this function covered by a unit test?"
But something much simpler: "How have we proven that the system does what the user expects?"
And if the answer to that question is merely "we have 95% test coverage," perhaps it is time to write another test. But not necessarily a unit test.
If you are interested in AI, technology, and the future—welcome to my channel to discuss and share updates.
Translated from Russian. Original on vc.ru: Разработчики начинают массово отказываться от unit-тестов из-за ИИ и вайбкодинга.