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
What is ramp testing?
write the test cases for facility module
Can any one tell me how to write test data. i mean, to test each input, 2 test input(1 for +ve, & other for -ve) are given. so , for example, if i want to write test data for login form, how many test data should i write in test case?
how to write testcase for the output of an program ****0 ***01 **012 *0123 01234
explain end to end scenario's for online Money transfer in Banking Domain?
Explain the ramp testing?
What are all the companies are doing manual testing till now ?
Write a test case for telephone?
Can someone help to write testcase for the scenario as early as possible.: 1. Complaint logged since one week 2. complaint info sent to supervisor with high priorit mail 3. 10 users logged into website , performance could not be degraded ( response within 5 seconds) 4. site should be user protected. 5. it should be work with IE 6 IE 7 6. complaint log should be generated more than one week
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
pls i want test cases for oss? whts the process of oss testing
Write a test case on a durability of an electric bulb and test it that it will last for next 10 months.
"search"test cases on Linkedin website and how will you write test cases on it?
Explain which test cases are written first black boxes or white boxes?
Describe to me what you see as a process. Not a particular process, just the basics of having a process.