Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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 ?    8 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

Can any one please tell me what is the use of negative test cases when we are giving the invalid input in test data

3 Answers  


What are the test cases for mouse?

0 Answers  


By clicking the file button on a Word document and opening the Print window, Identify what needs to be white box tested and what needs black box testing. (On the black box testing items, identify boundary conditions and equivalence partition testing is possible and give data examples.)

0 Answers  


hi iam working in HCL as a fresher n iam dg automation testing i am going to give client demo i did some 7 scripts i want to call all those in some new page in QTP I KNOW CALL THE EXISTING ACTION N COPY OF ACTION if we use any of these options while running it will show the whole script but is there any other method while running it should not show the whole script it will show only the calling lines plz give me detailed explanation to ds i need reply fast plzz

2 Answers   HCL,


What is usability testing? What are the usability test cases for 'Save As' option in Notepad?

4 Answers   Infosys,






How many test cases u will write for Adhoc testing?

4 Answers  


I have s/m which gives me square of numbers from 1 – 10000. How do u test it.

0 Answers   ACS,


what are the test case scenario for epos/pos testing,and how to initiate the process

0 Answers  


You have to give me test cases for sending a mail through outlook express.

2 Answers   Mind Tree,


Can someone tell me the test cases to test the password for with following scenario: 1. Password should be minimum 6 chars and maximum 8 chars. 2. Password should consist one uppercase letter 3. Password should consist of one numeric 4. Password should consist of one special character.

0 Answers  


Explain the logic testing?

0 Answers  


Write 10 test cases for the condition P=R/I where R and I are integer and P is floating point.

6 Answers   Adobe,






Categories