用于代码覆盖的 Eclipse 插件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9046171/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Eclipse plugin for code coverage
提问by Kiva
I search a code coverage plugin for eclipse. My question is simple:
我搜索了 Eclipse 的代码覆盖率插件。我的问题很简单:
Which plugin do you use with eclipse for code coverage and why ?
您在 eclipse 中使用哪个插件来实现代码覆盖率,为什么?
回答by ziesemer
Edit (2015)- My current recommendation: EclEmma/ JaCoCo.
编辑 (2015)- 我目前的推荐:EclEmma/ JaCoCo。
Not sure why I didn't see this back in January 2012, as there was clearly active development with new versions consistently being reproduced even back then.
不知道为什么我在 2012 年 1 月没有看到这一点,因为即使在那个时候,新版本的开发也很明显。
I've since become a bit frustrated with Cobertura / eCobertura, as development since seems to have stalled, with support for current Java versions starting to be somewhat lacking.
从那以后,我对 Cobertura / eCobertura 感到有些沮丧,因为自那以后的开发似乎已经停滞,对当前 Java 版本的支持开始有些缺乏。
JaCoCo may have advanced since I last looked at this in 2012 (or I simply missed it entirely, or was looking at EMMA vs. JaCoCo) - but the current version provides excellent support built-in to Eclipse (provided by EclEmma) as well as many other IDEs, support for Apache Maven, Apache Ant, command-line, Java API, and many other third-party integrations. Please refer to the complete list at http://www.eclemma.org/jacoco/trunk/doc/integrations.html.
JaCoCo 可能自 2012 年我上次看到它以来已经有了进步(或者我只是完全错过了它,或者正在查看 EMMA 与 JaCoCo) - 但当前版本提供了 Eclipse(由 EclEmma 提供)内置的出色支持以及许多其他 IDE,支持 Apache Maven、Apache Ant、命令行、Java API 和许多其他第三方集成。请参阅http://www.eclemma.org/jacoco/trunk/doc/integrations.html上的完整列表。
I am now switching some of my projects over to JaCoCo from Cobertura, and am very impressed by the integration and results - both in Maven reports as well as Eclipse. Not sure about competing solutions, but JaCoCo can even be configured to fail a build if certain thresholds of code coverage are not met.
我现在正在将我的一些项目从 Cobertura 切换到 JaCoCo,并且对集成和结果印象非常深刻 - 无论是在 Maven 报告还是 Eclipse 中。不确定竞争解决方案,但如果不满足某些代码覆盖率阈值,JaCoCo 甚至可以配置为使构建失败。
JaCoCo is specifically documented to support Java class files from version 1.0 all the way through 1.8*.
JaCoCo 专门记录为支持从 1.0 版一直到 1.8 *版的 Java 类文件。
I find their Mission Statementvery respect-worthy.
我发现他们的使命宣言非常值得尊重。
References / Resources:
参考资料/资源:
Especially as this question has unfortunately been closed, here is a mini-directory of some of the various references and resources that I used in making my decision - and which I encourage everyone here to refer to in order to make their own decisions.
特别是因为这个问题已经很不幸地被关闭了,这里是我在做出决定时使用的一些各种参考资料和资源的小目录 - 我鼓励这里的每个人参考以做出自己的决定。
- https://en.wikipedia.org/wiki/Java_Code_Coverage_Tools- by Wikipedia's nature is more of a "living document", and will hopefully remain updated with any new related tools that may become available.
- The following should also somewhat fall into the same category of a "living document", but fall under probable bias / conflicts of interest - as each is from the vendor or organization that also produces such a tool:
- http://www.eclemma.org/resources.html(Provides EclEmma, JaCoCo)
- https://confluence.atlassian.com/display/CLOVER/Comparison+of+code+coverage+tools(Provides Atlassian Clover)
- Presumably independent but dated reviews and comparisons:
- Code Coverage Tools (JaCoCo, Cobertura, Emma) Comparison in Sonar(2012-12-19, Patroklos Papapetrou, onlysoftware.wordpress.com)
- Eclipse plugin for code coverage(2012-01-28, stackoverflow.com)
- Test coverage: jaCoCo vs Clover2(Jakub Kurlenda, 2010-12-28, kurlenda.blogspot.com)
- Java Code Coverage: Cobertura vs. Emma vs Clover(Tom Borthwick, 2010-10-23, copperykeenclaws.com)
- Pick your code coverage tool in Sonar 2.2(2010-08-05, Evgeny Mandrikov, sonarqube.org)
- In pursuit of code quality: Don't be fooled by the coverage report(Andrew Glover, 2006-01-31, ibm.com)
- https://en.wikipedia.org/wiki/Java_Code_Coverage_Tools- 维基百科的性质更像是一个“活文档”,并且希望随着任何可能可用的新相关工具保持更新。
- 以下内容也应该属于“动态文档”的同一类别,但属于可能的偏见/利益冲突 - 因为每个都来自也生产此类工具的供应商或组织:
- http://www.eclemma.org/resources.html(提供 EclEmma、JaCoCo)
- https://confluence.atlassian.com/display/CLOVER/Comparison+of+code+coverage+tools(提供 Atlassian Clover)
- 大概是独立但过时的评论和比较:
- 声纳中的代码覆盖工具(JaCoCo、Cobertura、Emma)比较(2012-12-19,Patroklos Papapetrou,onlysoftware.wordpress.com)
- 用于代码覆盖的 Eclipse 插件(2012-01-28,stackoverflow.com)
- 测试覆盖范围:jaCoCo 与 Clover2(Jakub Kurlenda,2010-12-28,kurlenda.blogspot.com)
- Java 代码覆盖率:Cobertura 与 Emma 与 Clover(Tom Borthwick,2010-10-23,copperykeenclaws.com)
- 在 Sonar 2.2(2010-08-05, Evgeny Mandrikov, sonarqube.org) 中选择你的代码覆盖率工具
- 追求代码质量:不要被覆盖率报告所迷惑(Andrew Glover,2006-01-31,ibm.com)
Previous:
上一篇:
It does the job, it is free and open-source, it is more up-to-date than EMMA, and it is used by most of the other online open-source projects I'm familiar with. It also integrates very well into Maven - including some rather nice-looking reports.
它完成了这项工作,它是免费和开源的,它比EMMA 更新,并且我熟悉的大多数其他在线开源项目都使用它。它还可以很好地集成到 Maven 中——包括一些相当漂亮的报告。
If you want to consider a commercial product, I'd consider Atlassian's Clover.
如果您想考虑商业产品,我会考虑 Atlassian 的Clover。
回答by Kane
I like http://codecover.org/
The source highlighting is better than eCobertura, the drill-down is easy to read, selecting test cases is easy, it actually provides statistics for statement, branch, loop and condition coverage ( a lot of plugins only do statement, which is kinda useless ).
源码高亮比eCobertura好,下钻易读,选择测试用例容易,实际上提供了语句、分支、循环和条件覆盖的统计(很多插件只做语句,有点没用) .
We use it at our business and we found it the best plugin by far.
我们在我们的业务中使用它,我们发现它是迄今为止最好的插件。
回答by ka3ak
Coverlipse: http://coverlipse.sourceforge.net/because it's free
Coverlipse:http://coverlipse.sourceforge.net/ 因为它是免费的