1.4 Identifying and Correcting Errors

Enduring Understanding

Developers create and innovate using an iterative design process that is userfocused, that incorporates implementation/feedback cycles, and that leaves ample room for experimentation and risk-taking.

Learning Objective

For errors in an algorithm or program:

a. Identify the error.

b. Correct the error.

Essential Knowledge

A logic error is a mistake in the algorithm or program that causes it to behave incorrectly or unexpectedly.

A syntax error is a mistake in the program where the rules of the programming language are not followed.

A run-time error is a mistake in the program that occurs during the execution of a program. Programming languages define their own run time errors.

An overflow error is an error that occurs when a computer attempts to handle a number that is outside of the defined range of values.

The following are effective ways to find and correct errors:

  • test cases

  • hand tracing

  • visualizations

  • debuggers

  • adding extra output statement(s)

Learning Objective

Identify inputs and corresponding expected outputs or behaviors that can be used to check the correctness of an algorithm or program.

Essential Knowledge

In the development process, testing uses defined inputs to ensure that an algorithm or program is producing the expected outcomes. Programmers use the results from testing to revise their algorithms or programs.

Defined inputs used to test a program should demonstrate the different expected outcomes that are at or just beyond the extremes (minimum and maximum) of input data.

Program requirements are needed to identify appropriate defined inputs for testing.

Last updated