Establishing the Initial System State


The simplest tests tend to assume a great deal about the initial state of the system. For instance, take our sample login tests from Chapter 16. They assume a user defined in the system with the id bob and the password bobspassword. For another example, consider the searching tests from that same chapter. They assume certain contents of the database for example, results for horses in denver but none for joy in mudville (mighty Casey has struck out).

Although we don't expect these particular tests to modify the state of the system, other tests will, and they can't be run again until the system is returned to that initial state.

Resetting the system to the initial state can be a simple set of instructions you execute before running the tests ("Now set the limburger attenuation parameter to 'Thursday' and hit Refresh"), but we've found it well worthwhile to build an automated reset for instance, a shell script that shuts down the system, loads the initial state, and starts it back up.



Testing Extreme Programming
Testing Extreme Programming
ISBN: 0321113551
EAN: 2147483647
Year: 2005
Pages: 238

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net