·2,447,543篇论文数据,部分数据来源于NoteExpress
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.
与行覆盖一样,如果在特定方法中有两个分支,并且两个分支在测试中都被覆盖,那么您可以说这个方法有100%的分支覆盖率。
The method in class Branch will not compile because this.left and this.right are not guaranteed to have value fields.
类 Branch 中的方法将不编译,因为 this.left 和 this.right 不保证具有 value 字段。
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为每个分支编写一个测试,直到每一行代码都能够被测试。
应用推荐