How to check code coverage with tests for methods with specified level of complexity in Java

你离开我真会死。 提交于 2019-12-19 15:06:32

问题


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!


回答1:


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.




回答2:


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

Emma Code Coverage




回答3:


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

The Eclipse Metrics plugin to measure complexity




回答4:


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.




回答5:


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



来源:https://stackoverflow.com/questions/13399514/how-to-check-code-coverage-with-tests-for-methods-with-specified-level-of-comple

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