SonarQube中的 Metric Definition — Tests
度量指标 | 算法和说明 |
条件覆盖率 Condition coverage(branch_coverage) | On each line of code containing some boolean expressions, the condition coverage simply answers the following question: 'Has each boolean expression been evaluated both to true and false?'. This is the density of possible conditions in flow control structures that have been followed during unit tests execution.
|
新代码的条件覆盖率 Condition coverage on new code ( |
与条件覆盖率相同,但仅限于新的/更新的源代码。 Identical to Condition coverage but restricted to new / updated source code. |
条件覆盖命中率 Condition coverage hits ( |
覆盖的条件列表 List of covered conditions. |
Conditions by line ( |
Number of conditions by line. |
Covered conditions by line (covered_conditions_by_line ) |
Number of covered conditions by line. |
覆盖率 Coverage ( |
它是行覆盖和条件覆盖的混合体。它的目标是为以下问题提供更准确的答案:单元测试覆盖了多少源代码? 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 on new code (new_coverage ) |
Identical to Coverage but restricted to new / updated source code. |
行覆盖率 Line coverage ( |
在给定的代码行上,行覆盖率只是简单地回答了以下问题:这行代码是否在单元测试执行期间执行过? 它是单元测试行覆盖的密度: On a given line of code, Line coverage simply answers the following question: Has this line of code been executed during the execution of the unit tests?. It is the density of covered lines by unit tests:
|
新代码行覆盖率 Line coverage on new code ( |
与行覆盖率相同,但仅限于新的/更新的源代码。 Identical to Line coverage but restricted to new / updated source code. |
行覆盖命中率 Line coverage hits ( |
List of covered lines. |
代码行覆盖数 Lines to cover ( |
单元测试可以覆盖的代码行数(例如,空行或完整的注释行不被视为要覆盖的行)。 Number of lines of code which could be covered by unit tests (for example, blank lines or full comments lines are not considered as lines to cover). |
新代码覆盖的行数 Lines to cover on new code ( |
与要覆盖的行相同,但仅限于新的/更新的源代码。 Identical to Lines to cover but restricted to new / updated source code. |
跳过的单元测试 Skipped unit tests ( |
跳过的单元测试数。 Number of skipped unit tests. |
未覆盖条件 Uncovered conditions ( |
单元测试未覆盖的条件数。 Number of conditions which are not covered by unit tests. |
新代码的未覆盖条件 Uncovered conditions on new code ( |
与未覆盖的条件相同,但仅限于新的/更新的源代码。 Identical to Uncovered conditions but restricted to new / updated source code. |
未覆盖代码行数 Uncovered lines ( |
单元测试未覆盖的代码行数。 Number of lines of code which are not covered by unit tests. |
新代码的未覆盖行数 Uncovered lines on new code ( |
与未覆盖的行相同,但仅限于新的/更新的源代码。 Identical to Uncovered lines but restricted to new / updated source code. |
单元测试数 Unit tests ( |
单元测试数量 Number of unit tests. |
单元测试执行时间 Unit tests duration ( |
执行所有单元测试需要的时间 Time required to execute all the unit tests. |
单元测试错误数 Unit test errors ( |
单元测试失败的数量 Number of unit tests that have failed. |
单元测试失败数 Unit test failures ( |
由于意外异常而失败的单元测试数 Number of unit tests that have failed with an unexpected exception. |
单元测试成功密度(%) Unit test success density (%) ( |
Test success density = (Unit tests - (Unit test errors + Unit test failures)) / Unit tests * 100 |