Stepwise Refinement

Download as odp, pdf, or txt
Download as odp, pdf, or txt
You are on page 1of 8
At a glance
Powered by AI
The key takeaways are that stepwise refinement is a technique to break down complex problems into smaller, more manageable pieces by focusing on one part at a time. It allows problems to be solved in a top-down, hierarchical manner.

Stepwise refinement is a technique where an overall problem or program is described at a high level first, then each part is broken down into more detailed steps or subproblems until a full solution is defined. It helps solve complex problems by allowing them to be examined and solved piece by piece in a structured manner.

Some principles discussed are the theory of easy problems, Miller's Law about human cognitive limits, and the KISS principle of keeping things simple. Abstraction is also mentioned as a way to organize a system hierarchically from general to specific.

Introducing Stepwise Refinement

Stepwise Refinement is a way of working on big or


complicated problems by splitting them into smaller,
more manageable pieces.
In software development, Stepwise Refinement is a
technique in which a program's overall functions are
described first; each function is then broken down into
details which are refined in successive steps until the
whole program is fully defined.
It is also known as Functional Decomposition,
Top-Down Design or Divide and Conquer.

Introducing Stepwise Refinement

Introducing Stepwise Refinement


Theory of easy problems
Stepwise refinement allows you to focus attention on one part of a big problem at a
time, rather like you might shine a torch beam or focus a magnifying glass to examine
small parts of a large object.
Miller's Law

Psychologist George Miller discovered that there are limits to the amount of
information that humans are able to receive, process, and remember.
At any time a human being can concentrate on 7 2 chunks of information

KISS principle

KISS stands for "Keep It Simple, Stupid!"


The KISS principle states that (most) systems can be best understood - and will
work most reliably - if they are kept simple rather than made complex. Simplicity
should be a key goal in system design and unnecessary complexity should be
avoided.

Introducing Stepwise Refinement


More theory of easy problems...

Abstraction

A grouping principle which organises a system as an upside-down


tree or hierarchy of parts
Biggest / most complicated parts at the top, simpler parts arranged
underneath in increasing levels of detail (layers of abstraction)
To design and understand a program at one level, you don't need to
understand anything about the levels underneath
Focus on what not how.
Gives the human mind a much better chance of understanding the
problem and getting the solution right.

Introducing Stepwise Refinement


Example - making a cup of soup
To start, we first write down, in English, a simple statement of what
the software has to do:
make a cup of soup
Then we break this down into a sequence of simpler actions:
boil water
get a cup
get sachet of soup powder
put soup powder in cup
add water
stir

Introducing Stepwise Refinement


Next we take each of these statements and write down what
it does in greater detail. For example, the statement boil
water can be refined to:
boil water
switch on kettle
while water not boiling
watch tv
switch off kettle
We carry on with this process of refinement until the steps
are detailed enough to correspond to statements provided by
the programming language to be used.

Introducing Stepwise Refinement


Now it's your turn: have a go at refining the remaining
steps for make a cup of soup:-

get a cup

get sachet of soup powder

put soup powder in cup

add water

stir

Introducing Stepwise Refinement


How did you do?

You might also like