✓ Free · Component 2 · 2.1.1 Computational Thinking
2.1.1a Thinking Abstractly and Decomposition
OCR H446 · A Level Computer Science · ~15 min read
Notes
Video
Slides
Worksheet
Quiz

Computational Thinking

Computational thinking is a set of problem-solving approaches that express solutions in a way that a computer (or human) can understand and execute. It is not about coding — it is about thinking clearly and systematically about problems. The four key aspects are:

  • Abstraction — focusing on what is important, ignoring irrelevant detail
  • Decomposition — breaking a complex problem into smaller, manageable sub-problems
  • Algorithmic thinking — devising step-by-step solutions
  • Pattern recognition — identifying similarities and reusable solutions

This lesson focuses on abstraction and decomposition — the two most foundational aspects.

Abstraction

Abstraction is the process of removing or hiding unnecessary detail while keeping the information relevant to the problem being solved. It allows programmers and engineers to focus on what matters for a given level of analysis.

Abstraction appears in two related but distinct forms in computer science:

Representational Abstraction

Choosing what information to keep and what to discard when creating a model. Example: a road map abstracts away the width of roads, the colour of houses, and the texture of pavements — it keeps only the information needed for navigation.

Abstraction by Generalisation

Grouping related items under a common category to create general-purpose solutions. Example: a function (subroutine) is an abstraction — you don't need to know how it works internally; you just call it and use the result.

Levels of Abstraction in Computing

LevelDescriptionExample
Problem LevelReal-world problem being solvedNavigating a city
Design LevelAlgorithm / data structure designDijkstra's shortest path algorithm
Program LevelHigh-level language codePython: graph.shortest_path()
OS/Language LevelRuntime environment, compilerPython runtime, garbage collector
Hardware LevelMachine code, CPU instructionsMOV, ADD assembly instructions
Physics LevelTransistors, logic gatesCMOS gates, electrons

At each level, the details below are abstracted away. A Python programmer doesn't need to know about MOV instructions; a hardware engineer doesn't need to know about Python syntax.

Real-world Abstractions

  • London Underground map: Abstracts away geographic accuracy — station positions are stylised for clarity. Removes above-ground geography, tunnelling depth, actual distances. Keeps: line connections, stations, interchange points.
  • A function/procedure: Hides implementation detail. Caller uses the function name and parameters without needing the source code.
  • An object (OOP): Hides internal state and implementation. Exposes only a public interface (methods). Users interact with objects without knowing their internal data structures.
  • An API: Abstracts away server implementation. Developers call endpoints without knowing what language or database is behind them.

Decomposition

Decomposition is the process of breaking down a complex problem into smaller, simpler sub-problems that can be solved independently. The solutions are then combined to solve the original problem.

Decomposition is essential because:

  • Complex problems are too large to tackle as a whole
  • Sub-problems can be assigned to different team members (parallel development)
  • Sub-problems can be solved and tested independently
  • Sub-problems may reveal reusable components (functions, modules)
  • It makes maintenance and debugging easier — isolate the sub-problem that is failing

Decomposition in Practice

Consider building a school management system. Decomposed into:

Sub-problemFurther decomposed
Student managementRegister, enroll, grade, attendance, report
Staff managementTimetabling, payroll, performance review
Timetable systemClash detection, room allocation, subject assignment
Finance systemFees, payments, budget tracking
CommunicationNotifications, parent portal, announcements

Each sub-problem is further decomposed until it reaches a level that can be programmed directly as a function or module.

Top-Down Design

Top-down design (also called stepwise refinement) is the systematic process of decomposition: start with the overall problem at the top, break it into sub-problems, then break each sub-problem further until you reach atomic tasks that can be coded directly. Represented as a structure chart (hierarchical diagram).

Modular Programming and Decomposition

Decomposition drives modular programming — each sub-problem becomes a function/module. Benefits: team collaboration (divide modules between developers), code reuse (same module used in multiple places), easier testing (test each module independently), and maintenance (update one module without affecting others).

Abstraction and Decomposition Together

These two techniques work hand-in-hand. Decomposition breaks the problem into parts. Abstraction determines what each part needs to know about the others (the interface) and hides what it doesn't (the implementation). Together they are the foundation of software engineering.

Exam tip: Distinguish clearly between abstraction and decomposition. Abstraction = removing irrelevant detail. Decomposition = breaking into sub-problems. Students often confuse these. Give a specific example for each in exam answers.
Exam tip: For "thinking abstractly" questions, be specific about what is KEPT and what is REMOVED. "The map keeps connections between stations but removes the actual distances" is a much stronger answer than "the map removes unimportant detail".
✓ Notes completed!
Video coming soon
Click to advance · Arrow keys also work
Click slide or press arrow keys to navigate

Worksheet — 2.1.1a Abstraction & Decomposition

8 questions · 22 marks · instantly marked

Q1Define abstraction in the context of computational thinking. Give one example from computing.[3 marks]
✓ Mark scheme
Abstraction is the process of removing or hiding unnecessary detail while retaining the information relevant to solving the problem [1]. It simplifies complex systems by focusing only on what matters at a given level [1]. Example: a function/procedure abstracts away its implementation — the caller uses the function name and parameters without needing to understand the internal code [1]. (Other valid: map, OOP class, API, operating system abstraction)
Q2The London Underground map is often used as an example of abstraction. State two things the map removes and two things it keeps. Explain why each choice is made.[4 marks]
✓ Mark scheme
Removes: geographic accuracy (actual positions of stations) — not needed for navigation as passengers only need to know which line and how many stops [1]. Surface-level geography (roads, buildings, river curves) — irrelevant to underground travel [1]. Keeps: which stations exist on each line — essential for planning a route [1]. Interchange points (where lines connect) — essential for changing trains [1]. (Other valid removed: tunnelling depth, distance between stations, elevation. Other kept: line colours, station order, zone information)
Q3Explain the difference between representational abstraction and abstraction by generalisation.[4 marks]
✓ Mark scheme
Representational abstraction: removing detail from a model to create a simplified representation — deciding which information is relevant and which can be discarded [1]. Example: a map removes true distances but keeps connections [1]. Abstraction by generalisation: grouping similar or related things under a common category or pattern to create general-purpose solutions [1]. Example: a function is a generalisation — it abstracts a sequence of steps that can be applied to any data matching the parameter types [1]. (Or OOP: class Animal generalises Cat, Dog, Bird)
Q4Define decomposition and explain why it is important in large software projects.[4 marks]
✓ Mark scheme
Decomposition is breaking a complex problem into smaller, simpler sub-problems that can each be solved independently [1]. Importance in large projects: (any 3 — 1 mark each) different sub-problems can be assigned to different team members allowing parallel development [1]; each sub-problem can be programmed and tested independently, making debugging easier [1]; sub-problems may be reused in other parts of the project or in other projects [1]; makes the project more manageable — no single part is too complex [1]; maintenance is easier — fixing one module doesn't require understanding the whole system [1].
Q5A company wants to build an online shopping system. Apply decomposition to identify at least five sub-problems and, for one of them, identify two further sub-problems.[3 marks]
✓ Mark scheme
Five sub-problems (any 5): User registration/login; Product catalogue (search, browse, filter); Shopping cart; Payment processing; Order management; Inventory management; Delivery tracking; User reviews/ratings; Admin panel; Customer support [1 per sub-problem, max 3 if not doing further decomposition, but 2 marks for 5 sub-problems and 1 mark for further decomposition]. Further decomposition of one (e.g. Payment processing): validate card details; contact payment gateway (Stripe/PayPal); confirm transaction; update order status; send confirmation email [1].
Q6Explain what "top-down design" means and how it relates to decomposition.[3 marks]
✓ Mark scheme
Top-down design is a systematic approach to decomposition where the overall problem is placed at the top [1] and is progressively broken down into smaller sub-problems at each level until atomic tasks are reached that can be directly coded [1]. Also called stepwise refinement — at each step, each sub-problem is broken down one level further. It is often represented as a hierarchical structure chart. Decomposition is the underlying technique; top-down design is the systematic method for applying it [1].
Q7Explain how abstraction is used in object-oriented programming (OOP). Use the terms "interface" and "implementation".[3 marks]
✓ Mark scheme
In OOP, a class abstracts away internal complexity by hiding its implementation (private attributes and methods) [1] and exposing only a public interface (the set of public methods and their parameters) [1]. Users of the class interact with objects through this interface without needing to understand how the methods are implemented internally. This separation of interface from implementation allows the implementation to be changed without affecting code that uses the class [1].
Q8Name the four aspects of computational thinking and briefly describe each.[4 marks]
✓ Mark scheme
Abstraction: removing irrelevant detail to focus on what matters for the problem [1]. Decomposition: breaking a complex problem into smaller manageable sub-problems [1]. Algorithmic thinking: devising step-by-step, unambiguous solutions that a computer can execute [1]. Pattern recognition: identifying similarities, recurring patterns, or reusable solutions within or across problems [1]. (All four must be correctly identified and described for full marks)
Topic Quiz
1 of 15
You scored
out of 15
🎯

Mini Test — 2.1.1a Abstraction & Decomposition

  • 10 questions · 10 marks · 10 minutes
  • 5 MCQ + 5 short answer
Card 1 of 15
Click to reveal
🎉
Complete!
TermDefinition
← 1.4.3e D-type Flip-Flops 2.1.1 Computational Thinking Next: 2.1.1b Thinking Ahead →