Documented unittests & code coverage

Atila Neves via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 5 08:38:55 PDT 2016


On Friday, 5 August 2016 at 02:37:35 UTC, Walter Bright wrote:
> In adding some overflow detection to Phobos, I discovered that 
> some allocations were never called by the unittests. Adding a 
> unittest for those paths, I discovered those paths didn't work 
> at all for any cases.
>
> I'm not giving up coverage testing anytime soon, regardless of 
> what some study claims :-)

:)

Like I said, measuring coverage is important, what isn't is using 
it as a measure of the quality of the tests themselves. The other 
important thing is to decide whether or not certain lines are 
worth covering, which of course you can only do if you have the 
coverage data!

Mutant testing could have found those code paths you just 
mentioned, BTW: you'd always get surviving mutants for those 
paths.

Atila


More information about the Digitalmars-d mailing list