When testing it’s crucial to make sure that your test data covers the full range of testing required. During the testing process, often data is required to change. In some instances it can become invalid.
To combat this, we implement a test data strategy to ensure all testing is done with the correct data set. This is fundamental to our approach because if we find issues, we want to ensure that they are valid, and not occurring simply because the data itself that’s used in the testing has become invalid.
The following 9 techniques should underpin your test data strategy:
Ring fence data for automation
In our automated tests, we often have specific hard coded data in order to generate the scenario we are trying to test.
Ring fencing this data is crucial to maintaining a robust automated test suite. This is done because if others are using the data or change it in any way, the automated test may not generate the scenario you are trying to test.
Take database backups in order to replay scenarios
Once you have data set up in the way you need it, consider taking a database backup of the data in case you have to replay the scenarios again. This will save effort in creating the same data set from scratch.
Test stub data
If a test interface is not available, test stubs can be used to give expected results from external systems.
For specific data inputs, these return specific results. Therefore knowing and managing the data being used with test stubs is crucial for results validation and ensuring full scope of test coverage.
Use an email address generator
During our testing, we often run out of valid email addresses very quickly. When this occurs, we use an email address generator, such as Temp Mail.
This is a very useful tool as it enables us to get around rules within the solution where users are only allowed to use one email address per account.
Create difficult addresses to test postcode lookup engines
When testing postcode lookup engines, it’s advisable to try to use addresses that may stretch the system in some way.
This could include using very long addresses, BFPO addresses, local islands and different countries. It may also be useful to compare the results of your postcode lookup tool with another. The Post Office has a website for this.
Consider field validation rules
Field validation rules are important to consider when managing data. This can include:
– What is the maximum field length?
– What are the valid and invalid characters for the field?
– How is the data entered into the field used in other parts of the system?
– What should the error messages trigger?
All of this needs to be considered when managing test data for field validation.
Maintain data integrity (clean, testable data)
Test data must be managed in such a way that it remains clean and clear. As mentioned previously, ring-fencing test data is always strongly advised. It should be clear what the data is, what its purpose is within the testing, and how it should be maintained.
This means that testing always has a reliable data set to test against. If for any reason data gets changed, this can alter test results and may impact the analysis of the results.
There is often the need to also have single use data. One example is gift voucher codes. In these instances there should be a clear way of creating the test data and managing the data throughout its usage.
Secure information / Privacy
In order to meet data protection laws, it is imperative that data used in the test environments is not a copy of production or live data.
Many businesses use obfuscation routines if they take a copy of data from the live environment, in order to manipulate the data and protect its live user base. The alternative to this, is to create your own set of test data.
Consider downstream systems
If your solution has integration points and sends data across to other systems, it is always worth considering the impact of what you are changing and testing, to include some tests to ensure that downstream systems can handle the changes made.
Your test data strategy will be unique to your testing. However, it is important to understand the intricacies of the data you’re testing and the required techniques to manage your test data strategy to ensure valid data, results and conclusions.
by Jamie Lees – check out my LinkedIn page here and say hello 👋
These might interest you
Continuous Testing: the oil for successful software deliveryFor many businesses and software providers, testing is very often seen as an afterthought, or at best, an additional task Read More
A guide to Device testing for Digital Solutions: 13 factors to consider13 Factors to Consider when Testing across Devices When introducing a new website for one of our clients, we face Read More
If you would like to find out more about ISTQB testing techniques, training and enhance the profitability of your business with quality software, get in touch with us today.
+44 (0)114 399 2820