Library › Computer Science 0478 › Identifying Errors
O Level · Computer Science 0478

Identifying Errors

Revise Identifying Errors for Computer Science 0478 (O Level) — revision notes and instant AI marking.

📖 Revision notes · preview
Cambridge IGCSE 0478 · Computer Science

Identifying Errors

Syntax, Logic & Runtime Errors — plus Algorithmic Thinking

Big idea: every mistake a program makes falls into one of three buckets — it won't run (syntax), it runs but gives the wrong answer (logic), or it runs and then crashes (runtime) — and once you can tell those apart, you can find and fix almost any bug.

📋 Quick Overview

  • Three error types exist: Syntax errors (grammar mistakes), Logic errors (wrong output), Runtime errors (crashes).
  • Syntax errors stop a program from running at all — think typos, missing brackets, missing colons.
  • Logic errors are the sneakiest — the program runs fine but gives the wrong answer. You need trace tables to hunt these down.
  • Runtime errors happen while the program is running and cause it to crash — like dividing by zero or asking for input the code can't handle.
  • Trace tables are your universal debugging tool — they help you catch all three error types by tracking variables step by step.
  • Algorithmic thinking is the skill of breaking a problem into a precise, step-by-step sequence of instructions using abstraction and decomposition.
  • Exam answers must use exact phrasing: "prevents the program from running" (syntax), "produces incorrect output" (logic), "causes the program to crash" (runtime).

1. Why This Topic Matters

Here's the thing nobody tells you when you start coding: you will never write a perfect program on the first try. Not you, not your teacher, not the engineers who built the app you're using right now. Every programmer spends huge chunks of their time hunting down bugs — and the first skill in hunting a bug is knowing what kind of bug you're even looking for.

Think of it like being a doctor. If a patient walks in, you don't just say "something's wrong" — you first work out: is this a broken bone (obvious, visible, stops them walking), an infection (they seem okay but something's off internally), or a sudden collapse (they were fine, then suddenly weren't)? Each needs a totally different fix. Programming errors work exactly the same way:

Syntax error = broken bone. Obvious. The program won't even start.
Logic error = quiet infection. The program looks fine, runs fine, but something inside is wrong — you only notice because the output is off.
Runtime error = sudden collapse. Everything's going fine, then — crash — the program dies mid-run.

Cambridge IGCSE 0478 tests this constantly, especially in Paper 2, using trace tables and "dry runs" of code. Get comfortable with the three categories and the exact vocabulary examiners want, and this becomes one of the easiest topics to pick up marks on.

2. Syntax Errors

What Is a Syntax Error?

A syntax error is an error that breaks the grammatical rules of a programming language and stops it from running at all. Programming languages are strict about grammar in a way English isn't — English lets you get away with a missing comma, but Python will refuse to even start if you forget a colon.

Practice Question 2.1

Identify the syntax error in this line of code and explain why it stops the program from running:
if age >= 18
  print("You can vote")

Practice Question 2.2

print("Total = " + total) total TypeError

💡 Exam Tip "prevents the program from running"
🔓 Read the full Identifying Errors note → You're seeing the preview · sign in to read it all
Also in the full note
  • 3. Logic Errors
  • 4. Runtime Errors
  • 5. Comparing All Three Error Types
  • 6. Algorithmic Thinking & Writing Algorithms
  • 7. What to Memorise
  • 8. Concepts Checklist
  • 9. Exam Tips & Common Mistakes
  • What Is a Logic Error?
What's inside
📖 Revision notes 🎯 Learn mode ✦ AI flashcards ✓ Instant AI marking 🧊 3D explorers 🧪 Experiments & simulations 📈 Progress tracking
📄 Practise Identifying Errors with Computer Science 0478 past papers Every paper with its mark scheme — answer online, marked instantly. Open →

Read the full Identifying Errors notes free

That's the preview — create a free account to read the rest, plus flashcards and practice questions with instant AI marking. No credit card.

Unlock the full notes free →

More Computer Science topics