C++ guys hate static_if?

Jonathan M Davis jmdavisProg at gmx.com
Thu Mar 14 15:47:55 PDT 2013


On Thursday, March 14, 2013 14:40:11 Walter Bright wrote:
> On 3/14/2013 2:26 PM, bearophile wrote:
> > Walter Bright:
> >> I understand this. But my experience in the matter has been that if the
> >> tests cover 100% of the code paths, the incidence of undetected bugs in
> >> the code goes very, very low.
> > 
> > This is not so much true for template-heavy code.
> 
> I don't believe that without further evidence.

It's been fairly frequent that std.range and std.algorithm don't work 
correctly with reference type ranges. The only way to catch that is to test 
those functions with reference type ranges. 100% code coverage won't get you 
there. I fully agree that it's a big step in the right direction, but I don't 
think that it's been all that uncommon for there to be bugs in Phobos where 
some ranges work and some don't when the buggy function had high code coverage 
- it just was likely to be testing primarily with arrays and not enough with 
other range types. We've definitely been reducing the number of those types of 
bugs, but they were caught because people tried to instantiate them with types 
that the unit tests didn't test.

- Jonathan M Davis


More information about the Digitalmars-d mailing list