Top-down design (sometimes called ‘stepwise refinement’) is a term used to describe how a complex problem is broken down into modules. Those modules are then broken down into sub-modules. Each sub-module is then broken down further and further, until the sub-modules do just one task and are simple enough to program. Instead of writing one big program, the program is split into self-contained ‘modules’ of code. Modules are sometimes called ‘procedures‘ or ‘functions’.
This approach has many advantages!
Splitting up a problem into modules helps get the job done more efficiently because modules of code can be worked on at the same time by different programmers.
Splitting up a problem into modules helps a team of programmers work more efficiently because easier modules can be given to less experienced programmers while the harder ones can be given to more experienced ones.
Splitting up a problem into modules helps program testing because it is easier to debug lots of smaller self-contained modules than one big program.
Splitting up a problem into modules helps program readability because it is easier to follow what is going on in smaller modules than a big program.
Splitting up a problem into modules improves a company’s efficiency because self-contained modules can be re-used. They can be put into a library of modules. When a module is needed to display some values, for example, you don’t need to get the programmers to write and test a module for this again. You just re-use a module from the library. Over time, this will save a company a lot of time and money.
Splitting up a problem into modules improves a Project Manager’s ability to monitor the progress of a program. Modules can be ‘ticked off the list’ as they are done and this will demonstrate some progress. This is far harder for a Project Manager to do if the program has not been split up into modules.
Splitting up a problem into modules is good for future program maintenance. If a program needs to be changed for any reason, it may be possible simply to remove one module of code and replace it with another.