Decomposition
Practise Decomposition for GCSE Computer Science with this free worksheet and full mark scheme — Foundation and Higher exam-style questions with worked answers for AQA GCSE Computer Science (8525). Decomposition breaks a large problem down into smaller, more manageable sub-problems.
Free downloads
These worksheets and mark schemes are original, written for Virtus Academy and checked against the current AQA specification. Every worksheet comes with a full mark scheme.
Topic overview
Decomposition is breaking a large, complex problem down into smaller sub-problems that are easier to solve.
Each sub-problem can then be tackled on its own, and if it is still too large it can be decomposed further. A game might decompose into handling input, updating the game state, detecting collisions, and drawing the screen — and collision detection might decompose further still.
The benefits are practical. Smaller problems are easier to understand and to solve. They can be tested individually, so a bug is easier to locate. Different people can work on different parts at the same time. And a sub-problem solved once, such as sorting a list, can be reused elsewhere in the program.
Revision notes
What decomposition does
It breaks a large problem into smaller sub-problems.
Each sub-problem is solved separately. If a sub-problem is still too complex, it is decomposed again until each piece is manageable.
The benefits
Smaller problems are easier to understand and solve.
Each part can be tested individually, making bugs easier to locate. Different people can work simultaneously on different parts. Solutions to sub-problems can be reused elsewhere.
Link to subroutines
In programming, decomposition leads directly to subroutines.
Each sub-problem becomes a procedure or function with a clearly defined job. This is why decomposition and subroutines are often examined together.
Key points
- Decomposition breaks problems into sub-problems.
- Sub-problems can be decomposed further.
- Smaller problems are easier to solve.
- Parts can be tested individually.
- Different people can work in parallel.
- Sub-problems become subroutines in code.
Worked examples
Example 1
State two benefits of decomposing a problem. [2 marks]
Working
Example 2
A program manages a school library. Name three sub-problems decomposition might produce. [3 marks]
Working
Example 3
Explain how decomposition makes testing easier. [2 marks]
Working
Common mistakes
Splitting a problem into parts that are still too large.
Decompose repeatedly until each piece is manageable.
Confusing decomposition with abstraction.
Decomposition splits the problem; abstraction removes detail.
Giving vague sub-problems.
Name specific tasks the program must perform.
Not linking decomposition to subroutines.
Each sub-problem typically becomes one subroutine.
Exam tips
- Name specific, concrete sub-problems.
- Mention that sub-problems can be decomposed further.
- Link decomposition to subroutines and reuse.
- Learn several distinct benefits.
Key terms
- Decomposition
- Breaking a problem into smaller sub-problems.
- Sub-problem
- One part of a decomposed problem.
- Subroutine
- A named block of code solving one sub-problem.
- Reuse
- Using a solved sub-problem elsewhere in the program.
Related topics
Written and reviewed against the current AQA specification. Spotted an error? Let us know.