Identifying and Correcting Errors Unit 1.4
Notes on College Board 1.4 Identifying and Correcting Errors and quiz
1.4 College Board Video Notes
1.4.1
- Errors are innevitable in programming
- In errors in an algorithm or program, there are 4 types of errors:
- Logic Error:A mistake in the algorithm that causes it behave incorrectly or unexpectedly
- Syntax Error: A mistake in the program where the rules in the programming language are not followed
- Run-time error: Mistake in the program that occurs during the excecution of the program. Dependent on the language. Usually refered to as a bug.
- Overflow error: error that occurs when a computer attempts to handle a number that is outside of the defined range of values.
1.4.2
- Understanding how to correct errors is essential to programming
- Best ways to correct errors
- Test cases
- Hand tracing
- Visualizations
- Debuggers
- adding extra output statements.
- The syntax error is usually the easiest error to fix
- it tells the programmer which line and what the error was.
- Logic errors are difficult to find and fix.
1.4.3
- Programmers should come up with testing schemes to ensure that their program works.
- Identify inputs and correspondng exprected outputs or behaviors check the correctness of the algorithm or program.
- Defined inputs used to test a program should demonstrate the different exprected outcomes that are at or just beyond the min and max of input data
- Program requirements identify appropriate defined inputs for testing.
- As soon as they start programming, they should constantly be testing.