GCSE · Computer Science · Edexcel · Spec 1CP2

Decomposition and abstraction in programming

Someone says, "Build me a homework app." Where do you start? You don't build an app. You build a handful of tiny things that add up to one.

Computer Science · Structure

One way to decompose a homework app

Main problem at the top. Tap any box to see what it must do and why it is small enough to solve.

Tap any part of the diagram to see what it does.

Your turn

Decompose a lunch-order app

Where does each piece of work belong?

Still to sort

Getting user input (0)

Taking in what the user tells the app.

Where the line is: If the app is receiving something from the user, it is input.

Processing the input (decision making) (0)

Working things out from what the user gave.

Where the line is: If the app is deciding or working something out, it is processing.

Giving the output price (0)

Telling the user the result.

Where the line is: If the app is showing something back to the user, it is output.

6 of 6 still to sort.

A lunch-order app splits into three subproblems. Pick a task, then pick the subproblem it belongs to.

Abstraction depends on the user

Which map needs which detail?

A theme park is making two maps: one for visitors and one for staff. Tick every map each detail is needed on. The rides, paths, main buildings and the ticket-booth roof are made-up details for practice; the staff toilets come from the real example.

  • A Needed on the visitor map
  • B Needed on the staff map
  1. The rides
  2. The paths
  3. The main buildings
  4. The staff toilets
  5. The colour of the ticket-booth roof

The pair people mix up

DecompositionvsAbstraction

Two different techniques. Both help you solve a problem, but they do very different jobs.

Focus

What it does to the problem

Decomposition

Breaks it into smaller, more manageable subproblems

Abstraction

Focuses on the important details and removes or ignores the rest

The insight

Decomposition splits the problem up. Abstraction strips detail out. That is the difference people swap round.

What you end up with

Decomposition

A set of subproblems, shown in a structure diagram

Abstraction

A simpler problem with less complexity

The question it asks

Decomposition

Is this part still too big to solve?

Abstraction

Does the user of this solution need this detail?

How far it goes

Decomposition

Repeated until every subproblem is manageable and easy to solve

Abstraction

Guided by who the solution is for and what it must do

How it makes a solution easier

Decomposition

Each small subproblem is easier to solve than the whole

Abstraction

Less complexity makes finding a solution easier and faster

Have a go

Tackle a brief yourself

Practice brief (made up for this lesson): a school reading club wants a phone app. Students will use it to record the books they have read and to look back over their list.

Explain how you would use computational thinking on this brief. Say one question you would ask first to analyse the problem, name two subproblems, say how one of them could be broken down again, and give one detail abstraction could ignore and why. [6 marks]

0 words · your answer stays on this page and is not sent anywhere.

WHAT YOU'VE LEARNED

A quick recap of today's lesson.

Split a big problem into small ones, and ignore the details nobody needs.

What you need to know

  • Computational thinking is a structured, logical approach to solving problems, and decomposition and abstraction are two of its techniques.
  • Analyse the problem first so you fully understand it, because that helps the solution work and work efficiently.
  • To analyse it, ask what the solution must do, why the problem needs solving and who will use it.
  • Have a goYour mate says, "Skip the thinking, I'll just start coding and see what happens." What should come first instead?

    Analyse the problem so you fully understand it.

    Understanding the problem well is what makes the solution work and work efficiently, so it comes before any splitting or coding.

  • Decomposition means breaking a problem down into smaller, more manageable subproblems that are easier to solve.
  • A subproblem can be decomposed again, and again, until every problem is manageable and easy to solve.
  • Have a goYou split a big problem into three subproblems, but one of them still looks too big. What now?

    Decompose that subproblem again.

    Splitting once does not finish the job: you keep decomposing until every subproblem is manageable.

  • A structure diagram shows a decomposed problem, with the main problem at the top and branches down to the subproblems.
  • In a program, decomposition splits the work into parts that can each be solved separately.
  • Abstraction means focusing on the important details and ignoring the rest, which reduces complexity and makes a solution easier and faster to find.
  • Have a goFinish the sentence: abstraction makes the problem ___ complex, so finding a solution is ___.

    Less complex; easier and faster.

    Ignoring details that do not matter takes weight off the problem, so there is simply less to think about.

  • Which details abstraction removes depends on who the solution is for and what it must do.

The big picture

Computational thinking is a structured, logical way to solve problems. Before you use its techniques you analyse the problem until you fully understand it. Decomposition then breaks the problem into smaller subproblems, again and again, until each one is manageable. Abstraction focuses on the details that matter and ignores the rest, and which details matter depends on who the solution is for.

Key points

1Computational thinking is a structured, logical approach to solving problems. Decomposition and abstraction are two of its techniques, used once the problem is well understood.
2Analyse the problem first. Ask what the solution must do, why the problem needs solving and who will use it.
3Decomposition breaks a problem into smaller subproblems, repeatedly, until each one is manageable and easy to solve.
4A structure diagram puts the main problem at the top, with branches down to the subproblems.
5Abstraction focuses on the important details and ignores the rest, which reduces complexity.
6What abstraction removes depends on who the solution is for and what it must do.

Worked example

Problem

A programmer is testing how the player moves around a game. The finished game has detailed artwork. Use analysis and abstraction to decide which details the test needs.

⚠ Watch out

Treating decomposition and abstraction as the same thing, or thinking you split a problem once and you are finished. Decomposition breaks a problem into subproblems, and repeats until each is manageable. Abstraction removes details that do not matter to who the solution is for.

🧠

Memory hook

Decomposition splits. Abstraction strips.

✓

Check yourself

Without looking back: say what each technique does to a problem, then explain why the homework app's 'Add homework' box was broken down again but 'View the list' was not.

Flashcards

(12)
What is computational thinking?
A structured, logical approach to solving problems. Decomposition and abstraction are two of its techniques.
Why analyse a problem before decomposing or abstracting?
So it is fully understood. Understanding the problem well is key to making sure the solution works and works efficiently.
Three questions that help you analyse a problem
What does the solution need to do? Why does the problem need to be solved? Who will use the solution?
Decomposition
Breaking a problem down into smaller, more manageable subproblems that are easier to solve.
Subproblem
A smaller part of a bigger problem. It can itself be decomposed again.
When do you stop decomposing?
When each problem is manageable and easy to solve.
Structure diagram
A diagram of a decomposed problem: the main problem at the top and branches below leading to the smaller subproblems.
Decomposing a lunch-order app: the three parts
Getting user input, processing the input (decision making) and giving the output price.
Abstraction
Focusing on the important details of a problem and removing or ignoring the details that do not matter.
What does abstraction do for the problem?
It reduces the complexity of the problem, which makes finding a solution easier and faster.
What decides which details abstraction removes?
Who the solution is for and what it must do. A visitor map leaves off staff toilets, for example.
Which technique splits and which one strips?
Decomposition splits a problem into subproblems. Abstraction strips out the details that do not matter.

Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.

Learning with Lightbulb is opening soon

You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.

Keep me posted

More Edexcel GCSE Computer Science topics

See the full Edexcel Computer Science curriculum →

How this lesson was checked. This Edexcel GCSE Computer Science (specification 1CP2)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 21 November 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.