What does logic error mean?
The program runs without complaint but does the wrong thing, because the instructions do not say what the programmer meant. The hardest kind to find, because nothing reports it.
In a lesson
No red text, and it even printed "arrived". But the robot went the wrong way. Python did exactly what the program said; the program said the wrong thing. The only way to find a logic error is to test: know what should happen, watch what does, and compare. Watching the robot is part of debugging.
Learn it
- Taught in F1.4 Errors: syntax, runtime and logic Programming basics, GCSE
Used in
- F1.7 Input from the user
- F2.7 Loop patterns
- F5.4 Trace tables
- F6.4 Debugging logic errors
- F6.6 The IDE
- A14.5 Testing strategies
- A14.6 Software engineering tools and version control
- A15.5 Writing algorithms and code in the exam