The next step beyond testing code is measuring the tests with a code coverage tool.
对代码进行测试的下一步是用代码覆盖工具对测试进行度量。
Next, I run a code coverage tool, such as Cobertura, and get the report shown in Figure 1.
接下来,我将运行一个代码覆盖率工具,比如Cobertura,并将获得如图1中所示的报告。
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为每个分支编写一个测试,直到每一行代码都能够被测试。
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.
代码覆盖工具可报告测试覆盖率——以行覆盖或分支覆盖形式表示——它表示测试运行时所涉及的代码量。
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.
代码覆盖工具可报告测试覆盖率——以行覆盖或分支覆盖形式表示——它表示测试运行时所涉及的代码量。
应用推荐