Choosing Testing Data
It is important that you choose test data that simulates a wide variety of usage and especially that you choose data that tests the three types of test data:
- Boundary / Extreme
When White Box Testing, as you have access to the source code, you should ensure that your test data covers all the possible programs paths for that function or module.
In the code above there are 5 possible paths in the program to test and so your test data should probably include values such as:
Normal Data is data that you would usually expect to be input within reasonable bounds.
For a user’s age, you would probably expect a whole number between 10 and 80
Abnormal Test Data
This is test data that you would deem invalid and should be handled appropriately. It is important to use a variety of different invalid data checks.
For a user’s age, you should check:
- Float style input (e.g. 2.5)
- Character input (e.g. twenty five)
- Mixed input( e.g. 25 Years Old)
- Out of bounds input ( e.g. -5 or 300)
- Zero length string input (e.g. “”)
Boundary / Extreme
Boundary / Extreme Test Data
Boundary test data incorporates two main areas:
- The data at the very limits of what is deemed normal, to ensure that is allowed (but perhaps with a warning/notification)
- Data that sites on the boundary between two normal ranges, to ensure that the program branches correctly.
Boundary test data is extremely important as often logical errors can be found are boundaries.
In the code above a subtle error has been included in the code. If the user inputs the temperature as 0, then nothing at all will be printed out. This error would be highlighted if boundary test data is included.