One of the most difficult questions to answer when testing a program is determining when to stop, since there is no way of knowing if the
error just detected is the last remaining error. In fact, in anything but a small program, it is unreasonable to expect that all errors will eventually be detected. Given this dilemma, and given the fact that economics dictate that testing must eventually terminate, you might wonder if
the question has to be answered in a purely arbitrary way, or if there are some useful stopping criteria. The completion criteria typically used in practice are both meaningless and counterproductive. The two most common criteria are these:
1. Stop when the scheduled time for testing expires.
2. Stop when all the test cases execute without detecting errors; that is, stop when the test cases are unsuccessful.