A plan that looks right can still be wrong. This topic shows you how to check an algorithm by hand with a trace table, how to recognise the three kinds of error, how to choose test data that finds mistakes, and how to use an IDE and its debugger to run and inspect real Java code.
Key words in this topic
- Trace table: a table that records the value of every variable after each step.
- Syntax, runtime and logic errors: mistakes found by the compiler, by a crash, or by a wrong answer.
- Test case: an input together with the output you expect for it.
- Normal, boundary and invalid data: typical values, values at the edge of a range, and values that must be rejected.
- IDE and debugger: the tool you write code in, and the part of it that lets you pause and inspect a running program.