Open In App

Data Driven Testing in Software Testing

Last Updated : 10 Jan, 2024
Like Article

Prerequisite: Software Testing

Data-Driven Testing is a type of software testing methodology or more exactly approach to the architecture of automated tests by creating test scripts and reading data from data files. 

In this type, the data files involved are Data pools, CSV files, Excel files, ADO objects, ODBC sources, etc. The testing functions create the test scripts in which the test data and the output values are read from the data storage.

Types of Data-Driven Testing

  • Keyword-Driven Testing: A data-driven method called “keyword-driven testing” keeps the logic of test scripts apart from the data. Keywords are used in test scripts; a data table lists the inputs and anticipated outcomes for each keyword. As a result, test cases can be changed freely without affecting the scripts.
  • Excel-Driven Testing: Excel spreadsheets are used in Excel-driven testing to specify and arrange test data. Test scripts may run tests with various sets of data and are easy to maintain because they read data from Excel files.
  • Negative Testing: In a data-driven approach, negative testing consists of evaluating the application’s capacity to manage unexpected or erroneous data. Test cases are made to verify how the system reacts to values entered incorrectly.
  • XML Testing Driven: XML files are used to describe test data in XML-driven testing. To run tests with various data sets, test scripts read data from XML files. This method works especially well with complex data structures.

Working of Data-Driven Testing 

Let’s understand working with a real application scenario:

  • Suppose taking an application for login credentials both username and password are required.
  • If both the username and password are correct then login successfully, and it will enter into the home page.
  • Another case is that when the username is correct, but the password is wrong then the login action will fail i.e. showing an Invalid credential and will not allow entering into the home page.
  • Next when the username is incorrect and the password is correct then the login fails.
  • The next thing the logic says is that it is a control flow process for checking the conditions and functions.
  • The test scripts are taken in the final position and an automation code is implemented for the conditions. The test scripts are working like functions and actions.

Figure 1: Working model of data-driven testing


  • Reusability of Code: Data-driven testing allows the reusability of code. It improves test coverage.
  • Data Values: In the case of regression testing, the test application allows the set of data values.
  • Test and Verification of data: In data-driven testing mainly both the test and verification data are ordered in a single file and separated from some test logic. This type of testing generates a clear-cut idea and logic of the test cases from the test data for the developers and testers.
  • Changes in the test script do not affect the test data as well as the test process.
  • Time-Saving: Different tools generate the test data automatically and a large volume of test data is taken to save time when necessary.
  • Flexibility: Less maintenance is required as well as it provides flexibility in application maintenance.
  • Re-using functions: Several functions and actions can be reused in many test cases present in data-driven testing.
  • Reduce Redundancy: It helps in reducing redundancy and unnecessary duplication of test scripts.


  • Dependency on Automation Team Skills: One of the biggest drawbacks is that the quality of the test depended upon the automation team skills i.e. being implemented.
  • Scripting Language Expertise: Data-driven testing requires great knowledge and expertise in the scripting language.
  • Execution Time: When the amount of data is more for validation it takes so much time to execute.
  • Maintenance: In this type, maintenance plays a big issue in the code complexity and difficulty of understanding the logic.
  • High-Level Technical Skills Requirement: More documentation and high-level technical skills are required. Another thing is that the tester should learn the entire new scripting language.


A powerful testing technique called Data-Driven Testing (DDT) enables the execution of test scenarios using several sets of input data. Although, it has many benefits, there are certain drawbacks and things to keep in mind. Teams can create more robust, effective and thorough testing methods, which will result in higher-quality software products, by carefully addressing its drawbacks and utilizing its advantages.

Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads