声纳总体覆盖 [英] Sonar-Overall Coverage

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

问题描述

声纳给出的总覆盖率值是线路覆盖率和分支覆盖率的组合.我不确定这个指标有多重要.全面覆盖的价值意味着什么?它比行和分支机构覆盖范围好吗?任何的意见都将会有帮助.

Sonar gives a value of Overall coverage which is a combination of line and branch coverage. I am not sure how important is this metric. What does the value of overall coverage signifies? How it is better than line and branch coverage? Any suggestions would be helpful.

推荐答案

来自Sonar的文档:

From Sonar's documentation:

它是线路覆盖率和条件覆盖率的混合.其目标是 提供以下问题的更准确答案: 单元测试已经涵盖了很多源代码?

It is a mix of Line coverage and Condition coverage. Its goal is to provide an even more accurate answer to the following question: How much of the source code has been covered by the unit tests?

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

where

CT = conditions that have been evaluated to 'true' at least once
CF = conditions that have been evaluated to 'false' at least once
LC = covered lines = lines_to_cover - uncovered_lines

B = total number of conditions
EL = total number of executable lines (lines_to_cover)

来源: https://docs.sonarqube.org/display /SONAR/Metric + Definitions#MetricDefinitions-Tests

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

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