Documented unittests & code coverage

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Thu Jul 28 22:49:01 PDT 2016


On Thursday, July 28, 2016 22:12:58 Walter Bright via Digitalmars-d wrote:
> As soon as we start taking the % coverage too seriously, we are in trouble.
> It's never going to be cut and dried what should be tested and what is
> unreasonable to test, and I see no point in arguing about it.
>
> The % is a useful indicator, that is all. It is not a substitute for
> thought.
>
> As always, use good judgement.

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.

- Jonathan M Davis



More information about the Digitalmars-d mailing list