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 the state testing?
How to write test cases or test scripts for UAT testing which is done manually
Give me a example that differentiate Test case Procedure,Test case Scenario,Test case Discription & test steps.
Can you list down a few characteristics of a test case?
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
Write a test case of login window?
can anyone send me a copy of a business requirement and test cases attributed to such requirent. thank u
Explain the soak testing?
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?
Explain the domain testing?
Explain the load testing?
"search"test cases on Linkedin website and how will you write test cases on it?
How to write the test cases for STP
how to test stand alone programs?
Explain how to develop a test plan and a test case.