SOFTWARE ENGINEERING

SOFTWARE TESTING

TEST PLAN AND TEST CASE DEVELOPMENT

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Read P Read Q If p+q > 100 then Print “Large” End if If p > 50 then Print “pLarge” End if What is the minimum Tests Required for Statement Coverage and Branch Coverage?
A
Statement coverage is 2, Branch Coverage is 2
B
Statement coverage is 3 and branch coverage is 2
C
Statement coverage is 1 and branch coverage is 2
D
Statement Coverage is 4 and Branch coverage is 2
Explanation: 

Detailed explanation-1: -So to achieve 100% decision coverage we will need minimum 5 test cases.

Detailed explanation-2: -4 test cases are required for 100% decision coverage.

Detailed explanation-3: -For a test set to achieve 100% branch coverage, every branching point in the code must have been taken in each direction, at least once. The archetypical example, showing that 100% statement coverage does not imply 100% branch coverage, was already given by Alexey Frunze.

There is 1 question to complete.