About the Expressiveness of D

Jonathan M Davis jmdavisProg at gmx.com
Wed Apr 3 12:15:55 PDT 2013


On Wednesday, April 03, 2013 11:58:20 Walter Bright wrote:
> On 4/3/2013 11:44 AM, Jonathan M Davis wrote:
> > Yes. My point was that 100% should be the goal, whereas I know a number of
> > developers who consider something like 70% to be sufficient - and these
> > are
> > folks who actually believe in writing unit tests. Certainly, expecting to
> > hit 100% with -cov on the first try isn't generally very realistic unless
> > you're always extremely thorough with your tests, and even then, it's
> > easy to miss a line or two on rarer branches, especially as functions
> > become more complex.
> Cov testing also has a tendency to expose dead code - not just insufficient
> unit tests.

Good point. That's not something that I typically think of - though in a lot 
of cases (for me personally at least), I think that the greater risk would be 
functions which weren't called at all by other code but _were_ properly 
tested, and -cov wouldn't catch that. But finding dead code with cov is 
definitely something to remember. I should cov more often anyway. Too often, 
given how thorough I generally am with unit tests, I tend to assume that the 
code coverage is there - and it probably is, but it's best to be sure.

- Jonathan M Davis


More information about the Digitalmars-d mailing list