Problem Solving: Top-down design and Step-wise refinement

From Wikibooks, open books for an open world
Jump to navigation Jump to search

UNIT 1 - ⇑ Problem Solving ⇑

← Stages of problem solving Top-down design and Step-wise refinement Structure charts →

A top-down approach (also known as stepwise design) is essentially the breaking down of a system to gain insight into the sub-systems that make it up. In a top-down approach an overview of the system is formulated, specifying but not detailing any first-level subsystems. Each subsystem is then refined in yet greater detail, sometimes in many additional subsystem levels, until the entire specification is reduced to base elements. Once these base elements are recognised then we can build these as computer modules. Once they are built we can put them together, making the entire system from these individual components.

Top-down design - in which design begins by specifying complex pieces and then dividing them into successively smaller pieces

Example: Making Pancakes

To show you an example of Top-Down design we'll take the act of making pancakes. Starting from the top we have the task to:

  • Make some pancakes

But saying that by itself isn't enough to actually make any pancakes, we need to break the task down:

  • Make some pancakes
  1. Organise Kitchen
  2. Make Pancakes
  3. Serve

Each of these tasks can then be broken down further:

  1. Organise Kitchen
    1. Clean surfaces
    2. Get out mixing bowl, whisk, spoon, sieve
    3. Get out plain flour, salt, eggs, full fat milk, butter
    4. Put on apron
  2. Make Pancakes
    1. Sift salt and flour into bowl
    2. Break eggs into bowl
    3. Whisk
    4. Add water and milk
    5. Add butter
    6. Whisk
    7. Cook
  3. Serve

And each of these tasks can be broken down further, let us take a look at the Cook:

  • Cook
  1. Get pan to temperature
  2. Pour batter in
  3. Spread batter to edges
  4. Use plastic spatula to check bottom of pancake
  5. When brown, flip
  6. Use plastic spatula to check bottom of pancake
  7. When brown finish

We can break down some of these tasks even further. So starting at a single point, the creation of a pancake, we have broken down the task into it individual parts

Exercise: Top-down design
Draw a top-down design tree to three level depth for making a modern First Person Shooter


Your answer probably won't be the same as this as the question is open to interpretation, but hopefully it'll be similar:

  • Make First Person Shooter
  1. Create graphics
    1. Characters
    2. Guns
    3. Maps
    4. Interface
  2. Create sounds
    1. Music
    2. SFX
  3. Create AI
    1. Non-playable characters
    2. Monsters