开发者

cobertura in eclipse

I just installed ecobertura plugin, but it looks like not a very user-friendly tool from within eclipse. is there any good plugin for cobertura in eclipse or article to describe how to use ecobertura?

I'm used to seeing code complexity and coverge etc in a very nice way.

I need to use cobertura, because the build system in the back-end uses it, so it makes sens to use it in the IDE as w开发者_开发问答ell.

Regards


I was looking for a tutorial for our team members to start using eCobertura and came across here. I end up writing one myself. Posting back here hope it may help others looking for a jump start.

http://kennethxu.blogspot.com/2012/01/cobertura-and-eclipse-ecobertura.html


From the sources:

  • there should be launch configuration's "filters" tab, for you to define what class to filter and analyze: see changeset 2ecbb202e8c5
  • there is no instances of "cyclomatic complexity" anywhere in the code.

But you still can fork the code base (like mileszk did) and add any feature you want (and contribute back to the main project of course ;) )


I am using Eclipse Luna and I had difficulty installing the ecobertura plugin. So I installed EclEmma plugin and it was intitutive to use it. After installing the plugin, restart the eclipse IDE.

To find the coverage of the test cases you have written, all you have to do is

Right click on the desired package or even the whole project > Coverage As > Junit Test

The Coverage View automatically appears. Or you can open the coverage view from Window > Show View > Other > Java > Coverage. Or you can just type "Coverage" in the Quick Access search box in the eclipse.

The Coverage view is capable of displaying the coverage percentage at project level, source folder level, package level, Class level and even at method level.

cobertura in eclipse

You can change the root level of the entries shown in the coverage tree by using the toolbar in the coverage view.

cobertura in eclipse

cobertura in eclipse

You can change the coverage parameters to method or Line or instruction or brach based on your requirement.

cobertura in eclipse

And finally you can export the test coverage results to HTML or XML or CSV formats by right-clicking anywhere inside the coverage view and selecting Export session.

cobertura in eclipse

cobertura in eclipse

cobertura in eclipse

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜