Back

Branch Coverage

Idealogic’s Glossary

Branch coverage is a software testing metric that is often shortened to BC, this is the type of testing that makes sure that every branch in the code is covered in the course of testing thus every possible decision that can be made in the code is tested. This metric checks whether every path in a program has been exercised by confirming that every decision operator (including ‘if’ or ‘switch’) has been exercised in every possible manner. The degree of branch coverage is also a good measure of how many decision points in the code have been tested, the higher the degree the less likely a test will miss a bug which could make it through the testing process.

Nevertheless, branch coverage is an important tool to increase and measure test coverage and, therefore, the software quality, but it is not sufficient to find all defects. Because BC should not be the only testing technique that is used; there are other testing techniques such as statement coverage, path coverage, and functional testing. Combining branch coverage with these other techniques means that the developers will be in a better position to determine the extent of testing that has been done on the application and hence produce a better product. However, the idea should be to always strive in enhancing and fine tuning the test cases even after one has been able to achieve a high branch coverage in the aim of capturing all possible edge or complex conditions that may have been overlooked.