Practice Flashcards
Flip to reveal answersWhat are the three kinds of error?
Track your progress — Sign up free to save your progress and get smart review reminders based on spaced repetition.
All 5 Flashcards — Debugging
Sign up free to track progress and get spaced-repetition review schedules.
Question
What are the three kinds of error?
Answer
Syntax errors stop the program running at all. Run-time errors stop it partway with a message. Logic errors let it run perfectly and produce the wrong answer — and only the third needs debugging.
Question
Name the four debugging techniques and what each is for.
Answer
Trace table: work through by hand, no tools needed — the exam method. Print statements: show a value at a chosen point. Breakpoints: pause and inspect every variable. Step-by-step execution: run one line at a time and watch values change.
Question
What is the method for narrowing down a bug?
Answer
Write down what you expected for one specific input; find the first value that is wrong, halving the search each time; look only at the lines that set that value; then change one thing and test again.
Question
Where do logic errors usually hide?
Answer
At the boundary: an empty list, a single item, the first and last positions, and values that are exactly equal. If a program is wrong, test the boundary before anything else.
Question
Why change only one thing at a time?
Answer
If the change works, you know which change fixed it. If it does not, you have not added a new set of suspects to investigate.
Read the notes
Full study notes for Debugging
Topic 6.1 hub
Programming fundamentals
More from Topic 6.1
All flashcards in this topic
Computer Science exam skills
Paper structures & tips
Track your progress with spaced repetition
Sign up free — Aimnova tells you exactly which cards to review and when, so you remember everything before your IB exam.
Start Free