Showing posts with the label Automation

Why chasing Unit Test coverage can be a bad idea

In the long running battle between management chasing metrics and developers just trying to get the job done, (hi boss!)  I wanted to provide some less obvious examples of why chasing code coverage is a damaging process.  Why Unit Test Code Coverage targets are bad Code Coverage can be gamed, incentivising low quality tests If the coverage percentage is all that matters, there are many ways to increase that number without actually improving the quality and reliability of the code. Having a test doesn’t mean no bugs - it just means the code is being run by a test, that the pathways through the code are exercised by another piece of code. There’s not really any link in these tests to importance of functionality, or even any consideration of code doing the right thing, just that it’s being exercised. Tests add a maintenance burden In the writing of low value tests written only to satisfy KPIs, developers are actually making more work for themselves in the future.  All code adds a maintena