The chapter in short
Testing checks that software works as intended; debugging finds and fixes the causes of errors. Both are essential to reliable software.
The chapter covers types of errors, testing levels and methods, test cases, debugging techniques and tools.
Syntax errorLogic errorUnit testingBlack-box testingDebuggingBreakpoint
Key points
- Errors are syntax, runtime or logic errors.
- Unit testing checks small parts; integration testing checks parts working together.
- Black-box testing checks inputs and outputs; white-box testing checks internal logic.
- Good test data includes normal, boundary and invalid values.
- Debugging uses print statements, breakpoints and step-through execution.
- Fixing one bug can create another, so retest after every change.
Definitions
- 1
Syntax error
An error in the structure of code that stops it running.
- 2
Logic error
An error that gives wrong results without crashing.
- 3
Unit testing
Testing individual parts of a program.
- 4
Black-box testing
Testing without looking at the internal code.
- 5
Debugging
Finding and fixing errors in code.
- 6
Breakpoint
A point where a debugger pauses a program.