Computational Thinking
Decomposition breaks a problem into smaller sub-problems, and the benefits come from those parts: one huge problem is hard to hold in your head, while several small ones are manageable.
Each sub-problem is simpler to understand, write and test. You concentrate on one small job at a time: in a cinema booking program, getting the seat prices right is something you can finish and check before you touch anything else.
Different people can work on different sub-problems at the same time. One programmer could build the seat picker while another builds the card payment, so the project is finished sooner.
A finished sub-problem can be reused in another program. The payment section written for the cinema could go into a swimming pool booking system with little change, so nobody solves that problem a second time.
Decomposition also makes it clearer what the whole solution has to cover, because the sub-problems are a checklist of everything the finished program must do. And when something goes wrong, faults are easier to find: if a ticket prints the wrong price but the seat map looks right, you test the pricing part on its own instead of searching the whole program.
| Benefit | Why it helps | In a cinema booking program |
|---|---|---|
| Simpler to understand, write and test | You focus on one small job at a time | The pricing part is tested before payment is added |
| Work in parallel | Several people make progress at once | One builds the seat picker, another builds payment |
| Reuse | A solved part can be dropped into another program | The payment section suits a pool booking system too |
| See the whole problem | The sub-problems list everything the solution must do | You can check no job has been forgotten |
| Find faults | Each part can be checked separately | A wrong ticket price points to the pricing part only |
OCR GCSE Computer Science · Computational Thinking