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


Please Help Members By Posting Answers For Below Questions

how to write testcase for the output of an program ****0 ***01 **012 *0123 01234

1280


What is explain security testing?

691


What is business validation test case?

657


what is black box system in software development in system analysis and design?

1622


Explain the syntax testing?

647






How to write test cases for manual testing? What are the main syntex for writing test cases for Junit?

2459


Explain the ad hoc testing?

652


Write all test cases for Bus Pass Renewal

1051


How to write a test cases for the following Please it is urgent Once user clicks that link Invite Friend page opens up thru which user can do 2 functions - first is to search friends detail(name, mail id) from her address book in other sites (india times, yahoo, gmail and rediff) and second to mail the invite to the selected person/s. User can send invite to multiple person at same time. Searching friends detail in other address books will work like this: - User will input name, email id, pwd etc, select from which site she want to get friends list and then click on Import. - Users address book from other sites will be imported in one shot(first time) to iDiva database. - It will be arranged in alphabetical order(complete list) and mail ids which are already used will be in different color. - User will be able to update her address book by clicking on ""Refresh"" button on the page, which will trigger the process again, and fetch new mail ids.

3439


What is test environment? Elaborate with example.

613


Explain the ramp testing?

668


can anyone send me a copy of a business requirement and test cases attributed to such requirent. thank u

1638


What is the toughest moment you faced in your testing carrier in which everyone praised you?

1779


Explain the integration testing?

664


explain end to end scenario's for online Money transfer in Banking Domain?

1377