AS Level · Topic 5.2
A-Level Computer Science 9618 / Topic 5 / AS

One window, every tool.

An Integrated Development Environment puts an editor, a translator and a debugger in one place. Learn the features the syllabus names for coding, initial error detection, presentation and debugging, and how to describe each one well enough to earn the mark.

The key idea

An Integrated Development Environment (IDE) is a single program containing the tools needed to write, translate, test and debug code. For coding it gives context-sensitive prompts (auto-complete). For initial error detection it carries out dynamic syntax checks as code is typed. For presentation it provides prettyprint and expanding and collapsing code blocks. For debugging it provides single stepping, breakpoints, the ability to watch variables and expressions, and a report window.

IDE Run Step Stop ⊟ 1FORi ← 1 TO 4 2Total ← Total + i 3OUTPUTTotl 4NEXTi Watch window i 2Total 3 Line 3: identifier Totl not declared (dynamic syntax check) Report window / error diagnostics ● breakpoint on line 2 highlight: next line to run (single stepping) ⊟ expand / collapse block colour coding = prettyprint
Fig. 1: typical IDE features: prettyprint, collapsible blocks, a dynamic syntax check, a breakpoint, single stepping and a watch window
Section 01

Coding and error detection.

These features help while the code is being typed, before it is ever run.

FeatureWhat it doesWhy it helps
Context-sensitive promptsas the programmer types, the editor suggests keywords, identifiers already declared, and the parameters a function or procedure expects, based on what is being typed and wherefaster coding; fewer spelling errors in identifiers; the programmer does not need to remember every parameter
Dynamic syntax checksthe code is checked for syntax errors as each line is typed, and errors are underlined or highlighted straight away, e.g. a missing ENDIF or an undeclared identifiererrors are found and fixed immediately, before translation, so less time is spent on compile errors later
Examiner trap

A dynamic syntax check finds syntax errors only. It cannot find a logic error, such as using < where <= was needed: that needs testing and the debugging tools.

Section 02

Presentation features.

Code is read far more often than it is written. Presentation features make it easier to read and navigate.

PROCEDURE ShowGrade(Mark : INTEGER)
    IF Mark >= 50
        THEN
            OUTPUT "Pass"
        ELSE
            OUTPUT "Fail"
    ENDIF
ENDPROCEDURE
Examiner trap

Prettyprint does not change what the program does. It only changes how the code is displayed to make it more readable.

Stage 1 · Learn

Check what the sim just showed you

Four quick checks. Each correct answer earns XP and records this skill on your profile.

Quick check+10 XP

What is a context-sensitive prompt?

Quick check+10 XP

When does a dynamic syntax check find an error?

Quick check+10 XP

In the lab, what do you see after each single step?

Quick check+10 XP

Which feature lets a programmer hide a finished procedure to focus on other code?

Section 03

Debugging tools.

When a program runs but gives the wrong result, debugging tools let you watch it run. In the lab, step through a program one line at a time and watch every variable change in the trace table: this is exactly what single stepping and watched variables do in an IDE.

Worked example Find the logic error
This program should output the average of five marks. With the marks 6, 8, 5, 9 and 7 it outputs 5.6 instead of 7. Describe how IDE debugging tools could be used to find the error.
Total ← 0
FOR Index ← 1 TO 4
    Total ← Total + Marks[Index]
NEXT Index
Average ← Total / 5
OUTPUT Average
  1. Expected total: 6 + 8 + 5 + 9 + 7 = 35, and 35 / 5 = 7. The output 5.6 means Total was 5.6 × 5 = 28.
  2. Set a breakpoint on the line Average ← Total / 5 and run. The program pauses there; the watch window shows Total = 28, not 35, so the error is in the loop.
  3. Run again and single step through the loop, watching Index and Total: they go (1, 6), (2, 14), (3, 19), (4, 28), then the loop ends.
  4. Index never reaches 5, so Marks[5] = 7 is never added. Correct the loop to FOR Index ← 1 TO 5 (35 / 5 = 7).
Answer: Breakpoint plus watch shows Total = 28; single stepping shows the loop stops at Index = 4. Fix: FOR Index ← 1 TO 5.
Your turn
Explain the difference between single stepping and using a breakpoint.
Stage 2 · Exam

Exam-style questions

Unlocks once the four checks above are done. Worth more XP, written to AS Paper 1 and Paper 2 standard.

Finish the four checks above to unlock the exam questions
Exam style+20 XP

Which IDE feature pauses execution at a chosen line so variable values can be inspected?

Exam style+20 XP

Which IDE feature is used for presentation?

Exam style+20 XP

Why can a dynamic syntax check not find every error?

Exam style+20 XP

A program gives the wrong total. Which pair of features is most useful to find why?

Skill unlocked

IDE features, debugged.

This skill is now recorded on your profile. Keep the chain going.

-Rank -Level -Score -Topics
Go deeper · practice
Six original Cambridge-style questions
Context-sensitive prompts, dynamic syntax checks, prettyprint, expand and collapse, single stepping, breakpoints, watch and report windows.