Code coverage tools in Java [closed]

爷,独闯天下 提交于 2019-12-17 23:25:38

问题


Are there any such code coverage tools in Java that give the different paths in the program. Basically the idea is to ensure that all loops and nested loops are covered during execution. That is to be able to ascertain if all the loops in a code base have been executed at least through one iteration.


回答1:


Cobertura, EMMA and even Clover only do branch/decision coverage (in addition to line/statement coverage, of course). Clover also provides method coverage (which simply measures if a method was entered at all during execution).

For path coverage (plus line/statement coverage), try JMockit Coverage.

A sample report can be found here.

Actually, as of now this is only an initial version of the new path coverage support, which I still need to improve.




回答2:


Cobertura is another popularly used tool.




回答3:


Try EMMA It's free. It is supported in eclipse and JetBrains IDEA support and also TeamCity build server.




回答4:


Clover is a good tool.




回答5:


I'd go with JaCoCo It's an open source tool (replacement for EMMA) distributed under Eclipse's public license.

Ref (05:05, 17 July 2013‎): http://en.wikipedia.org/wiki/Java_Code_Coverage_Tools



来源:https://stackoverflow.com/questions/1518362/code-coverage-tools-in-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!