Software is deemed to be robust if it can cope with unexpected or incorrect input.
Programs are likely to encounter incorrect or unexpected data:
- because of user error
- when they receive incorrect data from external files
Input validation algorithms should include clear error messages so that users are able to understand what they need to do to enter acceptable data.
If accepting data from within a range, it is important to test normal, exceptional, and extreme data.
When testing exceptional data, it is good to get into the habit of testing the values just outside the acceptable range, as programs that are not robust may accept data just outside the extremes.