>Test Coverage Analysis and Eclipse Plugins

>I’ve been reading on and off Robert Martin’s Clean Code book. It’s a book that I highly recommend as it will make you think. You may not necessarily agree with everything, but it is a book you should have in your programming arsenal.

In the book, Uncle Bob talks about having your tests cover at least 80% of your code. However, I hadn’t found a program that would do analysis of testing coverage for eclipse plugins, that was free, integrated well with eclipse, and provided an easy view of what was being and executed by the tests and what wasn’t. That was until I found EclEmma for Eclipse. Below is a sample of a code coverage report from the VEX unit tests.

What is nice is that it will show down to the method level how much of that code has been executed by the tests. It’s a nice clean interface, and gives some valuable insight into the code. The less code that has been executed, the more likely that there are bugs hiding within that code.

Plugins exist for Eclipse 3.3 and Eclipse 3.4. The 3.4 version does also work with Eclipse 3.5 as well. It would be interesting to see others report what the analysis returned on their projects.

This entry was posted in agile, eclipse, testing. Bookmark the permalink.

3 Responses to >Test Coverage Analysis and Eclipse Plugins

  1. mstudman says:

    >Try out Atlassian Clover. It takes code coverage to a new level by providing per-test coverage, complexity tracking and helps guide you to get the most bang for buck when writing your unit tests.It’s not free but if you’re doing open-source or work for not for profit or charity organisations, we give out free licenses.

  2. >I look on EclEmma from time to time, but always see that it is useless for me. Requirement to perform “in-place Instrumentation” to run “JUnit plug-in test” (so do “clean build” later) is just nonsense. I don’t want to have such pain as full rebuild many times per day just to satisfy one tool. Why not perform “on load” instrumentation using agent?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s