Skip to content

A Short Introduction to Data-Driven Testing

Lucia Cavero-Baptista

Lucia Cavero-Baptista

There are many methods for implementing software testing. However, not all require the same effort for test creation and maintenance. If you need to run the same tests, but with different parameter values, then you can do this through data-driven testing (DDT).

What is Data-Driven Testing (DDT)?

Data-driven testing is a software testing methodology that uses a table of conditions directly as test inputs and verifiable outputs, and in which the test environment settings and control are not hard-coded.

This means that the test criteria – the input and result data values – are stored in one or more data sources, such as CSV files, Excel files, datapools, etc.

When using a data-driven testing methodology, we create test scripts to be executed together with their related data sets in a test automation framework. By doing so, we provide a re-usable test logic that improves test coverage and reduces maintenance.

Simply put, data-driven testing is a framework where you only use one test but with an array of data.

What are the benefits of data-driven testing?

Even though not all tests can be automated, using an automated technique such as data-driven testing comes in handy when there are a number of data sets that you have to run the same tests on.

Creating a different test for each data set values, especially hard-coded values, is not just time-consuming but also difficult to modify and maintain.

Through data-driven testing, on the other hand, you keep the data separate from functional tests, which allows you to execute the same test script for different combinations.

By doing this you can generate test scripts with less code, since all the information is already documented. This means you can improve test coverage and reduce unnecessary duplication of test scripts.

As a result, testers can spend their time where it is more valuable and time can be saved on test maintenance, enabling scaling.

Data-driven testing with Leapwork

With Leapwork you can work with data-driven testing using various input sources from, for example, Excel, databases, various web services and DOS command lines.

By separating data from functionality when automating software tests, you can reuse the automated flow, and just switch out the input. This can be useful when running the same tests often with new or updated data.

Watch the video below to see an example of data-driven automation with Leapwork.


To learn more about easy data-driven automation using a no-code automation tool, download our whitepaper: Test Automation: The Codeless Answer.

New call-to-action