The test cases identified so far are
- Empty input file.
- Missing title record.
- 1-character title.
- 80-character title.
- 1-question exam.
- 50-question exam.
- 51-question exam.
- 999-question exam.
- Number-of-questions field has nonnumeric value.
- No correct-answer records after title record.
- One too many correct-answer records.
- One too few correct-answer records.
The next input conditions are related to the students'
answers. The boundary-value test cases here appear to be
- 0 students.
- 1 student.
- 200 students.
- 201 students.
- A student has one answer record, but there are two
correctanswer records.
- The above student is the first student in the file.
- The above student is the last student in the file.
- A student has two answer records, but there is just one
correct-answer record.
- The above student is the first student in the file.
- The above student is the last student in the file. You
also can derive a useful set of test cases by examining the
output boundaries, although some of the output boundaries
(e.g., empty report 1) are covered by the existing test
cases. The boundary conditions of reports 1 and 2 are
0
students (same as test 14). 1 student (same as test
15). 200 students (same as test 16).
- All students receive the same grade.
- All students receive a different grade.
- Some, but not all, students receive the same grade (to
see if ranks are computed correctly).
- A student receives a grade of 0.
- A student receives a grade of 100.
- A student has the lowest possible identifier value (to
check the sort).
- A student has the highest possible identifier value.
- The number of students is such that the report is just
large enough to fit on one page (to see if an extraneous
page is printed).
- The number of students is such that all students but one
fit on one page.
The boundary conditions from report 3
(mean, median, and standard deviation) are
- The mean is at its maximum (all students have a perfect
score).
- The mean is 0 (all students receive a grade of 0). 64
The Art of Software Testing
- The standard deviation is at its maximum (one student
receives a 0 and the other receives a 100).
- . The standard deviation is 0 (all students receive the
same grade).
- All students answer question 1 correctly.
- All students answer question 1 incorrectly.
- All students answer the last question correctly.
- All students answer the last question incorrectly.
- The number of questions is such that the report is just
large enough to fit on one page.
- The number of questions is such that all questions but
one fit on one page.
An experienced programmer would probably
agree at this point that many of these 42 test cases represent
common errors that might have been made in developing this
program, yet most of these errors probably would go undetected
if a random or ad hoc test-case-generation method were used.
Boundary-value analysis, if practiced correctly, is one of the
most useful test-case-design methods. However, it often is
used ineffectively because the technique, on the surface,
sounds simple. You should understand that boundary conditions
may be very subtle and, hence, identification of them requires
a lot of thought. |