About

Welcome to Panela, Matt Harrison's take on mostly Open Source, Linux, Python, innovation in those areas, other buzzwords and Dick Proenneke. It comes complete with the illustrations as needed. Note the opinions expressed here are merely my opinions and not the opinions of my employer.

about Matt

Calendar

««Jul 2008»»
SMTWTFS
   12345
6789101112
13141516171819
20212223242526
2728293031

My Top Tags

                                       

Mailing List

My RSS Feeds








GSOC Project for Branch Coverage reporting for Python

posted 2008.04.02 Wed

As there appears to be some interest in branch coverage and the cool testing/metrics/quality tools that can be built upon it, I've proposed a GSOC project to start the ball rolling. (I assume it will start rolling either way, but allowing someone to devote more time to it is always nice).

I put a short writeup on the Python SOC wiki page. Here's a little more info. There's only so much one can do with line coverage, but that's the best python has at the moment because the one can only trace at a line level. If tracing were enabled to happen at a condition level, then branch (and path) coverage can be reported. For people who want to go hog wild and try to do full path coverage, they can go ahead. For those who want a little more than branch coverage, there is Structured Testing. (For people who don't want to go that far, perhaps you have a bunch of tests that take a while to run, if we have path data, it would be able to tell you which tests were redundant and you could cut your testing time).

Here's my thoughts on what the project might include:

  • Update sys.settrace to enable branch coverage (or add a new function)
  • Create library to implement branch coverage using above tool
  • Create command line app using said library to implement branch tracing (aggregating subsequent runs) and dump/pickle data
  • Create command line app to load and report on data
  • (Test above)
  • Bonus stuff
  • Calculate flow graphs
  • Calculate basis paths through graphs
  • Take branch reports/basis paths and determine missing paths/tests
  • Create visualization for flow graphs/extend Ned's work
  • Create visualization for basis paths (in pygame?) that links code to flow graphs and tests to executed paths
  • Redundant test finder
  • .... cool stuff you think of

I'm willing to mentor this. If you are interested please or have suggestions please let me know. Comments? Other ideas?

tags:              

links: digg this    del.icio.us    reddit




1. Andrew Dalke left...
2008.04.02 Wed 2:07 pm

I wrote python4ply in part to try to do branch coverage via a different approach. Instead of instrumenting Python via settrace, my thought is to instrument the AST with extra instructions then generate bytecode from that tree.

See http://dalkescientific.com/Python/python4ply.html in the tutorial for an example of how I did that for simple line tracing.

I targeted compiler.ast but with Python 2.6 (SVN) you can use Python's own parsers to generate a parse tree, modify that tree, and generate executable code.