Building with AI
Decomposition in computational thinking: a worked example
Decomposition means breaking a big problem into smaller parts you solve one at a time. See a worked example of planning an app, and why it matters with AI.
By the GenKid team · · Updated · Facts checked · 4 min read
Key takeaways
- Decomposition, in computational thinking, means breaking a big problem into smaller parts you can solve and test one at a time.
- It's part of England's computing curriculum from primary school, and it's the key skill for building with AI.
- Start with the smallest version of your idea that works, then add one feature at a time.
- Each feature should be small enough to describe in one prompt and test in a minute.
- In research with young learners, asking AI for whole solutions at once was linked to weaker skills when they later had to change code without it.
What is decomposition in computational thinking?
Decomposition is a fancy word for a simple idea: break a big problem into smaller ones. You can't build "a game" in one go, but you can build "a character that moves left and right", then "a coin that appears", then "a score that goes up".
It's one of the core ideas of computational thinking, and it appears in England's national curriculum for computing from primary school, where pupils learn to solve problems by breaking them into smaller parts. But it isn't only for coding — you use it when planning a party, writing an essay or tidying a room.
Why it matters even more with AI
When you build with AI, it's tempting to describe your entire app in one giant prompt. Sometimes the AI produces something that looks impressive. But you end up with a lot of code you didn't plan, can't easily check and don't understand.
Research hints at the cost. In one small study of 33 learners aged 10–17, those who asked the AI for the whole solution in one prompt wrote correct code most often, but did worst when later asked to modify code on their own. Small steps keep you in control. Writing prompts is itself a thinking exercise: university students who practised getting an AI to produce code for a given problem said it engaged their computational thinking.
They also make building easier:
- Smaller prompts get better results, because there's less for the AI to guess. See how to write a prompt that builds the app you want.
- Smaller changes are easier to review. See how to check code an AI wrote.
- Bugs are easier to find, because you know which step caused them.
A four-step planning method
1. Write the idea in one sentence
"A virtual pet that gets hungry and bored, which you keep happy by feeding and playing with it." (It's one of our app ideas kids can build with AI.)
2. Find the smallest working version
What's the simplest thing that still counts as the app? Maybe: "A pet with a food bar and a Feed button."
3. List the features
Write down everything else as separate features:
- Food goes down over time
- Feed button adds food
- Fun bar and Play button
- Mood emoji changes with food and fun
- Game over if food reaches zero
- Restart button
- Dark mode
4. Order them
Put them in an order where each one builds on the last, and the app works after every step. Start with the smallest working version, then add features one at a time.
Make each step testable
A good step is small enough that you can say how you'll test it:
| Step | How to test it |
|---|---|
| Food bar shows 5 | Load the page and see a bar at 5 |
| Feed adds 2, max 10 | Click Feed from 9; it should show 10 |
| Food drops by 1 every 5 seconds | Wait 10 seconds; it should drop by 2 |
| Mood is sad below 3 | Let food fall to 2; the emoji changes |
If you can't say how to test a step, it's probably too big or too vague. Our beginner's guide to testing has more ideas.
Decomposition for bigger projects
As projects grow, decomposition happens at several levels:
- Features — what the app does (the list above).
- Parts of the system — the page people see, the data it stores, the services it talks to. See front end vs back end.
- Tasks — the specific changes needed for each feature.
Professional developers break work into "tickets" or "issues", each small enough to finish and review on its own, often as a pull request. The habit you build now is exactly the one they use.
Practice ideas
Try decomposing these ideas into a smallest version and five features:
- A quiz about your favourite topic
- A drawing app
- A to-do list for a made-up space mission
- A "choose your own adventure" story
Looking for more? See our 25 app ideas sorted by level.
GenKid lessons build apps feature by feature with a coding agent, and learners plan each step before building it. See the pathway.
Frequently asked questions
What is decomposition in computational thinking?
It's breaking a complex problem into smaller, more manageable parts that can each be solved separately. It's one of the main ideas of computational thinking, alongside patterns, abstraction and algorithms.
How small should each step be?
Small enough to describe in a sentence or two and test in about a minute. If a step needs a long description, split it.
Do professional developers use decomposition?
Constantly. Teams split work into small tasks or tickets, each reviewed and merged separately, so problems are found early.
How can I teach decomposition to a younger child?
Use everyday tasks: making a sandwich, getting ready for school, building a Lego model. Ask "what are the steps?" and "what's the smallest version that still works?"
Sources
- National curriculum in England: computing programmes of study (opens in a new tab) — Department for Education
- How novices use LLM-based code generators to solve CS1 coding tasks in a self-paced learning environment (opens in a new tab) — Kazemitabaar et al., 2023
- Prompt problems: a new programming exercise for the generative AI era (opens in a new tab) — Denny et al., 2023
How we write: GenKid articles are researched and drafted with the help of AI tools, then checked in a separate review step against the sources listed above before they are published, and re-checked when they are updated. Rules and products change, so check official pages for your country before acting on anything here. This article is general information, not legal advice. Spotted a mistake? Email hello@genkid.app.