Software Design & Development · Design

SDD3 — Design: Structure Diagrams and Data Flow

📅 Tue 18 Aug 2026 · P3 (single)
~60 minutes
Learning intentions
Success criteria
Warm up — recap from SDD2
Answer all three questions, then check your answers.
Question 1
Every functional requirement must begin with which two words?
Question 2
What term describes a project expanding beyond its original plan as new features are added?
Question 3
Which phase of the iterative development process comes immediately after analysis?

Key vocabulary

Structure diagram
A hierarchy with a top-level module above connected subordinate modules, showing decomposition and data flow.
Top level design
The program's main module and its major subordinate modules, before any one module is refined further.
Data flow
The data that moves into (IN) or out of (OUT) each step of a design.
Refinement
A more detailed breakdown of a single top-level step, numbered as a sub-step (e.g. 2.1, 2.2).
Sub-program
A named, self-contained section of a design (and later, code) with its own inputs and outputs.
Data structure
A way of organising related data, e.g. a parallel array, a record, or an array of records.

Why design comes before code

Once analysis has produced a set of functional requirements, the next job is to plan how the system will meet them — without writing any code yet. This is the design phase. Two techniques are used at Higher: structure diagrams (this lesson) and pseudocode (SDD4). Both express the same underlying design; a structure diagram shows decomposition as a hierarchy of connected modules, while pseudocode expresses the logic as numbered text.

Before drawing anything, a designer identifies the data types and structures the problem will need. Choose a concrete type that matches each value: an integer for a whole-number count, a real for a measured or calculated decimal, a string for text, and a Boolean for a true/false state. Then decide how related values should be organised. Parallel arrays can hold several matching lists, a record groups the different fields for one item, and an array of records groups many items that each have the same mixed fields. At this stage the task is only to identify and justify the choice; implementation belongs in SDD5 and SDD6.

Top level design

A structure diagram starts with one top-level module representing the whole program. Its major subordinate modules are placed below it and connected by branching lines. This vertical relationship means "the program is decomposed into, or calls, these modules"; it is not a top-to-bottom process pipeline. The subordinate modules can still be numbered to show their intended order. A well-formed top level design usually has three to five major modules — fewer may be too vague, while more suggests that some detail belongs in a refinement.

Data flow

Every module call in a structure diagram must show its data flow: what data goes IN to the subordinate module, and what data comes OUT of it. These annotations sit on the connecting lines, so the reader can trace what the parent supplies and what each child returns. The OUT of one module is often supplied as the IN of another call. An examiner checks whether that data genuinely exists and is passed to every module that needs it, not just whether the module names sound sensible.

Reading module shapes and markers

The diagrams below use recognised visual distinctions as well as clear text markers. A plain rectangle is a process module. A rounded module marks repetition, a pointed module marks selection, and a double-sided rectangle marks a subprogram call. The marker matters because it reveals the control structure without turning the diagram into code. Begin at the top-level box, follow the branches down to its children, read each IN/OUT annotation on the connector, and then follow any further branch to see which child module has been refined.

Refinements

Some subordinate modules are too complex to implement directly and need to be broken down further. This is a refinement. The module being refined becomes the parent box of another small hierarchy, with its own subordinate boxes connected below. A refinement of module 2 is numbered 2.1, 2.2, 2.3 and so on, so ownership stays clear. Not every module needs a refinement; only those that still hide significant logic such as a loop, selection, or subprogram call.

Worked examples

Example 1 — Choosing concrete data before drawing
1
Scenario: A cinema stores 300 bookings. Each booking has a customer name, number of tickets, total cost, and whether payment has been received.
2
Choose string because a customer name is text, integer because the ticket count is whole, real because a cost can contain a decimal part, and Boolean because payment has only two states.
Choose an array of records: every booking has the same group of mixed fields, and the program must hold many bookings. This identifies and justifies the design choice without specifying how it will be coded.
Example 2 — Structure diagram: Weekly Rainfall Tracker
1
Scenario: A program reads the rainfall total (in mm) recorded for each of the 7 days in a week. It calculates the total rainfall for the week and displays which day had the highest rainfall.
The program module sits above all four subordinate modules. On the connectors, rainfall[] is the OUT of module 1 and the IN of modules 2 and 3; total and highest_day_position return to the parent and are supplied to module 4.
Example 2 continued — Refining module 1
1
Step 1 ("Get rainfall readings") needs a refinement because it involves reading 7 separate values, not a single action.
The parent is module 1, so its subordinate modules are numbered 1.1 and 1.2. The rounded loop marker replaces written "Start/End loop" lines, while the connector carries day_index down and rainfall[day_index] back up.
Example 3 — Structure diagram: Class Quiz Score Checker
1
Scenario: A program reads the score out of 20 that each pupil in a class of 25 achieved in a quiz. It counts how many pupils scored 10 or more (a pass) and displays that count.
The second tree refines only module 2. Initialising pass_count before the loop makes the counting logic complete; the loop and selection markers then show when the increment can occur.
Now you try
A program reads the temperature (°C) recorded at midday for 5 different cities. It calculates the average temperature across the 5 cities, then displays the name of any city whose temperature was above that average.

Draw: a hierarchical structure diagram with one top-level program module, 3–4 subordinate module boxes below it, branching connector lines, and IN/OUT data flow written on those lines.
⚠️ Common mistakes — examiner feedback
📝 Exam tip

Always match variable names exactly between the top-level diagram and any refinement. If module 1's OUT is rainfall[], its refinement must use rainfall[day_index] for one element of that same array — not a renamed version. Put the IN/OUT labels on the connecting lines so the flow can be traced through the hierarchy.

Task Set A — Core questions

Task Set A — Core questions
Work through all questions, then check your answers.
Question 1
What is the term for a program's major subordinate modules before any one module is refined further?
Question 2
In a structure diagram, which label on a connector identifies data returned by a subordinate module?
Question 3
If module 2 is refined into subordinate modules, what number would its first child module have?
Question 4
A design has: Module 1 — Get pupil names and marks (OUT: name[], mark[]). Module 2 — Calculate average mark (IN: mark[] · OUT: average). Which is the correct IN for module 3, "Display names of pupils above average"?
Question 5
A library program stores 2,000 books. For each book it stores a title, page count, price, and whether it is currently on loan. Choose a concrete data type for each field and choose one appropriate data structure (parallel arrays, record, or array of records). Justify both choices without discussing implementation. (4 marks)
Question 6
Explain why data flow should be written on the connector lines for every subordinate module in a structure diagram. (2 marks)
Question 7
Which description represents a genuine structure diagram rather than a process pipeline or pseudocode list?
Question 8
A refinement always decomposes exactly one parent what?
Question 9
A program reads a raw coursework mark for each of 30 pupils, converts each to a percentage, then displays which pupil achieved the highest percentage. Draw a hierarchical structure diagram with a top-level program module and four subordinate modules connected below it. Label IN/OUT data on the connector lines. Use this box to record a checklist after drawing. (5 marks)
Question 10
Write the corrected data-flow name for the whole array of quiz scores. Use the array name score followed by square brackets.

Task Set B — Extension

Task Set B — Extension · Beyond the specification
Longer written answers — no auto-check. Discuss your answers with your teacher.
Extension 1
A program records how long (in minutes) a school bus journey took each day for 5 days. It calculates the average journey time, then counts how many days took longer than average. Draw a hierarchical structure diagram with four top-level subordinate modules and a second hierarchy refining the counting module. Include connector-level data flow and recognised loop/selection markers. (6 marks)
Extension 2
Explain when it might be more appropriate to use a structure diagram rather than pseudocode, and when the reverse might be true. (3 marks)
Extension 3
A pupil draws a top-level program module with three connected children: Module 1 — Get item prices (OUT: price[]). Module 2 — Calculate total cost (no IN or OUT shown). Module 3 — Display total (IN: total). Identify the data-flow fault on module 2's connector and explain how to fix it. (2 marks)
📁 File this in OneNote under:
Higher Computing Science → Software Design & Development → SDD3
📌 Teacher notes — not for pupils

Single period. First design-technique lesson — pupils have only seen written analysis so far, so the shift to hierarchical notation can take a moment to land. Draw the rainfall program module first, then add the branching line, subordinate modules, and connector annotations in stages.

Suggested timing: 5 min warm-up · 15 min notes + vocab · 15 min worked examples 1–2 (draw live) · 5 min worked example 3 (pupils attempt before reveal) · 5 min "now you try" · 15 min Task Set A.

Common pupil confusion: they treat refinement numbering as a completely new list rather than sub-numbering of the parent module. Model this explicitly on the board — place module 2 above connected children 2.1, 2.2, and 2.3.

Task Set B is unlikely to be finished in the single period — set as homework or fold into the start of SDD4 as a recap activity.