语句覆盖,就是设计若干个测试用例,运行被测程序,使得每一可执行语句至少执行一次。这里的“若干个”,意味着使用测试用例越少越好。语句覆盖率的公式可以表示如下: 语句覆盖率=被评价到的语句数量/可执行的语句总数 x 100%
语句覆盖率(statement coverage):这个概念是指在模拟的过程中被执行 语句所占的百分比。一个语句没有被执行到则肯定没有被检验过,因此我们规定 在一个验证的过...
基于56个网页-相关网页
还有几类覆盖率,比语句覆盖率更直接地指向设计错误(例如分支覆盖率)。
There are types of coverage that point more directly to design mistakes than statement coverage does (branch coverage, for example).
单元测试阶段结构覆盖测试往往要求语句覆盖率和分支覆盖率均达到100%。
In the unit test stage, it is often required that sentence coverage rate and branch coverage rate all up to 100% in the structure coverage test.
您可以通过许多方法来测量代码覆盖率:通过评估代码行或语句的覆盖面、条件覆盖面、分支覆盖面等等。
You can measure code coverage in several ways: by assessing line or statement coverage, condition coverage, branch coverage, and so on.
应用推荐