commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henri Yandell <>
Subject Re: [lang] Unit test coding conventions?
Date Tue, 09 Jul 2002 07:20:28 GMT

Am not adverse to this.

Currently I am adding new unit tests directly to StringsTest in the old
way [a method for the group, and a series of tests in the method].

I'm happy to refactor this once I get all the tests in.


On Mon, 8 Jul 2002, Stephen Colebourne wrote:

> My preferred style for unit tests for this kind of low level utility code is
> to write one test method per failure case and one test method for each
> really distinct success case (which should just be one, otherwise the method
> is doing two things and should be refactored). This results in multiple
> asserts in the success test method, but this doesn't bother me. It's going
> to work first time isn't it ;-)
> I split out some of the Strings test classes into separate classes because I
> am predicting the number of tests to get very large, and unmanageable in one
> lump. This was partly why I reordered the Strings source file. My idea was
> to create one test class for each group of methods in the Strings source
> file. (Avoids one class per method and avoids one class for all the
> methods). Please shout now if you think this is a bad plan!
> Stephen

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message