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

Answers were Sorted based on User's Feedback



Tell me number of test cases required for full statement and branch coverage: Read P Read Q ..

Answer / santosh kumar singh

take p=70
and q=40
with this the full statement coverage

for the else part for branching
2 test cases for branches coverage.
take p=40
and q is same as above
with this the else part of both the block will be covered.

Santosh kumar Singh.

Is This Answer Correct ?    9 Yes 2 No

Tell me number of test cases required for full statement and branch coverage: Read P Read Q ..

Answer / 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

More Test Cases Interview Questions

Write a test scenario for a project which is developed in a VB then after wards it is converted in Java and there is no documentation available.

2 Answers  


Explain transaction testing?

0 Answers  


when we should start writing test cases?

10 Answers   Thatavarti Technologies,


What is the smallest number of test cases required to Provide 100% branch coverage? If(x>y) x=x+1; else y=y+1; while(x>y) { y=x*y; x=x+1; } A. 1 B. 2 C. 3 D. 4

1 Answers   ISTQB,


how to write a test cases for Quick links like Feedback/Suggestions Advertise with us Contribute Invite a Friend FAQs Make HomePage RSS Feed Buzz Words Email Privacy Statement Terms & Conditions Copyright Disclaimer Download Forgot Password

0 Answers   Cap Gemini,






Test cases on uplaoding files

12 Answers   GE, HP,


how to prepare unit test scripts for accrued interest calculation.

1 Answers  


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

0 Answers  


Explain the sanity testing?

0 Answers  


How many test cases can u write 1) File - open dialog box in notepad pleasse write

5 Answers  


what is the process of testing

2 Answers   TCS,


For example out of 100 test cases if I ask you to automate how many you can automate?

13 Answers   HCL, MBT,


Categories