[XML-SIG] Test suite coverage

Patrick K. O'Brien pobrien@orbtech.com
Thu, 16 May 2002 12:34:59 -0500


[Andrew Kuchling]
>
> I ran the test suite and measured the coverage, using the
> code_coverage.py module that's part of Sancho.  Here are the modules
> which have less than half of their lines executed.  (This only
> measures modules that actually get imported.)  Anyone want to
> expand the test suite to exercise these modules more?

In case it might be helpful, I've got a little utility program, called
testgen, that will generate a unit test skeleton for an existing python
module. The idea is to ease the burden of creating the starting point for
coding unit tests, much of which is repetitive code, when you already have a
functioning module. The easiest way to see exactly what testgen does is to
look at the source code or run it on an existing module. By default it
creates a new module with "test_" as the prefix and puts it in a "tests"
subdirectory. By no means is it a silver bullet - you still need to flesh
out the skeleton - but it can save time.

You can get the program at:

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/orbtech/Orbtech/TestUtil/test
gen.py

It does require Optik for command line options. And there are more features
I intend to add, but the current version does work.

---
Patrick K. O'Brien
Orbtech