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
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 |
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 |
test case for digital camera
Tell me how to write a test case to test a search (general search engine ) function that is present on almost all sites.
Need help to write test case for "Check Availability" field. Any help would be highly appreciated!
1.If there are so many test cases to be run suppose (100).How will we run those test cases.(using batch) 2. How will we perform over riding in QTP can any one please give me script. thanks
How can we write a good test case?
Smoke Test Checklist for Gmail please someone help!
How would you do " Keeping two folders in sync testing"
0 Answers ABC, HCL, Microsoft,
"search"test cases on Linkedin website and how will you write test cases on it?
How to write test cases on for Logging management?
Can anybody post the format of a Requirement Traceability Matrix. And how to include this RTM in the reqirement document.?
Write a test case on online shopping website? (please tell me the format how to write in MS excel,if u have any sample than attach it.)
build 1 bug is raised and it was closed by developer and build 2 is released in build 2 also same bug raised what is the satus of that bug. 1>reopen 2>open 3>new 4>defered