Code Coverage while you work: EclEmma
Published November 23, 2006 by John
I like pleasant surprises. In the world of software tools, those are when I come across something that I thought didn’t exist, or wouldn’t exist for the forseeable future. For code coverage tools, I’ve been using Emma for a few years, and stopped checking for Eclipse plugins long ago, but now one has magically appeared: EclEmma.
It seems to have been flying under the radar, since it has surprised others too, but then again perhaps the developer simply wants to grow it slowly. Then again, it’s only been out to the general public for about a month, so I should just cool my heels and appreciate that it’s here.
What makes it really compelling is that even though it’s version number is a very conservative 0.1.7, it’s robust enough to do its basic work right out of the box. I unzipped it to my plugins directory, did it’s minimal configuration, ran my set of JUnit 4 tests and wham, coverage information at whever level I want to look at it: class, method, block or statement. That is cool. I’ve written Ant scripts to drive Emma in offline builds, and EclEmma does a great job of hiding the Emma setup complexity from you.
Between this plugin for daily work and the Emma Ant tasks for team feedback, this gives Clover a run for its money. If nothing else, it lowers the barrier to entry for coverage feedback for any team.
As for the other coverage tools of note, Cobertura does have nice output, but the documentation is thinner than Emma’s and it has no IDE plugins. I’ve also heard of Coverlipse, which on the flip side is only an Eclipse plugin with no means of running it from an independent build. I’d prefer to use the same tool for team and individual feedback. I have to say, though, that one treat that makes Cobertura look enticing is the cobertura-check Ant task that lets you set coverage thresholds. I’m not usually one for wanting to put too many trip-wires into a build, but if you want an early-warning system for test slippage, this could be a slick way to do it.
Filed under Tools
Posts