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

Is compatabilitytestig and port testing are same

1466


In cycle 1 we have 100 test cases out of which 95 test cases are PASS and 5 test cases are FAIL. So in cycle 2 how many test cases performed as a part of regression testing?

1120


what are the testing appraoch that you have tested for Bread toaster

1912


Can you do system testing at any stage of sdlc?

657


need testing projects where can i find them

1666






hi this is satish can some one help me out by sending the maxium notes on client sesrver ,web server and company architechture project hirearchy and company hirearchy i will happy to recive the answers as early as possible

1719


What is a top-down and bottom-up approach in testing?

703


Can Anbody please send me Daily Work status format in which I can save my daily work activity

2108


If anybody from banglore having the real time exp in manual testing with 3+ yrs exp and looking for change send your profile to vinodhanandhan@gmail.com

1506


What is configuration management in software testing ?

4254


How will you set the Dependency in the Quality center? Say if you will fail a test case and two or more test cases are dependent on that particular test case. In this case how will you handle in failing the test case.

2236


what are your thoughts on SPRINT duration

1567


Test approach to windows update?

1735


Hi All. How can we write negative test cases for Logout Operation ? Please place the answer with a few details and if possible add some related object properties. "A tester exposes his/her ability not only by words he/she also proof it by work"

2507


I have to give weights to 5 stones so that using a simple balance and the stone i should be able to weight any number between 1-100

1877