Teachers' Portal  /  A-Level Computer Science 9618  /  System Software  /  Features of an IDE
Lesson pack · A-Level Computer Science 9618 · 5.2 · AS Level

Features of an IDE

One window, every tool. An Integrated Development Environment puts an editor, a translator and a debugger in one place.

Student lesson Lab, full screen
At a glance

The shape of the lesson

Topic
System Software
Syllabus reference
Cambridge International AS and A Level Computer Science 9618, 5.2
Level
AS Level
Duration
45 minutes, lab-led; stretches to a 60 minute block (see the contingency notes)
Position in topic
Lesson 4 of 4 in System Software; follows Assemblers, compilers and interpreters
Central model
Fig. 1: typical IDE features: prettyprint, collapsible blocks, a dynamic syntax check, a breakpoint, single stepping and a watch window
Cooperative structure
Assessment
Stage 1 check and the exam-style plenary from the student lesson, plus the worksheet as the exit task
Learning objectives

By the end of the lesson, learners can

Section by section
  • Coding and error detection: These features help while the code is being typed, before it is ever run.
  • Presentation features: Code is read far more often than it is written.
  • Debugging tools: When a program runs but gives the wrong result, debugging tools let you watch it run.
Key points to leave on the board
  • Coding: context-sensitive prompts (auto-complete, parameter hints).
  • Initial error detection: dynamic syntax checks as code is typed.
  • Presentation: prettyprint; expand and collapse code blocks.
  • Debugging: single stepping, breakpoints, watching variables and expressions, report window.
The core visual model

One picture every idea returns to

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
Lesson sequence

Forty-five minutes, phase by phase

TimePhaseWhat happens in the roomGrouping
0 to 5 minHook: predictOpen with the question in the title, One window, every tool.. An Integrated Development Environment puts an editor, a translator and a debugger in one place. Put the figure on the board: it is the one picture every idea in the lesson returns to.Whole class, then pairs
5 to 13 minTeach and check: Coding and error detectionThese features help while the code is being typed, before it is ever run.Whole class, then pairs
13 to 21 minTeach and check: Presentation featuresCode is read far more often than it is written.Pairs
21 to 30 minTeach and check: Debugging toolsWhen a program runs but gives the wrong result, debugging tools let you watch it run. Project tab 1 of the lab (Single stepping with a trace of the variables) and let a student drive it while the class predicts. Model the worked example Find the logic error on the board, one line at a time. Your turn: Explain the difference between single stepping and using a breakpoint.Frayer Model
30 to 36 minCheckThe four Stage 1 questions from the student lesson, answered on mini whiteboards or by show of fingers. Re-teach the one most get wrong.Individual, then whole class
36 to 43 minPlenaryThe exam-style questions from Stage 2, one at a time: thirty seconds alone, then a random call. The feedback lines in the key give the examiner's wording.Individual, random call
43 to 45 minExit and homeworkSet the worksheet below (6 questions, 18 marks). Learners self-assess against the objectives before they leave.Individual
Timing and contingency

Protect the parts that carry the learning

The sequence carries about fifty minutes of material, so the lab is driven by one student while the class predicts rather than explored freely. Times are a guide.

Protected: the check at 30 minutes. It is the only individual read on whether the key idea landed, and it is not cut.

Cut first if the build overruns: the last check in Debugging tools, never the check or the plenary.

In a 60 minute block: run worksheet questions 1 to 3 in class as a Rally Coach set and model both the hardest worked example and its check live.

Running the cooperative task

Frayer Model

Pairs fill a four-box grid for the key term: definition, characteristics, examples and non-examples. The non-examples box is where the misconceptions surface, so give it the most time.

The full structure, with its variations and the other twelve, is on the cooperative-learning page.

Examiner traps to pre-empt

What to head off, and how

Trap learners fall intoTeaching move that pre-empts it
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.
Prettyprint does not change what the program does.It only changes how the code is displayed to make it more readable.
Worksheet

Features of an IDE: worksheet

6 questions, 18 marks. Written in the style of the papers; no past paper question is reproduced.

NameClassDate
Q1 · recall[4 marks]

Identify four features of a typical IDE that help a programmer to debug a program.

Q2 · explain[2 marks]

Describe how a dynamic syntax check helps a programmer.

Q3 · explain[4 marks]

Describe two IDE features that improve the presentation of code, and explain how each helps.

Q4 · explain[2 marks]

Explain how context-sensitive prompts help a programmer to write code.

Q5 · apply[4 marks]

A program should output the largest of 10 numbers stored in an array but outputs a number that is not the largest. Describe how a programmer could use IDE debugging features to find the error.

Q6 · analysis[2 marks]

A programmer says: "My IDE shows no syntax errors, so my program must be correct." Explain why this is not necessarily true.

Answer key and marking notes
Q1 · 4 marks
  • Single stepping.
  • Breakpoints.
  • Watching variables / expressions (watch window).
  • Report window. (Also accept dynamic syntax checking for initial error detection.)
Q2 · 2 marks
  • Each line is checked for syntax errors as it is typed.
  • Errors are highlighted immediately, so they can be corrected before the program is translated / run.
Q3 · 4 marks
  • Prettyprint: colour codes keywords, identifiers and strings and indents the code consistently.
  • This makes the structure easier to read and errors such as a missing ENDIF easier to spot.
  • Expand and collapse code blocks: whole procedures, loops or selection statements can be hidden or shown.
  • This lets the programmer focus on one part and see the overall structure of a long program.
Q4 · 2 marks
  • The editor suggests keywords, declared identifiers or a routine's parameters based on what is being typed.
  • This speeds up coding and reduces errors such as misspelt identifiers or wrong parameters.
Q5 · 4 marks
  • Set a breakpoint at the start of the loop / at the line that updates the largest value.
  • Use single stepping to execute the loop one statement at a time.
  • Watch the variables (index, current element, largest so far) in the watch window.
  • Find the statement where the largest value is not updated as expected, i.e. the logic error, and correct it.
Q6 · 2 marks
  • Dynamic syntax checks only find syntax errors (code that breaks the rules of the language).
  • The program may still contain logic errors (or run-time errors), giving wrong results, which need testing and the debugging tools to find.
Quiz

6 multiple-choice questions on this lesson

From the topic question bank. Assign them in the app for a marked score in your gradebook, or run the topic as a class game.

Q11 mark

As a programmer types OUTPUT Sco, the editor offers the identifiers Score and ScoreTotal to choose from. Which IDE feature is this?

  • AContext-sensitive prompts
  • BDynamic syntax checking
  • CPrettyprint
  • DA watch window
Q21 mark

Which IDE feature is used for the presentation of code?

  • AExpanding and collapsing code blocks
  • BBreakpoints
  • CSingle stepping
  • DDynamic syntax checks
Q31 mark

Which error would a dynamic syntax check not find as the code is typed?

  • AUsing < where <= was needed in a loop condition
  • BAn IF statement with no matching ENDIF
  • CA keyword spelt as OUPTUT
  • DA missing closing quotation mark on a string
Q41 mark

What is the difference between single stepping and using a breakpoint?

  • ASingle stepping pauses after every statement; a breakpoint lets the program run normally until a chosen line, then pauses
  • BSingle stepping pauses at a chosen line; a breakpoint pauses after every statement
  • CSingle stepping shows variable values; a breakpoint shows only the program's output
  • DSingle stepping finds syntax errors; a breakpoint finds logic errors
Q51 mark

This code should find the largest value in Values, which holds 3, 9, 4, 7 at indexes 1 to 4. A breakpoint is set on the OUTPUT line. What value does the watch window show for Max when the program pauses?

Max ← Values[1]
FOR Index ← 2 TO 4
    IF Values[Index] < Max THEN
        Max ← Values[Index]
    ENDIF
NEXT Index
OUTPUT Max

  • A3
  • B9
  • C7
  • D4
Q61 mark

A programmer single steps through this code with Total in the watch window. What value is shown for Total just after the assignment has been executed for the third time?

Total ← 0
FOR Index ← 1 TO 5
    Total ← Total + Index * Index
NEXT Index

  • A14
  • B9
  • C55
  • D6
Quiz key
Q1: A

Context-sensitive prompts suggest keywords, declared identifiers and parameters as code is typed. A dynamic syntax check highlights errors as lines are entered, prettyprint colours and indents code, and a watch window shows variable values while a program is paused.

Q2: A

Expanding and collapsing blocks (like prettyprint) changes how the code is displayed so it is easier to read and navigate. Breakpoints and single stepping are debugging tools. Dynamic syntax checks are for initial error detection.

Q3: A

Using the wrong comparison operator is a logic error: the code is valid, so only testing and debugging tools reveal it. A missing ENDIF, a misspelt keyword and an unclosed string all break the syntax rules, so a dynamic syntax check highlights them straight away.

Q4: A

Single stepping executes one statement at a time; a breakpoint runs at full speed up to a marked line and pauses there. The second option reverses them. Neither tool itself shows values: the watch window does that while paused. Both are used to find logic and run-time errors, not syntax errors.

Q5: A

Max starts at 3. None of 9, 4 or 7 is less than 3, so Max is never changed and the watch shows 3. The comparison should be > to find the largest (9). 9 is the intended answer, not what this code gives. 7 would be the last value, and 4 is the next value after 9, neither of which this code stores.

Q6: A

After three passes Total = 1 + 4 + 9 = 14. 9 is only the amount added on the third pass. 55 is the final total after all five passes. 6 is 1 + 2 + 3, adding Index instead of Index * Index.

Lab and demo

What to project

The student lesson embeds these tabs. Open them full screen on the projector; every slider has a drag handle on the stage.

Slides

Slides for this lesson

A projectable deck for every pack is on the way. Until then, present the student lesson full screen: its sections, figure and lab tabs follow the same order as the plan above.

Also for this topic

Everything else you can use

Original work by the TheLucidSTEM team. The worksheet items are written in the style of the papers; no past paper question is reproduced.
Previous lessonAssemblers, compilers and interpreters