大象传媒

Develop code - EdexcelDealing with errors - debugging

Programs must run correctly or they are of little value. The careful planning and testing of a program is essential, as is writing maintainable code which assists future updating.

Part of Computer ScienceApplication of computational thinking

Dealing with errors - debugging

When an error or bug has been identified, it needs to be corrected. Errors can often be fixed when program code is being written, and usually provide tools which help identify these errors.

Typical tools are:

  • Single-step - programmers can step through the program one at a time. The values of can be seen as they are processed and errors identified.
  • Set break points - when the program is halted and the programmer can investigate the values of variables in the previous instructions. This is useful when the programmer suspects that the error is in a section of the program.
  • Watchers - enable the programmer to watch for things like variables and program flow.

Be sure to be familiar with the debugging tools in the programming language used.