Chapter 4. Data-driven Testing
"Errors using inadequate data are much less than those using no data at all." | ||
--Charles Babbage |
Test data is a crucial part of automated tests; the old truism garbage in, garbage out applies especially well in this case. Tests will feed some data into our Turing machine and compare the output with the expectations. In a manner of speaking, a perfect test is a little insane; it will keep doing the same things over and over while expecting a different result.
As automated test developers, our goal is to make the tests fulfill their destiny of endlessly repeating identical steps, forever. The only way to accomplish this goal is to have as much control as possible over every single piece of data our application consumes. Test data is not just the text our test will type into the purchase form; test data is the complete state of the whole environment we are testing. In this chapter, we will take control of the environment we are...