python中的条件覆盖率 [英] condition coverage in python

查看:88
本文介绍了python中的条件覆盖率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何工具/库可以计算python代码条件/决定覆盖率的百分比。我只找到coverage.py,但是它只计算声明覆盖率的百分比。

Is there any tool/library that calculate percent of "condition/decision coverage" of python code. I found only coverage.py but it calculates only percent of "statement coverage".

推荐答案

Coverage.py现在包括分支机构覆盖范围

出于好奇:在运行之前未修改代码。跟踪函数跟踪执行中的哪一行,并将该信息与对编译后的字节码的静态分析进行比较,以查找未执行的路径可能性。

For the curious: the code is not modified before running. The trace function tracks which lines follow which in the execution, and compare that information with static analysis of the compiled byte code to find path possibilities not executed.

这篇关于python中的条件覆盖率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆