Phase 1: Prepare
Step 1 Warm-up recall
From Module 5: comparing every pair among 4 items needs how many comparisons?
Private: nothing you type here is sent or stored.
Step 2 Learning goal
By the end of this lesson you can:
- define abstraction and decomposition (Foundation);
- split a task into parts (Core);
- describe a part by its inputs and output (Core).
Phase 2: Teach
Step 3 A familiar example
You can drive a car without knowing how the engine works. You use the pedals and the wheel, and the rest is hidden. That hiding is abstraction.
Step 4 Clear explanation
Abstraction means describing something by what it does and hiding how it does it. Decomposition means splitting a large task into smaller parts, each of which can be understood and checked on its own.
The figure splits an invented receipt task into four parts: read the prices, add them up, add tax and print the receipt. Each part has clear inputs and a clear output, and the output of one is the input of the next. A good decomposition has parts that do one job each, and that can be described in a sentence without mentioning how they work inside. When a fault appears, you can then test the parts one at a time instead of searching the whole task. The entry on the algorithm shows the same idea applied to a step-by-step method.
Step 5 Worked example (4 marks)
Split the task “produce a monthly attendance report” into parts.
- Part 1: collect the daily attendance records. (1 mark)
- Part 2: count the days each person attended. (1 mark)
- Part 3: lay out the counts as a report. (1 mark)
- Each part has one job and its output feeds the next. (1 mark)
Phase 3: Practise
Step 6 Learner practice (instant-marked)
1. Abstraction means:
It hides the inside behind a clear description.
2. Decomposition means:
Each part can be understood and tested alone.
3. A good part of a program has:
One job makes it easy to describe and test.
4. The main benefit of splitting a task is:
Faults can be located quickly.
Phase 4: Close
Step 7 Recap
- Abstraction hides how and shows what.
- Decomposition splits a task into parts.
- Each part has clear inputs and an output.
Step 8 Exit ticket (ungraded)
Split the task “send a reminder to every late borrower” into three parts.
Private: nothing you type here is sent or stored.
Step 9 Go further (Extension)
Read the entry on the algorithm and find an everyday example of a method built from smaller methods.
Common mistakes
| Mistake | Why it fails |
|---|---|
| Making one part do everything | Give each part one job. |
| Describing a part by how it works | Describe it by inputs and output. |
| Leaving out the order between parts | The output of one part feeds the next. |
Limits. Splitting a task well takes judgement; there is often more than one good decomposition.