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

What is the state testing?

719


How to write test cases or test scripts for UAT testing which is done manually

4939


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

2198


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

704


Can anybody help me in writing test cases for a scenario? need help at the earliest. will send you the requirement doc to your email id. thanks raj

1816






Write a test case of login window?

710


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

1668


Explain the soak testing?

681


A wholesaler sells printer cartridges. The minimum order quantity is 5. There is a 20% discount for orders of 100 or more printer cartridges. You have been asked to prepare test cases using various values for the number of printer cartridges ordered. Which of the following groups contain three test inputs that would be generated using boundary value analysis?

1491


Explain the domain testing?

669


Explain the load testing?

634


"search"test cases on Linkedin website and how will you write test cases on it?

5684


How to write the test cases for STP

5103


how to test stand alone programs?

2083


Explain how to develop a test plan and a test case.

683