User Input Verification?
CSC 205/206
Professor Stearns
User Input Verification is complex for two major reasons:
- User differences
Some users are invested in the input; they are entering
their own data and care that it is done correctly. Other users
are minimum-wage data entry workers who can't wait to go home.
The latter type of users have a high error rate (20% is an oft-quoted number)
- Range checks may be impossible
There is no easy way to distinguish between a correctly entered grade (e.g. 84)
and an incorrect grade (e.g. 81).
There are some basic principles that will increase the accuracy of
user-entered data. It is rarely (never?) acceptable to assume the
user will enter valid data.
- Enter data twice and cross check them.
This is standard industry practice for uninvested users; make this a
requirement if you are specifying a system with such users.
- Do type checks
If a number is input, verify that it is a valid number.
Specify valid numbers in the data dictionary.
Fundamental rule: read all input as a String and convert
it to the proper type. All class libraries provide conversion
and error-checking code; don't do it yourself! (e.g. see the
parseInt method in
Java.lang.Integer).
- Do range checks
This is obvious but often ignored. Be sure to specify ranges in the
data dictionary. Don't forget the
8-day week story.
- Get human feedback
Provide a feedback mechanism for data validation. For example, you
can verify a mailing list by mailing something and asking recipients to
check their data.
- Confirmation Box
Ask the user to confirm the input data. Although commonly used,
such a confirmation may have little effect on accuracy because
users tend to press OK spontaneously.
- Verify computed result
Use the data to compute some known result; then validate the
correctness and range of the result. If the computed result is
bad, it is likely due to bad input.
- Data cleaning
If there is a large batch input file (e.g. bank check records), it
may be desirable to "clean" the input data by removing suspect records
for human inspection. The purpose is to keep bad records from entering
the system at all.
Final Note
Ensure that errors messages are visible, clear and non-threatening!
Use only problem-domain words!
Last updated on 5/2/00