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.
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 字段。
3
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.