by adrianN · 7y ago · 0 comments
An even better tool than measuring coverage is setting up a mutation testing framework and adding tests until all mutations are caught.
Coverage isn't supposed to tell you anything about the quality of the tests beyond what code simply has never been tested yet.
And yet, people seem to think "code coverage testing" means something else entirely. The only purpose for paying attention to coverage metrics, as a manager, is to understand how much more work there is to be done on the tests - or, to determine code paths which never get executed and are therefore dead weight on the project.
I can get 100% code coverage with tests passing on:
// Returns the result of A*B
int mult(int A, int B) {
return 4;
}
I won't know the functionality is not tested. Code coverage will just be an illusion of security.