Question: How many test cases are required for 100% statement and branch coverage of the following source code? void main ( ) { int a, b;
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.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
