rcov: it is like crack for obsessive completists
rcov is a Ruby code coverage analysis tool that I’ve just been playing with for an hour or so while I look at how well my test cases are covering the code I’ve written.
You can gem install rcov
I’m working on a Rails app and there’s a handy plugin to make running rcov easy peasy:
http://svn.codahale.com/rails_rcov/
with some documentation here:
http://blog.codahale.com/2006/05/26/rails-plugin-rails_rcov/
Now I can just rake test:test:rcov to run all my tests and see what they’re covering.
Update: from playing around a bit I reckon that concentrating your coverage analysis around functional tests is probably the biggest bang for the buck. Functional tests exercise a lot of your code from both the controllers and the models.
rake test:functionals:rcov
rcov generates these amazing HTML reports telling you which code your tests exercised. More importantly it tells you which code your tests didn’t exercise so you can work out what extra tests you need to add.

How cool is that!
Now, what prompted all this was a post to the cc.rb mailing list about integrating rcov with a continuous integration build to fail the build if coverage drops below a certain acceptable threshold. Perhaps 80%? Perhaps 100% for those prone to collecting comic book series or trading cards.
There’s a rails plugin named vl_cruise_control that will help with failing a build with cruise. I’ve not tried it yet.