Documented unittests & code coverage

Seb via Digitalmars-d digitalmars-d at puremagic.com
Thu Jul 28 16:34:35 PDT 2016


On Thursday, 28 July 2016 at 23:14:42 UTC, Walter Bright wrote:
> On 7/28/2016 3:15 AM, Johannes Pfau wrote:
>> And as a philosophical question: Is code coverage in unittests 
>> even a
>> meaningful measurement?
>
> Yes. I've read all the arguments against code coverage testing. 
> But in my usage of it for 30 years, it has been a dramatic and 
> unqualified success in improving the reliability of shipping 
> code.

@Walter: the discussion is not about code coverage in general, 
but whether code coverage within unittests should be reported, 
because we are only interested in the coverage of the library 
itself and as Johannes and Jonathan pointed out there are some 
valid patterns (e.g. scope(failure)) that are used within 
unittests and never called.

However as Jonathan mentioned in the Bugzilla issue, the downside 
of not counting within unittest blocks is that potential bugs in 
the unittests can't be catched that easy anymore.


More information about the Digitalmars-d mailing list