我搜索了 Eclipse 的代码覆盖率插件.我的问题很简单:
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 ?
编辑 (2015) - 我目前的建议:EclEmma/JaCoCo.
Edit (2015) - My current recommendation: EclEmma / JaCoCo.
不知道为什么我在 2012 年 1 月没有看到这一点,因为当时显然正在积极开发新版本,甚至在那时也一直在复制.
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.
从那以后,我对 Cobertura/eCobertura 感到有些沮丧,因为此后的开发似乎停滞不前,对当前 Java 版本的支持开始有所缺乏.
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.
JaCoCo 可能自 2012 年我上次看到它以来已经取得了进步(或者我完全错过了它,或者正在研究 EMMA 与 JaCoCo) - 但当前版本为 Eclipse 提供了出色的内置支持(由 EclEmma 提供)以及许多其他 IDE,支持 Apache Maven、Apache Ant、命令行、Java API 和许多其他第三方集成.请参阅 http://www.eclemma.org/jacoco 的完整列表/trunk/doc/integrations.html .
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 .
我现在正在将我的一些项目从 Cobertura 切换到 JaCoCo,并且对集成和结果印象深刻 - 无论是在 Maven 报告中还是在 Eclipse 中.不确定是否有竞争解决方案,但 JaCoCo 甚至可以配置为在未满足某些代码覆盖率阈值时使构建失败.
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.
JaCoCo 专门记录了从 1.0 版到 1.8 版的 Java 类文件*.
JaCoCo is specifically documented to support Java class files from version 1.0 all the way through 1.8*.
我发现他们的使命宣言非常值得尊重.
I find their Mission Statement very respect-worthy.
参考/资源:
尤其不幸的是,这个问题已被关闭,这里有一个迷你目录,其中包含我在做出决定时使用的一些各种参考资料和资源 - 我鼓励这里的每个人都参考这些资料,以便做出自己的决定.
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.
上一个:
eCobertura.
它可以胜任,它是免费和开源的,它比 EMMA,它被我熟悉的大多数其他在线开源项目所使用.它还可以很好地集成到 Maven 中 - 包括一些相当漂亮的报告.
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.
如果您想考虑商业产品,我会考虑 Atlassian 的 Clover.
If you want to consider a commercial product, I'd consider Atlassian's Clover.
这篇关于用于代码覆盖的 Eclipse 插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!