[plt-scheme] Coverage statistics and testing workflow

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Sat May 22 12:06:14 EDT 2010

Yes, it would definitely be better if the IDE better facilitated
separate test files and a workflow like you describe below. It is on a
(long-term, sadly) list to try to find a better way to do that.

As far as an API for test coverage, search for errortrace/stacktrace
in the docs. I think you should be able to do what you want with it
(but there is no Guide-like thing describing it, so I'm pretty sure
you'll find it opaque. If you get stuck, ask questions here!)

Robby

On Sat, May 22, 2010 at 10:59 AM, Markku Rontu <markku.rontu at iki.fi> wrote:
> 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
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
>


Posted on the users mailing list.