声纳中的代码覆盖率和行覆盖率有什么区别 [英] What is the difference between code coverage and line coverage in sonar

查看:15
本文介绍了声纳中的代码覆盖率和行覆盖率有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道行覆盖和分支覆盖有什么区别,但是代码覆盖和行覆盖有什么区别?是以前的指令覆盖吗?

I know what the difference is between line and branch coverage, but what is the difference between code coverage and line coverage? Is the former instruction coverage?

推荐答案

Coverage 是一个微妙的 ;-) 线和分支覆盖率的混合.

Coverage is a subtle ;-) mix of the line and the branch coverage.

您可以在我们的指标描述页面上找到公式:

You can find the formula on our metric description page:

coverage = (CT + CF + LC)/(2*B + EL)

where

CT - branches that evaluated to "true" at least once
CF - branches that evaluated to "false" at least once
LC - lines covered (lines_to_cover - uncovered_lines)

B - total number of branches (2*B = conditions_to_cover)
EL - total number of executable lines (lines_to_cover)

这篇关于声纳中的代码覆盖率和行覆盖率有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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