Abstraction and Decomposition
Abstraction is a computational thinking technique that removes or hides unnecessary detail so you can focus on the essential features of a problem. It lets you build a simplified model of something real, containing only what matters for the job you are doing.
For example, a school canteen ordering system might model a meal with its name, price and allergens. The meal's cooking method, photo and smell are left out because they do not help take an order. They are not inaccurate details, just irrelevant to this purpose.
What counts as unnecessary depends on the purpose of the model. A nutritional analysis tool for the same canteen meals would need each meal's calories and ingredients, so it would keep those and ignore the price.
| Feature of a meal | Ordering system | Nutrition tool |
|---|---|---|
| Meal name | Kept | Kept |
| Price | Kept | Ignored |
| Allergens | Kept | Kept |
| Calories | Ignored | Kept |
| Photo | Ignored | Ignored |
The abstraction is only useful if the details you keep are the ones the problem needs, so its benefits depend on choosing details that are relevant to the problem.
By reducing the amount of detail you must handle, abstraction makes a problem simpler to analyse, understand and solve. You can reason about a small set of relevant features instead of a messy real-world object with hundreds of properties. Modelling the real world in software therefore means choosing which real-world features to keep and which to ignore.
Abstraction is not about making a model vague or throwing away all detail: you deliberately select the features the problem requires. It is also different from decomposition, which splits a problem into smaller parts rather than stripping away detail.
Edexcel GCSE Computer Science · Abstraction and Decomposition