What is data-driven testing?

Data-driven testing is an automated testing method in software engineering.

In data-driven testing, we create a script that supplies data collection to the software that is to be tested and verifies the generated output to the expected output. The input data can consist of all kinds of test cases, including boundary values.

The collection of test data can be in the form of an Excel file, a CSV file, a database table, etc. It includes the input to be supplied to the software and the expected output against that input.

Data-driven testing is also called table-driven testing or parameterized testing.

Steps in data-driven testing

The following are the primary steps that take place in data-driven testing:

  1. Identify the test cases
  2. Write a step-by-step procedure for each test case.
  3. Write the input and the expected output for these test cases in a data file.
  4. Write the script that can read the data file for input data and the expected output.
  5. Run the software for a single set of input data.
  6. Verify the results. Check if the generated output is the same as the expected output.
  7. Continue with the next set of input data.

Advantages of data-driven testing

Data-driven testing has a whole lot of advantages. A few of them are listed below:

  1. It allows the software to be tested for several test cases instead of the hard-coded values.
  2. It is an automated process, which means that it is fast and can save time. The testing team can spend this time improving other aspects of the software.
  3. All the test data is unified and collected in a single space.
  4. The test cases and test data are entirely separated from the code.

Disadvantages of data-driven testing

Data-driven testing brings a few tiny disadvantages, along with the benefits it offers. A few of those disadvantages are:

  1. Maintenance and data validation are difficult when dealing with large amounts of data.
  2. More coding is required to execute the data-driven testing methodology successfully.
  3. The quality of the data-driven testing is dependent on the team that writes and runs the scripts.

Free Resources

Copyright ©2024 Educative, Inc. All rights reserved