Photo by Mika Baumeister on Unsplash

Test Data Preparation Techniques

Types of test data and top 5 test data preparation techniques with pros and cons

Many organizations are trying to implement agile methodologies that require rapid access to appropriate test data. But generating test data is not an easy task. Test data preparation helps to assure sufficient test coverage.

Test data commonly include the following types

  • No data: Verify the system returns a proper response when the field is left empty
  • Null Data: Verify the system returns a proper response when the field value is passed as “NULL”
  • Default data: Verify the system’s behavior on default data
  • Valid test data: Also known as positive testing. It is necessary to verify the system is working as expected with valid data.
  • Invalid test data: Proper response or error messages in the case for invalid data
  • Boundary test data: Prepare test cases for upper and lower boundary conditions.
  • Equivalence Partition Data Set: Test data qualifying the equivalence partitions.
  • Decision Table Data Set: Test the data based on the decision table testing strategy

Test data creation techniques

Some of the ways to generate test data are below:

1. Manual Test Data Generation

  • Adding data from the admin panel
  • Creating data using POST method
  • Using FE of the application to create data e.g making a dummy order from the FE (website or app)
  • Data mocking

a) This technique does not require any additional resources.
b) The test team is not dependent on any other team and can create the data using their own skills and judgments.
a) The technique is time-taking especially if you need a large data set.
b) The person entering the data must have domain knowledge.

2. Back-end data injection

This is done by inserting data into the database using DB queries. CURD operations can also be done using this technique.

a) A huge volume of data can be quickly available
b) Quickly inject data into the system
a) It requires expert knowledge of the data flow in the DB
b) Risk of database and application getting corrupted is high. Therefore, it's important to have a proper database backup
c) Data insertion into complex databases systems may require additional help from database administrator

3. Importing Data

  • Importing data from production to testing environment
  • Importing subset of data from production to testing environment
  • Importing data from one testing environment to another

a) Testers get to test data similar or closely similar data as in Production environment
b) Can get a huge volume of data in less time as compared to manually entering the data
a) It might need additional technical expertise to abstract data to be dumped into test environments
b) Can be time taking depending upon the volume of the data
c) If more than one teams are using the same environment, there might be a conflict for the downtime
d) Risk of getting the environment not working properly after the data import

4. Automated Test Data Generation

This is done with the help of data generation tools which can accelerate the process for generating the high volume of data. One of the common tools that are used in this technique is selenium and web services APIs.

a) The main advantage of this approach is its better speed
b) Once the process has been automated it can be performed without the need for human intervention
c) If one requires thousands of data, this technique can be scheduled to run during nonworking hours to save time
a) It comes at a higher cost than manual test data generation , as in order to automate the data generation process, the person needs to have requisite skill and domain knowledge as well
b) Automating the process itself can be a time taking process and requires regular udpates

5. Third-Party Tools

Third-party tools are a great way to create data. These tools can insert similar or real-time data into the system which makes diverse data available in high volume for the testers.

a) Easily available in the market
b) It offers accuracy of the data
c) These tools don't require to have domain knowledge and expertise in the tool.
a) They are quite costly
b) Their limited use to a specific type of system, application, or data.

For any kind of suggestions, feedback or queries please feel free to contact me on my email address



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store