[FRPythoneers] Doctest

Mike Olson Mike.Olson at fourthought.com
Fri Jul 27 15:00:02 MDT 2001


Jim Vickroy wrote:
> 
> Mike Olson wrote:
> 
> >
> > Of course.  My point is, that once code has been developed, then unit
> > tests are useless.
> >
> 
> That may  be true but only if that code will NEVER be changed in any manner.  Unit tests
> are a useful aid in demonstrating that a code update has not broken things that worked
> prior to the update.

I don't see how it can.  It can verify that for a set of input cases,
this piece of code returns the proper output cases.  I generally work
where the expected input set is infinite.  How can a finte set of test
cases verify that a change to this piece of code will not effect the
rest of the system?




> 
> You probably have heard the drill ...
> 
> Find an error in a module.  Update the unit test, for this module, to detect the error.
> Fix the error.  Run ALL of your unit tests for ALL of your modules.  If none of the tests
> fail for any of the modules, then, at least to the extent your unit tests reflect desired
> behavior, you have broken nothing.  If tests fail, fix the broken modules and run all
> tests again.  Repeat, until all test succeed.
> 
> The fact that bugs are discovered independent of your unit tests says nothing about the
> usefulness of unit testing only about the quality of your unit tests which, themselves,
> improve over time as they are updated to catch bugs they previously missed.
> 
> Unit tests demonstrate (for their coverage domain) what parts of a system do (and do not)
> work as expected.   That absolutely is of value to me.

I still disagree and think you are getting less value then you think
from your unit tests.  However, as Uche says in a follow on message. 
this is a religion.....


Mike


> 
> >
> > >
> > > >  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
> > _______________________________________________
> > 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