Ok so I’ve been dealing with an old app for the last two weeks. It is woefully out of date (several libraries are behind - not the least of which being rails). And it looks like at some point I threw discipline out the window and added some stuff without writing tests (before or after adding in the code).
On top of all of that, I’m back in the guts of it because I need to add a pretty major new feature - and the state of the code has me running for the hills.
I got all the tests to pass last week - but doing some coverage analysis I found that there are big sections of the code that are not tested at all. (Yes I know 100% coverage doesn’t mean 100% bug free - but it will generally alert you to the obvious bugs).
In the process, I was trying to get Rcov to sort some of the results for me so I can focus on the worst offenders. In the process of figuring out how to do that I stumbled on Metric Fu.
Metric_fu is a set of rake tasks that make it easy to generate metrics reports. It uses Saikuro, Flog, Rcov, and Rails built-in stats task to create a series of reports. It’s designed to integrate easily with CruiseControl.rb by placing files in the Custom Build Artifacts folder.
It’s really cool - basically it not only made it seriously easy to sort out the coverage stuff and works well with Rspec. It also showed me some new tools for finding other code smells. It alerted me to a particularly nasty controller method that is apparently doing a hell of a lot more than a controller method should do.
The coolest part of this is that not only is it a neat tool - but I actually know this guy. We worked together on a project a year and a half a ago. Small world I guess.
Leave a Reply
Moderation Active: Old stuff here... Therefore your comment on this post will be moderated (i.e. don't submit twice !)