[prev] 11 [next]

Developing Test Cases (cont)

Years of (painful) experience have yielded some common bugs:
  • iterating one time too many or one time too few through a loop
  • using < rather than <=, or vice versa
  • forgetting to handle the null/empty/zero case
  • assuming that other parts of the program supply valid data
  • assuming that library functions like malloc (see later) always succeed
  • etc. etc. etc.
Choose test cases to ensure that all such bugs will be exercised.

Requires you to understand the "limit points" of your program.