Then I would even take it a step further and run the test cases, even though I know they will fail because I haven't actually written any of the code for it.
接下来我甚至会进一步运行测试用例,尽管我知道它们将失败,因为我没有为该类编写任务代码。
If a method is 10 lines long and 8 lines of the method were exercised in a test run, then the method has a line coverage of 80%.
如果一个方法有10行代码,其中的8行在测试中被执行,那么这个方法的行覆盖率是80%。
Likewise, if a code base comprises 10,000 non-commenting lines of code and 3,500 of them were exercised on a particular test run, then the code base's line coverage is 35%.
同样,如果一个代码库包含10000个非注释性的代码行,在特定的测试运行中有3500行被执行,那么这段代码的行覆盖率就是35%。
应用推荐