开发者

unit testing - per test code coverage for java

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 covera开发者_Python百科ge 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).


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....


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜