What is Test Data?
Test data is a commonly used term in a tester’s day to day life. While executing test cases, he needs some data to input in order to get the expected output. Sometimes to load the application with data (Load testing) or to check the break point (Stress testing) of the application, huge data is required. This data can be valid or invalid. So in short, Test data is data which is required in executing the test cases properly and to verify the expected output in any software application under test.
Why it is important?
Importance of test data can be understood by this example, say you want to test mobile software applications. Mobile has many different applications so to test them you need different input data such as photos of different formats, music files supported and unsupported formats, Videos file, Contacts files, Different emails etc. these are all Test Data. Without this test data tester cannot proceed with testing and also won’t get desired output.
Types of Test Data:
Test data can be classified into following type:
- Blank files or no data refers to those files which do not have any data i.e. no input is given to the application and this verifies that application handles such exceptions and throws proper error.
- Valid set of test data refers to the valid or supported files by the application. These should give the expected output when given as input.
- Invalid set of test data refers to all the unsupported file formats in order to see that application handles all of them properly without breaking and warns user with proper error message.
- Huge test data for Load, Performance and Stress testing cannot be made at the time of execution and should be prepared while making your test environment ready. For example, in order to load an application, sometimes tester needs 10000 different format files and this can be either done by automated script or with already available test data.
- Test data to check all the boundary conditions includes data which has all possible combinations of boundary values. For example, if a text box can have number 2-20 then input 2 (minimum) and then 20 (maximum) values. Boundary values basically include all those values which are just enough to handle by the application, if tester go beyond them then application will break.
Ideal test data is the one which has all the combinations of data so that no major defects are missed.
Tips and Tricks to Create Test data:
Below are some of the tips and tricks to create test data:
- Always make sure that Test data files are not corrupted. This can leads to invalid output and might miss important defects as well.
- Test Data should be updated on a regular basis. This will give a clear picture of expected output.
- Test data should be created before test cases execution to save time and meet deadline.
- It is a good practice to use some automation tool to create huge amount of test data as manual effort in creating such data would be more and also it will be time consuming.
- Test data should have invalid inputs to test negative scenarios.
- Tester can take developer’s help to create test data.
- It is always a better practice to include all possible combinations of supported and unsupported formats in test data to ensure that test coverage is maximum.
Let’s take a very basic example of creating a test data for a new user on the “create user screen” of a web application. So this screen will have some text boxes such as First Name, Last Name, Gender, Birthdate, Email ID, Address, Phone number, Password and Confirm Password.
Now to create Test data for such an application, we need to check which mandatory fields cannot be left blank and which can be skipped. Invalid inputs could be if user puts other alphabets than “M” and “F” in gender field or instead of number if he puts alphabets in phone number field. Boundary could be entering more than 10 digits in phone number. So in above case, test data will have valid values, invalid values, boundary conditions and blank data.
Below is one of the sample test data which can be used as a reference for above example:
You can see above template has all the combinations of valid, invalid, blank and boundary values.
Over to you on Test Data:
Test data is one of the most important part of test environment set up without which execution of test cases would be difficult. It is nearly impossible to do load, performance and stress testing without using test data. Test data can be manually created or can be done with the help of automation. It should be created such as test coverage is maximum and updated regularly according to the latest requirements and test cases.
Do share your experiences with creation of test data in the comments below.