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

i want to write the test cases for sorting the records in a table according to date wise.this is the functionality ,that is the latest record should come on the top can any one tell me the test cases for this thanks in advance:)

1 Answers   Cognizant,


how to write test cases for testing databases,especially for testing and writing test cases for stored procedures.any real time database testers.please answer me. some real time database tester please answer my question as soon as possible.my need is such that. else mail answer at ina.ref@gmail.com

1 Answers  


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

0 Answers  


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

13 Answers   HCL, MBT,


In a log in page what will be test procedure,test scenario,test discription & test steps?

1 Answers  






consider a program module that inputs two (2) values, n and max, and computes the sum of the first n integers as long as this sum is less than max; otherwise an error should be reported. if n is negative, then it takes the absolute value. a) list the equivalence partitions, and b) list the boundary values.

0 Answers  


what will be testcases for job portal such as naukri.com , monster.com (as existing user)

2 Answers   Unilog,


pls let me know the answer, recently i faced this question in interview. when you are writing the test cases,if the requirements are changed what will u do?

4 Answers   Wipro,


Explain the functional testing?

0 Answers  


what is difference between repeatable and reusable test case?and what is self cleaning test cases?

3 Answers  


how to test a UI and aslo we need to check a log data fil which gets populated in the db.for this two scenarios give me test cases

0 Answers   IBM,


What are the Test Cases Comes under Regression Suite?

0 Answers  


Categories