On Wednesday, April 03, 2013 12:03:39 Walter Bright wrote: > On 4/3/2013 11:56 AM, Jonathan M Davis wrote: > > Certainly, I agree that having the minimal tests required to test > > everything that needs testing should be the goal, but figuring out which > > tests are and aren't really needed is a bit of art. > > That's why we are engineers, and not mere code monkeys.
True. > > Actually, I'd argue that in perfect world, you'd test absolutely every > > possible input to make sure that it had the correct output, but that's > > obviously impossible in all but the most simplistic code, > > We can exploit mathematics to reduce the test cases while testing > thoroughly. In physics I learned to test one's solution with the boundary > cases and a couple of known cases. Mathematically, that was sufficient. Definitely, though in some cases, figuring the bounds cases can be quite tricky - e.g. as thorough as std.datetime's unit tests are, I still missed some in one instance and got a bug report early on for that (though on the whole, there have been very few bugs reported on std.datetime, so I think that the unit tests have been quite effective). But getting good at figuring that sort of thing out _is_ part of our job description. - Jonathan M Davis