Smart thoughts on code coverage.
Code coverage can't tell you how well something is tested, or even if it is tested at all, and it makes for an actively harmful quality target. Code coverage is a dev tool, not a status report. #gametesting #gamedev #testautomation
Author is spot on. I did a lot of testing on servers. My joke/rule of thumb was that you got a free 30% code coverage just by starting the server. I remember one time reviewing a module that was presented to as 100% code coverage. Someone had written tests against the getters and setters on every field to close the final mile. My comment to the engineer showing me this was "So, essentially, you are testing the C# compiler." Meanwhile, when surveying test code for APIs that used the same 100% covered classes, not a single one of those tests ever passed in a class with those covered properties set to a value, which did have an effect on functionality in those components. I said to the engineer "I don't care about the get/set coverage, what I care about is that none of these APIs were ever tested with this field's value set to true." Coverage metrics motivate bad behavior.