• Software Testing Dictionary
  • Home

Data Driven Testing



Data driven testing is creation of tests where test data, input, and output values are read from external files. In this way, testers can test how the software reacts to a large chunk of data more effectively. Some of external files can be of the below types −

  • Excel Files
  • ADO objects
  • CSV Files
  • ODBC sources
  • Text Files

What is Data Driven Testing?

A data driven framework is the one in which the test cases are segregated from the data set. Also, it gives the provision to run the same test case against multiple sets of data.

Read More: Selenium Data Driven Framework

Advantages of a Data Driven Testing

In data driven testing, various functions, methods, actions etc used in the code can be reused multiple times. In future, if the software behavior changes, the modifications should be made in the code only and the test data which is maintained in a separate file need not be touched. Similarly, if changes in test data are required or new sets of test data need to be created, updates are made only in the external file storing the data without impacting the code.

In the data driven testing, the test data is not implanted in the code. Mostly the large chunks of test data are generated using different automated tools and they become available by simply exporting the data in the files having the formats like xls, xlsx, csv, xml, txt etc. Thus a huge chunk of data is created within a short span of time and it does not require much maintenance effort.

One more advantage of the data driven testing is that, to test both positive, negative, and edge flows for a requirement, three different test cases need not be developed. However, a single test case which is fed with different sets of data maintained in the external files can be used. Thus it helps to get rid of redundant test cases.

Disadvantages of a Data Driven Testing

In order to create data driven testing frameworks, it requires high technical skills. The team working on them need to have knowledge of scripting languages, and other third party APIs like Apache POI and other libraries. Here, an integration system between two entities - data and logic are required to be built. Thus to adopt data driven testing in projects, there is a huge dependency of automation testers who can both fix the technical issues and test the software.

Practical Example a Data Driven Testing

Let us take an example of an application which deals in selling cars online. Let us see some positive, negative and edge cases −

  • User enters name, email, phone number, correct amount for car price, then clicks on buy. Successful buy should happen.
  • User enters the name, email, phone number, negative amount for car price, then clicks on buy. Error should be thrown saying invalid amount.
  • User enters the name, email, phone number, amount less than car price, then clicks on buy. Error should be thrown saying a lesser amount.
  • User enters a name, email, phone number, no amount for car price, then clicks on buy. Error should be thrown saying invalid amount.
  • User keeps the name blank, then enters the email, phone number, correct amount for car price, then clicks on buy. Error should be thrown saying invalid user.

Why is Data Driven Testing Used?

In data driven testing, multiple sets of data can be run against a single test case. Thus the same software can be tested against a wide data range of data with minimal code. So the code developed once can be reused.

A data driven testing framework allows running test cases multiple times without increasing their numbers. Sometimes, test data is generated automatically and this allows the software to be tested against random inputs. Testing such scenarios, ensures a more robust and quality software.

Different Data Driven Testing Methodologies

The different data driven testing methodologies are listed below −

  • Data in Excel − In this type of data driven testing, multiple sets of test data is maintained in the excel workbook.
  • Keyword in Excel − The data driven testing which is driven by the keywords is used here. The keywords stand for the actions that are to be performed on the software. This is done primarily to separate the coding from the data. In future, if there is a change in the data, then the code need not be touched and vice versa.
  • Data in XML − In this type of data driven testing, multiple sets of test data is maintained in the XML files.

Conclusion

This concludes our comprehensive take on the tutorial on Software Data Driven Testing. We’ve started with describing what is software data driven testing, advantages of data driven testing, disadvantages of data driven testing, practical example a data driven testing, why is data driven testing used, and different data driven testing methodologies.

This equips you with in-depth knowledge of Software Data Driven Testing. It is wise to keep practicing what you’ve learned and exploring others relevant to Software Testing to deepen your understanding and expand your horizons.

Advertisements