声纳-全面覆盖 [英] Sonar-Overall Coverage

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

问题描述

Sonar 给出了总覆盖率的值,它是线路和分支覆盖率的组合.我不确定这个指标有多重要.整体覆盖的价值意味着什么?它如何优于线路和分支覆盖?任何的意见都将会有帮助.

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天全站免登陆