[Bioperl-l] Test related Suggestions

Sendu Bala bix at sendu.me.uk
Thu Jul 5 13:44:08 UTC 2007


Heikki Lehvaslaiho wrote:
> One more suggestion:
> 
> It would be extemaly useful if we had a standard way of testing that
> a when a file is read into a bioperl object and then written out
> again into a same format, the input and output files are identical.

As Hilmar has pointed out in the past, Bioperl doesn't aim for the files 
to be identical, only for none of the information to be lost and to be 
ouput in the correct format.

So a round-trip test should read in the original, store all the parsed 
data, write it out, then read in the written version and see if the new 
parsed data matches the original.


For simpler or ultra-strict file formats, though...

> If not, the test should show where the the differences start (showing
> all the differences would just clutter the screen).
> 
> This standard method/subroutine should be used to test all sequence
> and other text file IO.
> 
> Any takers?

There's already something along these lines in t/SeqIO.t (the section
that uses Algorithm::Diff).

I copied that over from the old testformats.pl script but haven't really
taken the time to see if its a good way of doing the test.

Is it? Can someone come up with something better? Can someone generalise
it if necessary?

I imagine you could just read the files into arrays and use 
Test::More::is_deeply(). If that would be satisfactory I could easily 
add a little method to BioperlTest that did that.




More information about the Bioperl-l mailing list