Zooko zooko at
Thu Jan 3 17:53:56 CET 2002

Greetings Pythonismos, Pythonismas, Gareth Rees, and Andrew Dalke:

I learned from Python-URL [1] that Gareth Rees [2] has published a code coverage 
tool called [3].

On the web pages, Gareth compares favorably against, but 
he appears to be using an old version of [4] from 1999 that is still 
sitting around on Andrew Dalke's FTP site.  Python comes with a newer version of [5] which has been modified by Skip Montanaro and then by me [6].

Here are the differences that I see right now between current and

1. can do tracing as well as code coverage.  It can do either or both,
    and also has a "listfuncs" mode which just tracks which functions are 
    invoked at least once.

2. actually parses so as to annotate lines correctly, where
    just ignores blank lines and comments.

3. is much faster.  In my tests, takes less than 
    2 seconds where takes 30 seconds.

4.  The usage interfaces are very different.  Not sure which, if either, is 

5. only keeps a binary measure of whether each line was invoked or 
    not, where counts how many times each line was invoked.

6. has a nice summary output that looks like this:

$ -r -m
Name    Stmts   Exec  Cover  Missing
foo        64     56    87%  23, 57, 85, 119, 125, 133, 137, 152
bar       105     90    86%  78-86, 237-246
TOTAL     169    146    86%

Here are my ideas:

1.  Andrew Dalke removes that old version of from his FTP site!

2.  We consider merging the best features of these two tools and replacing the 
    standard distribution's with the new merged tool.

2.b. Who's this "we"?  Well, I understand the code already, so my 
    inclination would be to steal the "real parsing" feature from 
    and add it to, and to try to optimize  (By profiling it, 
    I suppose.  ;-))



Security and Distributed Systems Engineering

[6] [7]
[7] These footnotes are getting a little out of hand.  Footnote footnote!

More information about the Python-list mailing list