[FRPythoneers] Doctest

Mike Olson Mike.Olson at fourthought.com
Fri Jul 27 10:08:51 MDT 2001


Jim Vickroy wrote:
> 
> Mike Olson wrote:
> 
> >
> > To me, unit tests are really development scripts.  They break when you
> > get into the final stages of project development and the maintence cycle
> > of a project.  Obviously, if the little chunk of code was working, then
> > you would not be there fixing bugs which means that the unit test didn't
> > test the proper aspects, and the rest of the system has been dependent
> > on a piece of code that was not doing what it was supposed to.
> 
> So in this case you either modify the unit test to detect the bug, or you write an
> additional unit test specifically for that type of bug.

Of course.  My point is, that once code has been developed, then unit
tests are useless. 

If you, as the developer, fix the bug and update the test harness
accordingly great.  That one little piece of code is working and now
(maybe) properly tested.  However, the rest of the system was dependent
on the previous behaviour and will probably be broken.  So having a unit
test does you absolutely no good.

> 
> >  So when
> > the developer fixes the unit test will break.  If the unit test was what
> > defined that chunk of codes contract with the rest of the system, then
> > odds are you just broke the rest of the system.
> >
> 
> In my view, unit test do not define a "code chunk's" contract with a system; they,
> instead, verify correctness for a (limited) range of inputs to the code chunk.  Unit
> tests say nothing about behavior outside their domain.

By verify correctness with a (limited) range of inputs, you have created
a contract.  There may be more of a contract, but it us unverifed.  The
rest of the system becomes dependent on the (implied) contract created
by the test case.  The contract has to be there even if implied or else
how do you come up with the limited set of test data?


Mike

> 
> >
> > Mike
> >
> > >
> > > --
> > > Luke Jones = luke/vortex/frii/fullstop/com
> > > _______________________________________________
> > > This message sent by the FRPythoneers mailing list.
> > > Unsubscribe: echo unsubscribe | FRPythoneers-request at lists.community.tummy.com
> > > URL: http://lists.community.tummy.com/mailman/listinfo/frpythoneers
> >
> > --
> > Mike Olson                                Principal Consultant
> > mike.olson at fourthought.com                +1 303 583 9900 x 102
> > Fourthought, Inc.                         http://Fourthought.com
> > 4735 East Walnut St,                      http://4Suite.org
> > Boulder, CO 80301-2537, USA
> > XML strategy, XML tools, knowledge management
> > _______________________________________________
> > This message sent by the FRPythoneers mailing list.
> > Unsubscribe: echo unsubscribe | FRPythoneers-request at lists.community.tummy.com
> > URL: http://lists.community.tummy.com/mailman/listinfo/frpythoneers
> 
> _______________________________________________
> This message sent by the FRPythoneers mailing list.
> Unsubscribe: echo unsubscribe | FRPythoneers-request at lists.community.tummy.com
> URL: http://lists.community.tummy.com/mailman/listinfo/frpythoneers

-- 
Mike Olson                                Principal Consultant
mike.olson at fourthought.com                +1 303 583 9900 x 102
Fourthought, Inc.                         http://Fourthought.com 
4735 East Walnut St,                      http://4Suite.org
Boulder, CO 80301-2537, USA
XML strategy, XML tools, knowledge management



More information about the FRPythoneers mailing list