What is Branch Coverage Testing?
Branch Coverage Testing is a methodical test type in which all branches of the program or conditional states must be tested at least once during a test process.
When checking the branch coverage, each different result of a code module is tested. For example, if the results are binary, developers test both results. If there is a code function that tests a series of values, each of those evaluated results is tested as well. If a function returns either a yes or a no value, the test must enter each of those values and test the result.
Branch coverage tests are inherently different from other broader forms of testing. It is a rigid conditional requirement that may not be fully feasible in all cases. Some developers, and others who talk about branch coverage testing, suggest that a certain percentage of coverage is appropriate, while others have suggested that developers can devise two or three different test strategies to make sure they are using all of the code modules. Cover branches - or as many as possible.
As a type of tactical testing, branch coverage testing is more of a metric used to assess test results than a testing philosophy or broader testing strategy.