Monday, November 30, 2009

more python testing tools

pester looks like something i should try. it uses mutation testing to test your tests, by seeing if there are changes to the code that still pass all tests. unfortunately, it hasn't been updated since 2002, even though jester (the java version) is more recent. mutation testing is sorta related to fuzz testing, which feeds your code modified data until it chokes. fusil and peachfuzzer both look very feature-rich but complicated. peachfuzzer has a gag-me xml interface and fusil provides libs for writing python scripts that test cli programs. svnmock might be a good tool to use if i write code that uses the svn python hooks. (been thinking about making my repository mail itself somewhere as a backup with each commit.) also hasn't been updated in a while, though -- 2006 in this case. pythoscope is a good tool to use if i ever start using unittest instead of just doctests. it will examine your code to build the start of a test file that you can fill in, almost as easily as a doctest. and it's been recently updated. some day i should put a source checker like pylint or pychecker into my stream. maybe catch some problems before they start. clonedigger has more powerful tools than pylint for detecting duplication, for refactoring hints. Link pytest is a test runner rumored to be buried in logilab-common. sounds similar to the script i wrote to run my doctests and do a little coverage analysis. complexity analizes cyclomatic complexity of python code, though it's written in perl and it doesn't seem to be actively developed. Link pymetrics does cyclomatic complexity as well as loc and other metrics. written in python and looks pretty active. worth a try, i think. pysizer does some interesting memory profiling, but i seems to be a little too alpha right now (only built-in types supported; usually these are the least of my memory troubles.) still, some nice features are already there to help trace where objects came from, who's using them, and plotting dep graphs. if only it could handle non built-in instances, this would be great. Link guppy-pe is a combination of python dev tools. heapy is a memory profiler, and it seems to do basically the same thing as pysizer but is not limited to built-ins. gsl is a specification language, which i think i can skip as another example of how to javaify python. EDIT: hmm, i can't seem to get heapy to account for numpy arrays, although these people apparently did. sys.getsizeof() definitely does not. grrr.

No comments: