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 test case for this scenario. The Contact Information screen shall be displayed to the user during Case Update

1538


Explain the logic testing?

672


please tel me how to write test case for search engine to track peoples,when user enter the city,state,zipcode(ex:Kansas city,Missouri,64155)? (note country is already selected as a united states )

3514


They were asking sily questions and definitions rather than practical experience related questions. More focused on Definitions.

1523


What is component testing?

740






Who will take care of test plan and test case?

1656


Can you list down a few characteristics of a test case?

715


Explain the functional testing?

680


# A large IT company is in the process of revising salary structure for its employees. The salary will be on the basis of assessed performance of the previous year for all employee who have completed six months or more. # The rules for salary revision are provided below :- Performance level 1 : Increase existing salary by 30% Performance level 2 : Increase existing salary by 20% Performance level 3 : Increase existing salary by 10% Performance level 4 : Increase existing salary by 5% Performance level 5 : No Increase # For those who have not completed six months, provide a flat increase of 7.5% in their salary. In addition to above provide a special loyalty allowance of Tk. 800 to all employees who have complete THREE years with the organization. # Compute the minimum number of paths that you would require to cover the application and how many test cases would you require?

1990


Write a test case of login window?

720


Give me a example that differentiate Test case Procedure,Test case Scenario,Test case Discription & test steps.

2206


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

2202


Explain the ad hoc testing?

679


How to write test case for this scenario. The First Name data entry field shall be removed from the existing Contact Information screen

1736


If userA send a string through whatsapp but userB is not getting properly the string, Then what may be problem? Can someone write testcase of this. Both whtsapp application is same version and OS is also same android version.

1565