Code Coverage in Java

Code coverage provides information on how much of your application is executed. It is a good way to find dead code in your project (ie code that is never executed). I have been using code coverage for my unit testing. The code coverage will tell me how much of my application is covered by the unit tests. You can find more general information on code coverage here.

A popular code coverage tool is Emma. It is an open-source code project that has been around for a while. The website has documentation on how to run Emma from your Ant file.

I also found two really great sites to get started with code coverage in your favorite IDE.

Finally just for kicks, Albert Savoia (formerly of Sun) has a great article on code coverage. The article is written in an offbeat style, using a martial arts master / apprentice dialogue. Very funny read 🙂

Ok, that’s it from me. Make sure your code is covered. Enjoy.

Did you like my blog post?

Signup now and receive an email when I publish new luv2code content.

I agree to have my personal information transfered to AWeber ( more information )

I will never give away, trade or sell your email address. You can unsubscribe at any time.

Leave a Reply