aimnova.
DashboardMy LearningPaper MasteryStudy Plan

Aimnova site navigation

Stay in the loop

Get the latest study resources and updates

New features, study tips and exam insights — straight to your inbox.

IB Diploma

  • IB Past Papers
  • IB Study Notes
  • IB Question Bank
  • IB Mock Exams
  • IB Revision

IB Subjects

  • IB Math AA
  • IB Math AI
  • IB Economics
  • IB Business Management
  • IB Physics
  • IB Biology
  • View all IB subjects→

IB Past Papers

  • IB Math AA HL Past Papers
  • IB Math AA SL Past Papers
  • IB Math AI HL Past Papers
  • IB Math AI SL Past Papers
  • IB Economics HL Past Papers
  • IB Economics SL Past Papers
  • IB ESS Past Papers
  • View all past papers→

Study Resources

  • Study Notes
  • Question Bank
  • Mock Exams
  • Flashcards
  • Revision Guide
  • Exam Skills
  • Command Terms
  • Grade Calculator
  • Exam Timetable 2026

Aimnova

  • Features
  • Pricing
  • For Schools
  • For Parents
  • About Us
  • Blog
  • Contact
aimnova.

AI-powered study platform for smarter revision, past-paper analysis and examiner-style feedback.

TermsPrivacyCookies·© 2026 Aimnova. All rights reserved.8afc4e3

Aimnova is not affiliated with or endorsed by the International Baccalaureate Organization (IB).

NotesComputer Science HLTopic 6.1Debugging
Back to Computer Science HL Topics
6.1.46 min read

Debugging (Computer Science HL)

IB Computer Science • Unit 6

IB exam ready

Study like the top scorers do

Access a smart study planner, AI tutor, and exam vault — everything you need to hit your target grade.

Start Free

Contents

  • Finding the difference between expected and actual
  • The four techniques
  • A method for narrowing down
  • Exam-style question
The big idea: A program that runs but gives the wrong answer has a logic error, and the computer cannot tell you where it is.

Debugging is narrowing down where the values first stop being what you expected.
Three kinds of error: Syntax — the code will not run at all; the editor usually points straight at it.

Run-time — it stops partway, with a message naming the problem.

Logic — it runs perfectly and produces the wrong answer. This is the one that needs debugging.

Free preview

This is the free notes preview

You're reading the free notes. Aimnova Pro unlocks the full study experience — and you can try it with your first topic free to keep:

  • FlashcardsLock in vocabulary and key terms with spaced repetition.
  • Practice questionsAnswer exam-style questions and get instant AI marking.
  • Mock exams & past-paper vaultSit full mocks and see exactly how examiners award marks.
  • Personalised study planA daily plan built around your exam date and weak areas.
Start Studying Free Full access to Aimnova Pro · cancel anytime
1

Trace table — on paper

2

Print statements

3

Breakpoints

4

Step-by-step execution

The trace table is the exam technique: Breakpoints need software. A trace table needs a pen.

So when a question gives you code and asks what is wrong, the intended method is nearly always to trace it by hand.

Get feedback like a real examiner

Submit your answers and get instant feedback — what you did well, what's missing, and exactly what to write to score full marks.

Try AI Tutor FreeYour first topic is free to keep • No credit card required
1

1 — Say what you expected

2

2 — Find the first wrong value

3

3 — Look at what changes it

4

4 — Change one thing, then test

Test the boundary first: Most logic errors show up at the edges: an empty list, a single item, the first and last positions, values that are exactly equal.

If a program is wrong, try the boundary before anything else.

How this is tested — you must trace the code and say WHICH line is wrong, not just that it is. It comes up two ways:

Paper 2 — working with code

  • Identify the error in a program and correct it, 3-5 marks
  • Complete a trace table for faulty code
  • Name a debugging technique and say what it finds

Paper 2 — the algorithmic-thinking question

  • Reason about where a described program goes wrong
  • Explain how you would narrow it down
The classic trap: Rewriting the whole program. The question asks which line is wrong and what it should be — a full rewrite usually loses marks even when the new version works.
IB-style questionIdentify[5 marks]

This should print the largest of a list but prints 0 for a list of negative numbers. Find the error.

largest = 0 for value in numbers: if value > largest: largest = value print(largest)

Model answer plan

See the mark-by-mark plan — for / against / judgement, with marking guidance — in study mode.

Claim your free topic
IB-style questionIdentify[5 marks]

This should print the largest of a list but prints 0 for a list of negative numbers. Find the error.

int largest = 0; for (int value : numbers) { if (value > largest) { largest = value; } } System.out.println(largest);

Model answer plan

See the mark-by-mark plan — for / against / judgement, with marking guidance — in study mode.

Claim your free topic

Try an IB Exam Question — Free AI Feedback

Test yourself on Debugging. Write your answer and get instant AI feedback — just like a real IB examiner.

the term debugging. [1 mark]

Related Computer Science HL Topics

Continue learning with these related topics from the same unit:

6.1.1Variables and data types
6.1.2Substrings
6.1.3Exception handling
6.2.1Static vs dynamic structures
View all Computer Science HL topics

Improve your exam technique

Command terms, paper structure, and mark-scheme tips for Computer Science HL

Previous
6.1.3Exception handling
Next
Static vs dynamic structures6.2.1

20 exam-style questions ready for you

Students who practice on Aimnova improve their scores by 15% on average. Get instant feedback that shows exactly how to improve your answers.

Practice Now — FreeView All Computer Science HL Topics