[plt-scheme] Coverage statistics and testing workflow

From: Markku Rontu (markku.rontu at iki.fi)
Date: Sat May 22 11:59:16 EDT 2010

Hey,

I've been using schemeunit together with the code coverage coloring to see
what my unit test coverage is. Is there any trick to get some statistics out
of the coverage tools and not just colored source? Like I would be
interested in the number of lines of code/expressions and what kind of
coverage of them I got. Also would be interesting to see if some expressions
are covered significantly less than others. Is there some sort of an API
that I have missed?

I'm just thinking of how to maintain a good coverage and motivate TDD/BDD
better. Also ideas on how to manage the running of dozens of modules of
tests and reviewing the coverage are welcome.

My current workflow for development is approximately:
- Add a test in module xyz-test.ss
- Evaluate test module with ctrl-t and then evaluate "(test)" (I have custom
module language that provides this shortcut)
- Add code to pass the test in module xyz.ss
- Evaluate the module with ctrl-t, require xyz-test.ss, evaluate "(test)"
and check coverage
- Refactor or whatever is left ... repeat until done

Would sure be nice to be able to associate a file of tests with a file of
source code, to be able to update one or the other and finally run the tests
with minimal typing. Requiring the test module from the source module is a
bit of a complicated expression since the test and source are in different
folders altogether. I'll see how I can improve this still.

-Markku
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20100522/d41b3e93/attachment.html>

Posted on the users mailing list.