[Biojava-l] Unit tests

Simon Brocklehurst simon.brocklehurst@CambridgeAntibody.com
Wed, 09 May 2001 17:23:44 +0100


Keith James wrote:

> Hi all,
>
> I'm keen to set up unit tests for the core classes. A few bugs
> surfaced at the bootcamp which we should have been aware of some time
> ago (and I'm guilty of leaving a bug in the EMBL-like Location parser,
> which I've just fixed).
>
> Some ideas:
>
> * Using JUnit will integrate with Ant
>
> * Have a classloader which will find new tests by itself, so the suite
>   will not need updating with each additional test
>
> * A naming convention for test classes
>
> Regarding adding new compile/build tasks to Ant, should the tests go
> in the main source tree (e.g. src/org/biojava/test/*) or in a parallel
> one? (e.g. test/org/biojava/test/*).
>
> Similarly, in the ant-build directory should the source/classes be
> copied by Ant into
>
> ant-build/src/main/org...
> ant-build/src/test/org...
>
> or perhaps
>
> ant-build/src/org...
> ant-build/test/org...
>
> Comments/ideas please.

My two cents...

o JUnit - excellent, I think using this would be a positive step

o Location of test classes - they need to be inside packages so that you can
write tests for package-private classes

o Naming convention - keep it simple - I would have an AllTests class inside
each package, and leave it developers to add test suites from multiple test
classes to the AllTests class.

S.
--
Simon M. Brocklehurst, Ph.D.
Head of Bioinformatics & Advanced IS
Cambridge Antibody Technology
The Science Park, Melbourn, Cambridgeshire, UK
http://www.CambridgeAntibody.com/
mailto:simon.brocklehurst@CambridgeAntibody.com