CASE STUDY^509
Depending on the number of questions, there could be thousands of cases in the third
category. How many do we have to try to convince ourselves that the application is cor-
rect? The end cases here would be that they agree in the first and last positions, they
do not agree in the first and last position, they agree somewhere in the middle, and
they disagree somewhere in the middle.
As the algorithm is not dependent on the number of questions, let’s use 5 questions
for our test cases.
Provided our input is correct, if the implemented test plan produces the expected
results, we should be fairly confident that the application is correct.Provided our input is
correct?We have not built any error checking into these classes. This omission is a seri-
ous flaw in our design. The Case Study Follow-Up questions at the end of this chapter
ask you to make these classes more robust by adding error checking. The results of this
test plan are shown here.
Test # Reason for Test Input Expected Output1
2
3
4
Initial inputAll correct
(Also tests same in
first and last
position)
All wrong
(also tests different in
first and last
position)
Partially correctTest ending condition5
Answer Key
TTTTT
Jones
TTTTTJanet Jerome
FFFFFJeff Jubilee
TFTFTeof on data
filefileJoe Jones:
number correct 5Janet Jerome:
number correct 0Jeff Jubilee:
number correct 3application ends