Errors

It is important that software always works correctly. Some programs may seem to perform well for years then a particular piece of data may cause an error to occur! Programs can generally not be tested completely but enough tests can be performed to give us reasonable confidence that it works.

Subroutines should be tested individually. A 'test harness' - a program which tests the modules can be coded and run. Once tested, the subroutine may then be stored in a library and confidently used in many different programs.

Program errors may be

syntax errors Using the syntax of the language incorrectly
  eg Spelling mistake such as prunt(message);
  or  
  assigning data of the wrong type to a variable.
    Surname = 12.5
logical errors The program compiles successfully but does not perform correctly.
  eg TotalAmount = Amount + Discount
    instead of
    TotalAmount = Amount - Discount

Translation errors occur when the program is being compiled (usually syntax errors).

Linking errors may occur if a compiled program is linked to library routines. For example, a subroutine may not be present in the library.

Execution errors (Run-time errors) occur when the program is being run (usually logical errors).