Tell me number of test cases required for full statement
and branch coverage:
Read P
Read Q
IF P+Q > 100 THEN
Print “Large”
ENDIF
If P > 50 THEN
Print “P Large”
ENDIF

Answers were Sorted based on User's Feedback



Tell me number of test cases required for full statement and branch coverage: Read P Read Q ..

Answer / santosh kumar singh

take p=70
and q=40
with this the full statement coverage

for the else part for branching
2 test cases for branches coverage.
take p=40
and q is same as above
with this the else part of both the block will be covered.

Santosh kumar Singh.

Is This Answer Correct ?    9 Yes 2 No

Tell me number of test cases required for full statement and branch coverage: Read P Read Q ..

Answer / saurabh_g

Since both the conditions are independent of each other :

(1) Branch Coverage :

2 Test cases are required.

1st test case : When P+Q > 100 is True (1st branch)
2nd test case : When p > 50 is True (2nd Branch)

(2) 100 % Statement coverage : Each executable statement
executed atleast once.

Again 2 Test cases are required.

1st test case : When P+Q > 100 is True
2nd test case : When p > 50 is True

(3) Path coverage :

4 Test cases are required because 4 paths are possible.

1st : When P+Q > 100 is true but P>50 is false
2nd : When both "P+Q > 100" and "P>50" are true.
3rd : When both "P+Q > 100" and "P>50" are false.
4th : When P+Q > 100 is false but P>50 is true.


Cheerz,
Saurabh Garg

Is This Answer Correct ?    4 Yes 13 No

Post New Answer

More Test Cases Interview Questions

Write test cases on for windows media player?

1 Answers   CGI, COG, QMCPL,


write a navigation for object repostory

4 Answers  


ATM application ( scenarios ): Analysis and testcases

1 Answers   TCS,


how to write the test case for 1 to 12 months in equivalence partitioning?

6 Answers  


There is project earlier it was developed in VB then they had replaced the project by java and there is no documentation available then how you are going to check that project. (Hint: - Parallel Testing).

2 Answers  






is test cases are necessary for testing non functional testing

1 Answers   MSCI,


Test case for flight reservation system

1 Answers  


Please guide me for Add new user test cases

0 Answers  


What is test environment? Elaborate with example.

0 Answers  


what are the testcases for square

4 Answers  


what all are available test cases for Search engine NLP (Sixth sense).

1 Answers   HCL, TCS,


Write negative test case for logout????? Answer soon friends

2 Answers  


Categories