[Biopython-dev] coverage of function testing

Peter biopython at maubp.freeserve.co.uk
Fri Nov 14 20:29:16 UTC 2008


On Fri, Nov 14, 2008 at 7:48 PM, Marshall Hampton <mhampton at d.umn.edu> wrote:
> Hi,
>
> I noticed some discussion of the coverage and automation of testing for
> functions in biopython, and thought I would suggest folks check out the
> testing and coverage tools in Sage (www.sagemath.org).  Testing of functions
> in Sage is done by testing examples in their docstrings - there are comments
> to opt out of testing or to indicate if they will take a long time.  They
> also have scripts for checking which functions have at least one such
> testable example.  So you can do something like this:
>
> sage -coverage PATH_TO_SAGE/sage/geometry/polyhedra.py
>
> and get
>
> SCORE
> /Volumes/D/sage-3.2.alpha0/devel/sage-main/sage/geometry/polyhedra.py:
> 100% (21 of 21)
>
> to see if anything is untested.

That may be worth a go, but there are two sides to this:
(1) Making a list of the code that needs testing (pretty much the same
for any python library)
(2) Working out what is already tested (and here, that means going
over Biopython's test framework which is based on unit test, but also
includes some use of doctests).  This is probably trickier...

> Now that biopython is converting to numpy, I will start arguing for its
> inclusion as a standard part of Sage (right now it is an optional package).

That sounds good - but I have no knowledge of the Sage system and how
they divide things up.

Peter



More information about the Biopython-dev mailing list