How many test cases are required for 100% statement and branch coverage of the following source code?

Question:

How many test cases are required for 100% statement and branch coverage of the following source code?

void main ( )

{

int

a, b;

scanf (“%d”, &a);

scanf (“%d”, &b);

if (a>b) {

printf (“a is large”);

}

else {

printf (“b is large”);

}

}

(a) 1 test case for statement coverage, 2 for branch coverage.

(b) 2 test case for statement coverage, 1 for branch coverage.

(c) 2 test case for statement coverage, 2 for branch coverage.

(d) 1 test case for statement coverage, 3 for branch coverage.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Software Testing

ISBN: 9781107012967

1st Edition

Authors: Yogesh Singh

Question Posted: