cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew C. Oliver" <>
Subject Re: Getting test cases written
Date Sat, 18 May 2002 15:18:27 GMT

1. - unit test report for POI
2. - some
unit tests

(see root src/testcases for more)

I started out very skeptical that it was worth the effort, but as our
structures changed code that had unit tests never made it into CVS
broken, code that didn't well took sometimes days to track down.

We've gone a step further and started generating some code from XML
descriptors including unit test data:

We can now generate the low level record types along with their test
case using real world data.  This descriptor method mostly just saves us
typing (and boredome) but also ensures we do things the same way every
time.  For another part of the project we're doing the same thing but
subclassing the "Type" for adding specific logic (and I assume we're
doing the same for the test case).

In conclusion The biggest advantage of unit testing is in preventing
those multiday bugs that creep up in dependencies.  Further advantages
can be reached through autogeneration of simple types  and their test
cases.  Over time this has proven itself at least on POI to be the most
invaluable thing we do.  (the second is whine at people if they don't
document ;-) )


On Sat, 2002-05-18 at 11:16, Ross Gardler wrote:
> David Crossley wrote:
> > Is "unit testing" different to "functional testing", or are they
> > complementary?
> They are indeed complimentary. In a nutshell, unit tests ensure that the 
> indiviviual methods within individual classes behave as expected. 
> Funtional tests ensure that the system as a whole behaves as expected. 
> In other words, unit tests operate on classes (in many cases individual 
> methods), functional tests will emulate a user actually using the system 
> as a whole so operate on combinations of classes.
> > Here are a few relevant Anteater threads ...
>  >
>  >
>  >
> Thanks, I will look into Anteater (took a brief look the other day, 
> looks like good stuff).
> > 
> > You mention something above that could be key ... if only
> > unit tests were interesting. I wonder if Cocoon could help
> > itself here. If the results of running the test suite were generated
> > as xml, we could have a Sample that demonstrates how happy
> > Cocoon is with its current state.
> JUnit (the most popular unit testing tool, does 
> indeed export its results in XML format. There are also lots of tools 
> that will show how much code is covered by the tests. It would certainly 
> be possible to create some nice reports showing how well the code is 
> tested.
> > The developers would like to
> > be sure that their favourite classes were behaving well.
> So what do other developers think of this. Is it worth the effort? Will 
> you take responsability for improving the test coverage of your code if 
> given suchg reports?
> Ross
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, email:
-- - software solutions for business - Excel/Word/OLE 2 Compound Document in
Java                    - the best build/project
		    a guy/gal could have! - Make Ant simple on complex Projects!
The avalanche has already started. It is too late for the pebbles to
-Ambassador Kosh

To unsubscribe, e-mail:
For additional commands, email:

View raw message