> For the complete documentation index, see [llms.txt](https://www.csprinciples.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.csprinciples.com/big-idea-1/1.4-identifying-and-correcting-errors.md).

# 1.4 Identifying and Correcting Errors

## Enduring Understanding

Developers create and innovate using an iterative design process that is userfocused, 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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://www.csprinciples.com/big-idea-1/1.4-identifying-and-correcting-errors.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
