Traditional Test Coverage is not valuable information

A normal test coverage report (based on criteria such as line coverage, branch coverage, or function coverage) tells you what lines of code have been executed when running tests. However, the fact that a line of code has been executed does not mean that it is actually covered by the test. Running the code is not the same as making assertions on it.

Therefore, you can have a line coverage (or similar) of 100% without actually having anything tested, by simply not having any assertions in your tests.

There’s no way to fully mitigate this issue with traditional testing (it’s of course a good idea to make sure you don’t skip the step in your tests), however there is a technique that can result in better information on the quality of testing, which is Mutation Testing.

1 Backlinks   backlinks