How to check code coverage with tests for methods

2020-04-03 06:58发布

I want to be able to check test coverage of those of my methods that have complexity above some given level.
Are there any plugins for Eclipse, Sonar, Hudson for that?

Thanks!

5条回答
Anthone
2楼-- · 2020-04-03 07:27

I've found simpler solution. I can use a filter in SONAR http://docs.codehaus.org/display/SONAR/Filters where given metric can be used.

查看更多
你好瞎i
3楼-- · 2020-04-03 07:29

For good code coverage you should check out this tool. It's availiable for Eclipse.

Emma Code Coverage

查看更多
【Aperson】
4楼-- · 2020-04-03 07:32

Emma code coverage can also be used via ant for code coverage automation.

查看更多
一纸荒年 Trace。
5楼-- · 2020-04-03 07:35

As already mentioned Cobertura is a tool for measuring code coverage. It also measures complexity (see the example report). So you could try to transform the xml output of it that it only shows coverage of methods that exceed a given complexity threshold.

查看更多
beautiful°
6楼-- · 2020-04-03 07:50

http://eclipse-metrics.sourceforge.net/

The Eclipse Metrics plugin to measure complexity

查看更多
登录 后发表回答