Subj : Re: Unit vs. integration testing (was: Not debugging?) To : comp.programming,comp.lang.java.programmer,comp.lang.lisp From : Duane Bozarth Date : Sat Sep 03 2005 05:08 pm "Robert Maas, see http://tinyurl.com/uh3t" wrote: > .... > > We had a bug where an update to our library disabled some features of a > > client program. After some investigating, it was determined that the > > client program was doing this: > > if (library_version == 3) > > instead of this: > > if (library_version >= 3) > > It's obvious to me that the client program was never unit tested > properly. Since there was a line of code that checkd the library > version, there should have been a unit test whereby different library > versions were supplied by a test rig and the client program was checked > to make sure it performed correctly in all such cases. Testing boundary > cases would have sufficed for this line of code. Except for the fact that at the point in time there was probably not another libarary of the type to do the test...that is an oversight in the design/specification stage, and more than likely would not have reported an error on a test suite. Unit testing won't uncover logic flaws in the design or even in the testing scope/design. > > Our fix for this bug was to detect the client and report 3 for the > > version if the client was the offending program, and otherwise report > > the true version. > > Given that the client program had a bug, it made more sense to fix that > bug rather than accomodate it ... In all likelihood, the client was not product... > > This is the sort of bug that gets caught in integration testing. > > Only because complete unit testing of the client never occurred. ... No, because the client wasn't part of the unit under test... .