An important task in the testing process is determining the optimal number of test cases that insure a good coverage and reasonable test resources consumption.
Consider a shopping cart page where there is an input box that specifies the quantity ordered. Assume there is a one digit input box that accepts valid numerical values between 0 and 9.
In order to exhaustively test this input box we need to test how the software responds to any data the user may enter using the keyboard, which includes:
We need at least 68 test cases in order to test a simple one digit input box. If we consider these test cases in the context of all controls in the shopping cart page (drop down lists with inventory selection, product characteristics, etc) the number of test cases required to test one single page gets out of control.
The question is: how do we build the test cases so that they are representative?
There are four specification-based techniques for defining and building an optimal number of test cases: