Documented unittests & code coverage

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Thu Jul 28 23:50:33 PDT 2016


On 7/28/2016 10:49 PM, Jonathan M Davis via Digitalmars-d wrote:
> True, but particularly when you start doing stuff like trying to require
> that modules have 100% coverage - or that the coverage not be reduced by a
> change - it starts mattering - especially if it's done with build tools. The
> current situation is far from the end of the world, but I definitely think
> that we'd be better off if we fixed some of these issues so that the
> percentage reflected the amount of the actual code that's covered rather
> than having unit tests, assert(0) statements, invariants, etc. start
> affecting code coverage when they aren't what you're trying to cover at all.

Worrying about this just serves no purpose. Code coverage percentages are a 
guide, an indicator, not a requirement in and of itself.

Changing the code in order to manipulate the number to meet some metric means 
the reviewer or the programmer or both have failed.


More information about the Digitalmars-d mailing list