3.6.2+Error+Detection

Vocabulary:

 * validation;
 * verification;
 * double data entry verification;
 * check digit;
 * parity (even and odd);
 * check sum;
 * hash total;
 * modulo operator;
 * re-input;
 * retransmission;
 * backup

Verification and validation should be understood. Check digits and hash totals should be explained. The use of modulo operations (mod, div) in constructing check digits should be understood.

Errors will cause less effect the earlier they are detected, so it is crucial that error prevention/detection measures are implemented before the data is transmitted, particularly during data input. There are two categories for error-checking methods: **verification and validation**. __Verification:__ is a process that checks whether the data in the source document is exactly the same as the data inputted to the computer (or the data to be transmitted)., and include such proven methods as proof reading and double entry. __Validation:__ is a process that makes sure that the data to be inputted makes sense (i.e follows a certain format), and validation methods include check digits, range checks, picture/format checks, and data type checks.
 * Solution to the errors in 3.6.1 **
 * Validation** also checks for **incomplete** or **inaccurate** data. The main types of validation checks are **range** checks, **type** checks and **format** checks.
 * Range checks** see if numeric data is in the correct range (eg a percentage mark needs to be between 0 and 100).
 * Type checks** check that data is of appropriate type (integer, real or character for example).
 * Format checks** are used to see if the data has the correct length or other internal structure (eg ddmmyyyy).

There are three basic types of errors: logic errors, runtime errors, and syntax errors.
 * Logic errors** are caused by faulty logic/algorithm in the program, and can only be prevented by encouraging programmers to use proven algorithms in their programs.
 * Runtime errors** are caused by unhandled exceptions (such as file not found, illegal memory access, etc.) and can be prevented by making the program as robust (able handle as many possible exceptions as possible).
 * Syntax errors** are caused by bad programming language, and can be prevented by using a compiler before running the program.

__Accidental:__
 * back ups
 * undo buttom
 * auto save
 * good UI (user interface) design
 * dialogs: (example: "Are you sure you want do this...?"

__Software:__
 * test the software before it goes to production
 * handle expected exceptions

__Data Entry:__
 * type checks (number or letters?)
 * check to see if expected elements are included (such as the '@' in an email address)
 * restrict the way that users enters data (example check boxes)
 * give user friendly message errors
 * provide 'Help' in the form of screen documentation

__Hardware:__
 * handle messages from the OS saying the resources are not available
 * give user alternatives when there are some ( example: no space on harddrive (H:) - alternatives harddrive (P:) ! )