A-level Computer Science revision · Programming

Debugging and IDE features

The idea

An IDE helps write and debug programs. Features include syntax highlighting, auto-completion, error diagnostics, breakpoints (pausing execution), stepping through code line by line, watch windows (tracking variable values) and a translator. Syntax errors break language rules; logic errors give wrong results.

  1. Syntax error: code will not translate.
  2. Logic error: runs but gives wrong output.
  3. Use breakpoints, stepping and watches to find logic errors.

Watch out A program that runs without crashing can still contain logic errors.

See it worked

Worked example

How does a breakpoint help debugging?

  1. Execution pauses at a chosen line.
  2. The programmer inspects variable values.
  3. They can see where values go wrong.

Answer It pauses execution so variables can be inspected

Your turn

Question 11 mark

A program calculates the average but divides by the wrong number. What kind of error is this?

Choose one
Question 21 mark

Which IDE feature shows the values of chosen variables as a program runs?

Choose one
Question 32 marks

Explain one way a trace table helps find errors.

Write your answer, then see a model answer
  1. Describe the table.
  2. Explain how errors show up.

Answer It records the value of each variable after each step, so the programmer can see exactly where values differ from what is expected.

A-level Computer Science Pro, OCR H446

A-level Computer Science Pro

£119 once

Price rises to £199 on 1 January. Save £80 by joining before then.

At least 12 months of access

By paying you agree to our Terms and get access straight away, which ends your 14-day cancellation right.

No VAT is charged.

Independent practice for OCR A-level Computer Science (H446), not endorsed by OCR.

Privacy · Terms