[Bioperl-l] Re: Test writing

Gabriel Valiente valiente at lsi.upc.edu
Wed Dec 28 07:27:13 EST 2005

Sorry about the delay, I've promised to write test files for 
Bio::Tree::Draw::Cladogram and Bio::Tree::Compatible much earlier.

I've just submitted t/Compatible.t, a test file for 
Bio::Tree::Compatible. There are five simple tests, two of which are 
commented out because they need an equality test for Bio::Tree::Tree 
objects, which is missing. Any volunteer for writing a tree equality 
test? Jason?

Regarding the test file for Bio::Tree::Draw::Cladogram, I just don't 
know what to include in the test. The only thing this module does is to 
produce a EPS file, and the only thing that comes to my mind is to test 
equality of a precomputed EPS file and one produced on the fly for the 
same input tree. Any suggestions are welcome.

By the way, can anybody briefly explain why is it necessary to include 
prefixes like

my $common = $t1->Bio::Tree::Compatible::common_labels($t2);

in t/Compatible.t, which already uses Bio::Tree::Compatible, instead of just

my $common = $t1->common_labels($t2);



Gabriel Valiente

>This message is for module authors and for anyone looking for something to do 
>for BioPerl. 
>I've modified the 'maintenance/modules.pl --untested' code so that it reads in 
>all test files, extracts 'use'd or 'required' Bio classes, now *recursively* 
>marks all super classes and 'use'd classes as tested. In addition, I manually 
>ignore all Bio::Search and Bio::SearchIO classes. That is because although 
>there are extensive tests for modules in these name spaces, new classes are 
>instantiated based on attributes to the constructor. This might be true to 
>other classes, too. If this is the case, I can see two possible actions: 
>1. Add them to the list of ignored class names at the end of function 
>'untested' in the script. 
>2. If the classes are never called directly, rename them to start with lower 
>case letter which by convention means that they are "component classes" like 
>All other classes should have tests written for them or - ultimately - removed 
>from the repository. 
>The aim of this exercise is to come up with a first pass list of BioPerl 
>classes that do not have any tests written for them and get them written. The 
>next pass will be to find untested methods within classes. 
>When writing tests, please follow conventions in existing files and remember 
>to test all public methods. If you do not have a cvs login, post the new 
>tests to bugzilla.bioperl.org, not to the list. We are more than happy to 
>give cvs access to anyone committing more than a couple new tests. 
>       -Heikki
>List of BioPerl classes needing tests:
>FeatureStore  # in Bio::DB::GFF::Adaptor::berkeleydb.pm
>interpro   # class defined in Bio::SeqIO::interpro, mistake?

More information about the Bioperl-l mailing list