[VCTP] - The Virtual Clock Test Pattern
By: Paolo Perrotta
This paper describes a common example of a Responder called Virtual Clock[VCTP]. The author uses a The Virtual Clock Test Pattern as a Decorator[GOF] for the real system clock that allows the time to be "frozen" or resumed but one could use a Hard-coded Test Stub or a Configurable Test Stub just as easily for most tests. Paolo Perrotta summarizes:
We can have a hard time unit-testing code that depends on the system clock. This paper describes both the problem and a common, reusable solution.
Further Reading
See http://http://www.nusco.org/docs/virtual_clock.pdf.
Copyright © 2003-2008 Gerard Meszaros all rights reserved