← IGCSE Computer Science Paper 1

IDE function: error diagnostics

An IDE tool that finds errors in code and tells the programmer where they are and what kind they are, using line numbers, error messages, highlighting and debugging tools.

Understanding IDE function: error diagnostics in IGCSE Computer Science Paper 1

What it does: Breakpoints are debugging tools in error diagnostics that stop the program at a chosen line so values and behaviour can be examined. Error diagnostics find and report errors. They show the location and type of the error, but the programmer still has to fix it. An error message explains the problem, for example a syntax error such as a missing bracket. Underlining or highlighting marks the faulty code so it is easy to spot.

Common mistakes: The string is missing its closing quote. An IDE's error diagnostics would underline this line and report a syntax error. It should be message = "Missing colon". The closing bracket of print() is missing, so the brackets do not match. The IDE would flag this line as a syntax error. It should end with two brackets: len(errors)).

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 440–449) and word search (Modules 440–463).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
What does the error diagnostics tool in an IDE do?
Automatically rewrites the whole program so that it has no errorsFinds errors in the code and tells the programmer where they are and what kind they are
Matches
Error diagnostics automatically rewrite the code so it is correct
↓
Error diagnostics only find and report errors (where and what kind); they do not fix the code or write the program for the programmer
Applying
Meanings
Term
error diagnostics
Meaning
An IDE tool that finds errors in code and tells the programmer where they are and what kind they are, using line numbers, error messages, highlighting and debugging tools.
Practice
Line 3: SyntaxError - missing bracket )
Testing
Gaps
Error on 1: invalid syntax
Check Answer
Spots
1error_line = 12
2message = "Missing colon

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Space Turtle' badge — Speed in Zero-G, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. What does the error diagnostics tool in an IDE do?
A. Automatically rewrites the whole program so that it has no errors
B. Finds errors in the code and tells the programmer where they are and what kind they are ✓
Error diagnostics find and report errors. They show the location and type of the error, but the programmer still has to fix it.
2. An IDE reports 'Error on line 12'. Which part of error diagnostics is this?
A. The auto-completion of the code
B. The line number of the error ✓
The line number tells the programmer where in the code the error is, so they can go straight to it.
3. An IDE shows the message 'Missing closing bracket'. What does this tell the programmer?
A. What kind of error it is and what the problem is ✓
B. How fast the program will run
An error message explains the problem, for example a syntax error such as a missing bracket.
4. A line of code is underlined in red in the editor. What is the IDE doing?
A. Highlighting faulty code so the programmer can see where the error is ✓
B. Showing that the line has been saved
Underlining or highlighting marks the faulty code so it is easy to spot.
5. Which tool lets a programmer pause a program at a chosen line so they can check what is happening?
A. A breakpoint ✓
B. A prettyprint
A breakpoint is a debugging tool that stops the program at a chosen line. Prettyprint only changes the layout and colours of the code.

Match the Pairs

Error on line 12: missing colon → The IDE reports the line number of the error and a message explaining the problem
print("Total: " + score → The IDE underlines or highlights this faulty code, for example the missing closing bracket
A breakpoint pauses the program at a chosen line so the programmer can check what is happening → Breakpoint set on line 8
Stepping through runs the program one line at a time so the programmer can find where the error happens → Step through: line 5, then line 6, then line 7
Error diagnostics automatically rewrite the code so it is correct → Error diagnostics only find and report errors (where and what kind); they do not fix the code or write the program for the programmer
Error message: "Something is wrong" → This message has no line number and does not say what kind of error it is, so it does not diagnose the error well

Key Term

error diagnostics
An IDE tool that finds errors in code and tells the programmer where they are and what kind they are, using line numbers, error messages, highlighting and debugging tools.

Fill in the Blanks

1. print("Score: " score) Error on line 1: invalid syntax
Hint: Type the word that tells the programmer where in the code the error was found.
2. for i in range(5) SyntaxError: expected ':'
Hint: Type the name of the kind of error shown in the error message when code breaks the language rules.
3. Set a breakpoint on line 3 to pause the run
Hint: Type the debugging tool that pauses a program at a chosen line so you can inspect it.
4. Debugger: step through the code line by line
Hint: Type the verb for running a program one line at a time to find where it goes wrong.
5. Faulty code is underlined in red by the IDE
Hint: Type the word for a line drawn beneath code to highlight an error.

Spot the Error

Question 1
A error_line = 12
B message = "Missing colon
C print("Line", error_line)
D print("Error:", message)
Line B — The string is missing its closing quote. An IDE's error diagnostics would underline this line and report a syntax error. It should be message = "Missing colon".
Question 2
A errors = ["line 3", "line 8"]
B for e in errors:
C print("Problem at", e)
D print("Total:", len(errors)
Line D — The closing bracket of print() is missing, so the brackets do not match. The IDE would flag this line as a syntax error. It should end with two brackets: len(errors)).
Question 3
A def show_error(line, text)
B print("Line", line)
C print("Message:", text)
D show_error(5, "Bad name")
Line A — A function definition must end with a colon. Without it the IDE reports a syntax error on this line. It should be def show_error(line, text):
Question 4
A error_count = 3
B if error_count = 0:
C print("Fix errors first")
D else:
E print("Ready to run")
Line B — A single = assigns a value, so it cannot be used as a condition. The IDE reports a syntax error here. The condition should be a comparison such as error_count > 0.
Question 5
A total = 0
B for n in rnage(1, 4):
C total = total + n
D print("Total:", total)
Line B — range is misspelt as rnage. The program stops with a run-time error saying the name is not defined, and the IDE reports the line number. It should be range(1, 4).

Student with a class code? Join your class →