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
What is test management?
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?
how to test ecg machine?
What is the difference between latent and masked defects?
What is Online gaming, payment gateway development, hosting and custom software development services.
how to connect your project in database?
What is remedy testing,expalim that and how can use that
what will be verification and validation test cases for yahoo login page (only functional test cases)? Please explain in details.
what s test block ratio? please any one answer me..
What are the tasks of test closure activities in software testing?
Which are the different tests for apparel testing?
How a test engineer will convince a test lead when he didn't approve the bug as a report ???
When we use integration testing for any new system so why we required system testing.
sanity testing is done during regression testing.is it true.if it is true plz explain?
What is meant by entry criteria and exit criteria in software testing?