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
Answer Posted / 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 View All Answers
write a test case flipkart login page
Explain which test cases are written first black boxes or white boxes?
What is explain security testing?
Can anybody help me out to write test cases for booking train ticket online???
how to write test cases for smart meter for gas and electricty
how to make test case for anolog voice logger?
Explain the load testing?
how to test a UI and aslo we need to check a log data fil which gets populated in the db.for this two scenarios give me test cases
Explain transaction testing?
What are the Test Cases Comes under Regression Suite?
Positive and Negative test cases for the speedometer?(minimum 5 each)
How to write test case for this scenario. The system shall auto populate the Email Address on the contact screen with the Email Address of the user profile
WE WANT HEALTHINSURENE PROJECT FUNCTIONAL TEST CASES
explain end to end scenario's for online Money transfer in Banking Domain?
What are the different check points for SIT and UAT while testing an Internet Banking application. Consider any one functionality of Internet Banking