Hi, Below is a question on white box testing. Kindly help
me in answering it. How many test cases are needed to
obtain 100% branch coverage. This question was asked in
ISTQB foudation level exam - Dec21 2008.

Read(A,C)

If(A<10) then Print A;

Endif

If(C>100) then Print C is greater then A

else if(C<100) then print only C

Endif else

Options -
a. 4
b. 3
c. 2
d. 1

Kindly answer with explanation so that it would be easy to
understand

Answer Posted / rama mohan parini

Require 3 Path test cases.

Test Case 1 - A is any value > 9 and C = 100 to check that
nothing is printed.

Test Case 2 - A is any value < 10 and C is > 100 to check
that Print A and
Print C is greater than A lines are printed

Test Case 3 - A is any value, and C is < 100 to check that
Print A ( only if A is < 10)
Print C is greater than A is printed.

We should use Cyclomatic complexity formula to calculate
number of paths easily

C = E - N + 2

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is test management?

1435


1...DIFF BETWEEN QTP AND WIN RUNNER? 2... CHECKPOINTS AND EXPLAIN EACH OF THEM? 3...WHY IS STEP GENERATOR? 4... WHAT IS THE DIFF BETWEEN FUNCTIONS AND SUB ROUTINE?

1449


how to test ecg machine?

1372


What is the difference between latent and masked defects?

688


What is Online gaming, payment gateway development, hosting and custom software development services.

1428






how to connect your project in database?

1523


What is remedy testing,expalim that and how can use that

1241


what will be verification and validation test cases for yahoo login page (only functional test cases)? Please explain in details.

13646


what s test block ratio? please any one answer me..

1826


What are the tasks of test closure activities in software testing?

625


Which are the different tests for apparel testing?

685


How a test engineer will convince a test lead when he didn't approve the bug as a report ???

1161


When we use integration testing for any new system so why we required system testing.

1551


sanity testing is done during regression testing.is it true.if it is true plz explain?

1464


What is meant by entry criteria and exit criteria in software testing?

679