How do we design programs that are easy to write, read and maintain?
Apply the principles of structured programming, breaking a problem into subroutines with clear interfaces, and explain the benefits of this approach.
A focused answer to AQA GCSE Computer Science 3.2.11, covering the principles of structured programming, breaking a problem into subroutines with clear interfaces, and the benefits of the approach.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
What this dot point is asking
AQA wants you to apply structured programming: breaking a problem into subroutines with clear interfaces, using the three constructs, and explaining why this makes programs easier to write and maintain.
What structured programming is
This is decomposition applied to writing code: a big problem becomes a set of small, manageable subroutines, each of which is short enough to understand and check at a glance. The constraint to use only sequence, selection and iteration keeps the flow of control clear and predictable.
Clear interfaces
Using local variables inside each subroutine keeps it self-contained and avoids side effects (one part of the program accidentally changing data another part relies on). A subroutine that communicates only through its parameters and return value is easy to reason about, because nothing outside it can interfere.
Benefits
The link to computational thinking
Structured programming is decomposition (one of the pillars of computational thinking) carried through into code. You decompose the problem into tasks, then write one subroutine per task, each with a clear interface. The benefit chain follows from this: small self-contained subroutines are easy to understand, easy to test in isolation, and easy to reuse, so the whole program is easier to write and maintain. When a fault appears, it is contained in one short subroutine rather than hidden in a long tangle of code, so it is quicker to find and fix without breaking the rest. This is why professional software is built from many small, well-named subroutines rather than one giant block.
Try this
Q1. State what structured programming means. [2 marks]
- Cue. Breaking a program into well-organised subroutines, each doing one task, using sequence, selection and iteration.
Q2. Give two benefits of structured programming. [2 marks]
- Cue. Easier to test (each subroutine separately) and easier to maintain, plus reuse and shared development.
Exam-style practice questions
Practice questions written in the style of AQA exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
AQA 20194 marksExplain what is meant by structured programming, and describe two benefits of designing a program this way.Show worked answer →
Structured programming designs a program as a set of well-organised subroutines, each carrying out a single task, built only from sequence, selection and iteration and avoiding unstructured jumps. It applies decomposition to code: a large problem is broken into small, manageable subroutines.
Two benefits: it is easier to test, because each subroutine can be tested on its own in isolation; and it is easier to maintain and debug, because a fault is contained in one small subroutine that is quick to find and fix. Reuse and shared development are also valid.
Markers reward the definition (subroutines using the three constructs) and two distinct benefits with a reason, not just a list of adjectives.
AQA 20224 marksA large program written as one long block of code is hard to maintain. Explain how restructuring it into subroutines with clear interfaces would improve it, referring to interfaces and testing.Show worked answer →
Splitting the program into subroutines, each doing one task with a clear interface (defined parameters in and a return value out), means each subroutine is self-contained and can be understood without reading the rest of the program.
This improves maintainability because a fault is isolated in one subroutine, so it is easier to find and fix. It improves testing because each subroutine can be tested on its own with known inputs and expected outputs, and a corrected subroutine can be slotted back in without affecting the others.
Markers reward linking clear interfaces to self-contained, independently testable subroutines, and isolation of faults to easier maintenance.
Related dot points
- Use subroutines (procedures and functions), pass parameters and return values, and understand the scope of local and global variables.
A focused answer to AQA GCSE Computer Science 3.2.8, covering subroutines (procedures and functions), passing parameters, returning values, and the scope of local and global variables.
- Use the three programming constructs of sequence, selection and iteration, including definite and indefinite iteration, and nest them.
A focused answer to AQA GCSE Computer Science 3.2.2, covering the three programming constructs of sequence, selection and iteration, the difference between definite and indefinite iteration, and nesting.
- Computational thinking through abstraction, decomposition and algorithmic thinking, and understanding what an algorithm is and the difference between an algorithm and a program.
A focused answer to AQA GCSE Computer Science 3.1.1, covering abstraction, decomposition and algorithmic thinking, what an algorithm is, and how an algorithm differs from a program.
- Read from and write to a text file, including opening, reading line by line, writing and closing a file, so that data persists after the program ends.
A focused answer to AQA GCSE Computer Science 3.2.10, covering reading from and writing to a text file, including opening, reading line by line, writing and closing a file so data persists.
Sources & how we know this
- AQA GCSE Computer Science (8525) specification — AQA (2020)