...

/

CORREC[T]: [T]ime

CORREC[T]: [T]ime

Learn about the time boundary condition in writing JUnit tests.

The last boundary condition in the CORRECT acronym is time. We need to keep several aspects of time in mind:

  • Relative time (ordering in time)
  • Absolute time (elapsed and wall clock)
  • Concurrency issues

Some interfaces are inherently stateful. We expect login() to be called before logout(), open() before read(), read() before close(), and so on.

Consider what happens if methods are called out of order. Try various alternate sequences. Try skipping the first, last, and middle of a sequence. Just as the ...

Access this course and 1400+ top-rated courses and projects.