What is the difference between path coverage and branch coverage?

Questions by kavitha_pendkar   answers by kavitha_pendkar

Showing Answers 1 - 1 of 1 Answers

lasolas

  • Sep 24th, 2007
 

Path coverage testing is arguably the most thorough type of testing that seeks to test the critical paths of software code in an application.  These major paths of code may have several decision points or "if" statements which branch off the main path.  Branch coverage testing aims to ensure that each branch from each "if" statement is executed. 

For example, a main path with three if statements; if(x), if(y), if(z) would need six test cases to ensure full test coverage as follows:

test case 1 if(x) = true
test case 2 if(y) = true
test case 3 if(z) = true
test case 4 if(x) = false
test case 5 if(y) = false
test case 6 if(z) = false

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions