CIE AS & A Level Computer Science, section 9.1 (Computational thinking skills)
What abstraction is
Abstraction is the process of removing unnecessary detail from a problem so that only the essential features remain. You decide what matters for the task and ignore the rest.
Purpose and benefits
- It makes a complex problem simpler and easier to understand.
- It lets you focus on the important parts and avoid being distracted.
- It makes a solution reusable: the same model can apply to many similar problems.
- It reduces the amount of data and processing needed.
Examples
| Real thing | Abstract model | Detail left out |
|---|---|---|
| A railway or tube network | A map showing stations and connections | exact distances, curves, real positions |
| A student | A record with ID, name and mark | height, hobbies, hair colour |
| A bank account | Balance, account number and transactions | the customer's favourite colour |
| A car in a game | Position, speed and direction | engine parts and paint |
The same real thing can have different abstractions for different purposes: a school record for the library holds different data from one for the canteen.
Producing an abstract model
- Decide what the model is for.
- List the features of the real system.
- Keep only the features needed for that purpose.
- Represent them using suitable data types and structures.
Levels of abstraction
Programs use abstraction in layers. A programmer calls a function without needing to know how it works inside (for example print). The details are hidden behind the interface.
def area(width, height): # the caller needs only the name and parameters
return width * height
print(area(4, 3)) # 12
Common mistake: thinking abstraction means "making the program shorter". It means removing detail that is not needed, so the problem is simpler. Also, an abstract model is not wrong because it leaves things out: the missing detail is not needed for its purpose.
Exam tip: when asked to produce an abstract model, say what the model is for, list the details you keep and justify each. Mention what you left out and why.
Check yourself
What is abstraction?
Removing unnecessary detail so that only the essential features of a problem remain.
Give one benefit of abstraction.
It makes a problem simpler and easier to solve, or allows a solution to be reused.
Give an example of an abstraction.
A tube map, which shows stations and connections but not real distances or curves.