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.
A lunch-order app splits into three subproblems. Pick a task, then pick the subproblem it belongs to.
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
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?
Why analyse a problem before decomposing or abstracting?
Three questions that help you analyse a problem
Decomposition
Subproblem
When do you stop decomposing?
Structure diagram
Decomposing a lunch-order app: the three parts
Abstraction
What does abstraction do for the problem?
What decides which details abstraction removes?
Which technique splits and which one strips?
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 postedMore Edexcel GCSE Computer Science topics
- Built-in and user-devised subprograms
- Code readability techniques
- Converting algorithms to programs
- CSV file I/O
- Evaluating program fitness and efficiency
- Functions vs procedures
- Global vs local variables
- Identifying and correcting program errors
- Primitive data types
- Programming – condition-controlled repetition
- Programming – count-controlled repetition
- Programming – iteration over data structures
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.