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.
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.
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.
Feature
What it does
Why it helps
Context-sensitive prompts
as 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 where
faster coding; fewer spelling errors in identifiers; the programmer does not need to remember every parameter
Dynamic syntax checks
the 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 identifier
errors 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
Prettyprint: the editor displays code with colour coding of keywords, identifiers, strings and comments, and with consistent indentation, as above. Structure and mistakes (e.g. an unclosed string) are easier to see.
Expand and collapse code blocks: a whole block, such as a procedure, loop or IF statement, can be collapsed to one line and expanded again. The programmer can hide finished sections and focus on the part being worked on, and see the overall structure of a long program.
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.
Single stepping: executes the program one statement at a time, with the next statement highlighted, so the programmer can follow the path through selection and loops.
Breakpoints: a marker set on a line; the program runs normally until it reaches that line, then pauses so the current state can be inspected.
Variables and expressions (watch window): shows the current value of chosen variables and expressions while the program is paused, so unexpected values can be spotted.
Report window: displays output, error messages and information such as the values of variables while the program runs, or the result of translation.
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
Expected total: 6 + 8 + 5 + 9 + 7 = 35, and 35 / 5 = 7. The output 5.6 means Total was 5.6 × 5 = 28.
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.
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.
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.
Single stepping executes one statement at a time, pausing after every statement. A breakpoint lets the program run at normal speed until it reaches a chosen line, then pauses there, so you do not have to step through all the code before the suspected error.
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.