开发者

jUnit: How to determine level of code coverage?

How can i determine what percentage of my methods (and code) are covered开发者_JAVA百科 by jUnit tests? I am assuming there is a more sophisticated way then simply counting ... and 1 and 2 and ..

I specifically wonder how will such counting be handled when single method is covered by 'n' tests.


I've used EclEmma very successfully to cover JUnit test runs. And its free.


This presentation points to several tools you can use for the purpose.

  • Cenqua Clover $250-$2500 payware http://www.cenqua.com/clover/

  • Cobertura (GPL): http://cobertura.sourceforge.net/

  • Coverlipse Eclipse plug-in: http://coverlipse.sourceforge.net/index.php

  • Jester: http://jester.sourceforge.net/


I would suggest to go for Cobertura for code coverage. It gives detailed information and can give you line by line coverage as well as branch coverage.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜