In a conversation between Richard Seidl and Golo Roden, the focus is on a point that is underestimated in many projects: the deceptive security of high test coverage. Among other things, the two discuss a team that simply deleted its red – i.e. failing – tests. Afterwards, the test suite was green again. The software had not improved as a result.
This anecdote describes a pattern that project managers should know. Test results become a metric, and as soon as a metric becomes a goal, there is always a shortcut to achieving it – without anything changing in the quality of the product.
What test coverage measures – and what it does not
Test coverage (code coverage) indicates what proportion of the source code was actually executed during a test run. It therefore measures execution, not verification. A test can run through lines of code without formulating a single meaningful expectation. Coverage still rises.
This results in an uncomfortable asymmetry: low coverage is a reliable warning signal, because what is never executed cannot have been verified either. High coverage, on the other hand, is no proof of quality. It merely rules out a certain kind of gap and says nothing about whether the right cases, the boundary conditions and the error paths are covered.
Why green tests for the wrong reasons cause harm
A project without tests is honest: everyone involved knows that they have to check manually before anything goes into production. A project with a green but empty test suite creates the opposite – a sense of security that is not backed up.
The consequences usually only show up later:
- Reviews are more superficial because "the tests are green".
- Refactorings become bolder, even though the safety net has holes.
- Bugs reach production and are corrected there at great cost.
- Trust in the test suite falls – and with it the willingness to maintain it.
Deleting red tests is only the most conspicuous variant. Subtler forms are permanently disabling individual tests, weakening expectations until they fit again, or updating the expectation to the current behaviour without checking whether this behaviour is correct.
A red test is information
A failing test is not a bad thing in itself. It is the result for which the test suite was built: an indication that an assumption and reality have diverged. What matters is how a team deals with it.
Three reactions make sense: fix the bug in the code, correct the expectation if the requirement has demonstrably changed, or replace the test if it checks the wrong behaviour. What does not make sense is making it disappear so that the pipeline runs through again.
Behind this there is often not a technical but an organisational problem: deadline pressure, a deployment pipeline that blocks without green tests, and an unstable set of tests that regularly fails for no apparent reason. Anyone who does not consistently stabilise such so-called flaky tests – tests that sometimes pass and sometimes do not – trains their team to ignore red results.
Particular relevance in AI-assisted development
Code is created faster today, partly because language models support development teams in writing it. The same tools also generate tests on request – in large quantities and in a short time. This is precisely where the problem described becomes more acute.
Generated tests are oriented towards the existing code. They therefore tend to describe what the implementation does, not what it should do. A bug that is already in the code may thus be cemented rather than uncovered. The coverage figure rises, but not the meaningfulness.
The consequence is not to do without these tools, but a shift in emphasis: the actual substantive work lies less in typing the tests than in deciding which expectations need to be checked in the first place. This decision cannot be delegated.
How to recognise test quality
For project managers without deep insight into the code, there are some practical questions to ask the development team:
- When did a test last turn red – and what happened as a result?
- Are there disabled or skipped tests, and since when?
- Which business risks of the project are covered by tests, not what percentage of the code?
- How many production bugs of the last months could the test suite theoretically have found?
- How are intermittently failing tests handled?
These questions aim at behaviour rather than numbers. They show more quickly whether a test suite is taken seriously than any coverage statistic in reporting.
Coverage as a secondary value, not a goal
Test coverage remains useful as a diagnostic tool: it points to areas that are not checked at all and makes visible when new functionality is added without any safeguards. It becomes problematic as soon as a fixed percentage target is regarded as proof of quality and the achievement of this target is rewarded.
The better guiding question is not "How much code is covered?" but "Which bugs would we notice before customers notice them?" A test strategy can be built on this that is oriented towards business risks – payment transactions, data migrations, permissions, interfaces.
For web and software projects, this means: test coverage does not belong in target agreements, but it certainly does belong in observation. More important than the metric is a culture in which a red test is seen as a valuable signal and not as an obstacle before release. Especially when code is created faster with AI support, the quality bottleneck shifts from writing to checking – and thus to the question of whether a team is right to trust its own test suite.
Sources
- Software Testing: Green tests for the wrong reasons are worse than none — heise developer News