Introduction
Testing can be very repetitive, not only because we must run the same test over and over again, but also because many of the tests are only slightly different. For example, we might want to run the same test with different test inputs or test conditions and verify that the actual output varies accordingly. Each of these tests would consist of the exact same steps; however, what differs is the test data.
We can use the data-driven approach to achieve this. The data-driven testing approach is a widely used methodology in software test automation.
We will use the BMI calculator application as an example to understand the data-driven testing approach. The Body Mass Index (BMI) is a measurement of body fat based on height and weight, which applies to both men and women between the ages of 18 and 65 years. BMI can be used to indicate whether you are overweight, obese, underweight, or normal. The following tables show the various BMI categories:
Category |
BMI range |
---|---|
Underweight |
Less... |