What Does a Passing Test Actually Prove?
When a test suite turns green, the result feels reassuring. The code has been checked, the change is ready, and perhaps the problem is solved. But a passing test proves something more specific: under the conditions represented by those tests, the observed output matched the expected output.
That is useful evidence. It is not a universal guarantee. A test cannot cover a situation that was never described, and it cannot correct an expectation that was written incorrectly. The quality of the evidence depends on the cases selected, the assumptions encoded and the independence of the expected result from the implementation being tested.
Every test needs an oracle: a way to decide what the correct result should be. For a small arithmetic function, the expected output may be easy to calculate. For a system involving time zones, permissions, changing data or several interacting services, the correct behaviour may require careful interpretation of a specification.
If the test expectation is copied from the same flawed logic as the implementation, both can agree and still be wrong. Examples, invariants and independent calculations can reduce this risk, but they do not remove the need to ask whether the requirement itself reflects the real need.
Unit tests examine small units in isolation. Integration tests examine how components work together. End-to-end tests follow a user-visible path through a larger system. Each offers a different view, and each can miss problems outside its boundary.
Coverage measures which parts of the code were exercised, not whether the assertions were meaningful. A line can execute without its important outcomes being checked. Conversely, a carefully selected test may reveal a serious defect while exercising only a small part of the program.
Boundary cases deserve particular attention: empty collections, minimum and maximum values, missing permissions, interrupted operations and unexpected input. They are not merely unusual situations; they often expose assumptions that ordinary examples leave invisible.
A useful test suite is an evolving argument about how a system should behave. Each test records a case, an expectation and a reason that the case matters. The suite becomes stronger when its assumptions are explicit and when tests are designed to challenge the implementation rather than simply mirror it.
So when the tests pass, celebrate the evidence—but state its scope accurately. The result tells us that the selected checks passed. Confidence grows when those checks are representative, independent, and supported by clear requirements, review and observation of the system in use.