python代码覆盖测试
Code coverage应该是使用TDD(测试驱动开发)团队的必备管理和分析工具,可以用来检测测试代码的代码覆盖率。
代码覆盖率主要包括:
Statement Coverage - Has each line of the source code been executed and tested?
Condition Coverage - Has each evaluation point (such as a true/false decision) been executed and tested?
Path Coverage - Has every possible route through a given part of the code been executed and tested?
Entry/Exit Coverage - Has every possible call and return of the function been executed and tested?
在python中使用代码覆盖测试,下载coverage.py 并且拷贝到python库中。
具体文档在http://garethrees.org/2001/12/04/python-coverage/
coverage.py有点老了,毕竟是2001年的东西。这里有个一整套python测试工具apycot,当然这套软件不只是限制于进行python的测试。
这里有几个玩意for java,可以拿来耍宝~
- EMMA支持maven,ant,报表格式好像简单了点
- Cobertura,好像功能比较强,报表也好看一点,需要第三方插件支持maven,参见Maven Cobertura Plug-in
一个Eclipse的Code coverage插件。
关于如何使用Cobertura的中文文章。

Comments
还没有评论。
发表评论