Question: List all white-box test cases for the source code given in Example 6.3. Which test cases do you think are the most important? Why? Data
List all white-box test cases for the source code given in Example 6.3. Which test cases do you think are the most important? Why?
Data from Example 6.3
Source Code for the Sample Function That Was Specified in Example 6.2
i = 1; // f1
done = false;
new_one = true;
while (!done)
{
if (new_one)
{
if (i < = N) // p1
{
j = 1;
// f2
new_one = false;
rest = false;
else
done = true;
} //end if
else
{
if (rest)
{
j = j + 1;
// f3
rest : = false;
}
else
{
W(i) = j;
// f4
if
A(i,j) > 0 // p2
{
T(i) = 1; // f5
new_one = true;
}
else
{
if (A(i.j) < 0 ) // p3
T(i) = -1; // f6
new_one = true;
else
rest = true;
} // end if
} // end if
} // end if
if new_one
i = i + 1;
// f7
}
// end if
} //end if
} // end main loop
Step by Step Solution
3.36 Rating (174 Votes )
There are 3 Steps involved in it
ANSWER Test Cases 1 Test that the variable i is initialized to 1 f1 2 Test that the variab... View full answer
Get step-by-step solutions from verified subject matter experts
