Back to Topic 6.1 — Programming fundamentals
6.1.4Computer Science SL5 flashcards

Debugging

Practice Flashcards

Flip to reveal answers
Card 1 of 56.1.4
6.1.4
Question

What are the three kinds of error?

Click to reveal answer

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.

Card 1definition

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.

Card 2definition

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.

Card 3process

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.

Card 4concept

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.

Card 5concept

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.

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