Subj : Re: Not debugging? To : comp.programming,comp.lang.java.programmer,comp.lang.lisp From : George Neuner Date : Fri Aug 26 2005 12:50 am On Thu, 25 Aug 2005 01:24:01 GMT, "Phlip" wrote: > >If you can think of the next _line_ of code to write, you must perforce be >able to think of a complementing test case that would fail if the line were >not there. Just make writing the test case part of writing that line. > In principle you're right ... but it's rarely that simple. I support testing and assertions wherever possible, including intra-procedure if there is some meaningful test that can be done on a partial result - but testing line by line is ridiculous. It may be extremely difficult or quite impossible to figure out what would happen if a particular line of code is wrong or missing. It's also unwieldy because such tests frequently can't be batched but must be executed in-line due to following code altering the test conditions. I didn't agree with this "line by line proof" approach in 1981 when Gries proposed it in "The Science of Programming" and I don't agree with it now. YMMV. I use to do image processing in which the processing was a dependent chain of fuzzy logic. All the possible answers were wrong in some absolute sense - and the object was to find the answer that was least wrong. If I missed a minor step or had a bug in a calculation somewhere, the chances are I wouldn't be able to tell by looking at the intermediate results. George -- for email reply remove "/" from address .