Question: List all the black-box test cases for the source code given in Example 6.3. Which test cases do you think are the most important? Why?
List all the black-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.41 Rating (170 Votes )
There are 3 Steps involved in it
ANSWER Test Cases 1 Test case to check that function f1 is executed when i is initi... View full answer
Get step-by-step solutions from verified subject matter experts
