Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Ant, Maven and Other Build Tools and the fly likes Code Coverage Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Code Coverage" Watch "Code Coverage" New topic

Code Coverage

Leo Aug

Joined: Sep 02, 2012
Posts: 7
1) Code coverage is only for Junit or is it like pmd tool which checks for coding errors?

I have three java files

Main Java FIles:

Junit :

And I have two junit test java files

SHould I run cobertura(tool) on the Junit files or on the Main files ?

What would be the main purpose of Code Coverage?

How does the Code coverage act on the above case and what would be the expected output ?

Peter Johnson

Joined: May 14, 2008
Posts: 5852

The main purpose of code coverage it to see how much of the code in your app is exercised by your unit tests. Thus you want cobertura to give you coverage details for the main java classes, so instrument them.

JBoss In Action
Leo Aug

Joined: Sep 02, 2012
Posts: 7
Thank you....
I agree. Here's the link:
subject: Code Coverage
It's not a secret anymore!