views:

75

answers:

3

We use use junit for unit testing our java code. Today we use cobertura to get coverage numbers. It does not have an easy way of getting per test coverage number. Is there a tool to get per test code coverage - commercial/free?

(cobertura has a patch to get per test coverage numbers, out of date with latest cobertura).

+1  A: 

Emma provides detailed reports by overall/package/class for block and line coverage.

Jeanne Boyarsky
as does Cobertura
matt b
A: 

we used clover to good effect. we wrote some ant tasks that allowed us to run it from a dev box, so we could view the coverage numbers locally, and we also integrated it into our continuos integration so we had a site for the official number.

http://www.atlassian.com/software/clover/

the only issue we had was it is a memory hog....

hvgotcodes
Thank you all. It would take a while before I try this. I hope accepting the answer is an OK step :)
Jayan
A: 

The obvious way to do this is, run one test and dump the test coverage data. (In fact, this is the only way to do this).

Our SD Java Test Coverage Tool has explicit DumpVectors and ResetVectors procedures that can be called anytime. By adjusting the unit test framework to just call these two procedures between tests, you can get one test coverage vector per unit test.

The display tool will display any individual test coverage vector. It can also give you the union of the entire set (as if you had run all the tests) or compute how one test overlaps with another.

Ira Baxter