Introduction to data-driven testing
Data-driven testing separates test procedures from test data, to increase efficiency and reduce maintenance.
An automated test consists of two parts: the procedure, which is a set of steps to perform; and the data to use in the test. For example, a test for a login dialog would include steps to open the application, enter the username, enter the password, click the Submit button, and check that the application responded correctly. The data for this test would include a username, password, and the expected results of the test, such as a successful login or an appropriate error message.
Typically, a login test would be repeated for multiple combinations of valid and invalid username and passwords. In data-driven testing, the test data is stored in a table separate from the test procedure. During a test run, the test procedure is performed once for each row in the data table. Thus, the data in the table can be said to “drive” the execution of the test.