还有几类覆盖率,比语句覆盖率更直接地指向设计错误(例如分支覆盖率)。
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.
在图4的报告中显示我达到了 75% 的行覆盖率和 100% 的分支覆盖率。
The report in Figure 4 shows that I've achieved 75% line coverage and 100% branch coverage.
与行覆盖一样,如果在特定方法中有两个分支,并且两个分支在测试中都被覆盖,那么您可以说这个方法有100%的分支覆盖率。
Just like line coverage, if there are two branches in a particular method and both were covered through tests, then you could say the method has 100% branch coverage.
您可以通过许多方法来测量代码覆盖率:通过评估代码行或语句的覆盖面、条件覆盖面、分支覆盖面等等。
You can measure code coverage in several ways: by assessing line or statement coverage, condition coverage, branch coverage, and so on.
这个工具分析内核代码的覆盖率,并报告哪些行、函数和分支被覆盖以及它们被访问了多少次。
This tool analyzes the coverage of the kernel, and reports what lines, functions, and branches are covered and how many times they were hit.
代码覆盖工具可报告测试覆盖率——以行覆盖或分支覆盖形式表示——它表示测试运行时所涉及的代码量。
A code coverage tool reports test coverage — either in the form of line or branch coverage — that represents the amount of code that is being touched when a test is run.
报告分支覆盖的工具试图度量决策点(比如包含逻辑AND或OR的条件块)的覆盖率。
Tools that report branch coverage attempt to measure the coverage of decision points, such as conditional blocks containing logical ANDs or ORs.
当每个方法都有了至少一个测试,使用一个代码覆盖率工具如cobertura为每个分支编写一个测试,直到每一行代码都能够被测试。
Once every method has at least one test, use a code coverage tool, such as Cobertura, to write one test for every branch until each line of code is tested.
Cobertura通过被测试的行数和被测试的分支数来计算覆盖率。
Cobertura calculates coverage both by the number of lines tested and by the number of branches tested.
Cobertura通过被测试的行数和被测试的分支数来计算覆盖率。
Cobertura calculates coverage both by the number of lines tested and by the number of branches tested.
应用推荐