Top-down and bottom-up design

From Wikipedia, the free encyclopedia

Top-down and bottom-up are strategies of information processing and knowledge ordering, mostly involving software, and by extension other humanistic and scientific system theories (see systemics).

In the top-down model an overview of the system is formulated, without going into detail for any part of it. Each part of the system is then refined by designing it in more detail. Each new part may then be refined again, defining it in yet more detail until the entire specification is detailed enough to validate the model. The top-down model is often designed with the assistance of "dark boxes" that make it easier to bring to fulfillment but insufficient and irrelevant in understanding the elementary mechanisms.

In bottom-up design, first the individual parts of the system are specified in great detail. The parts are then linked together to form larger components, which are in turn linked until a complete system is formed. This strategy often resembles a "seed" model, whereby the beginnings are small, but eventually grow in complexity and completeness.

Contents

[edit] Computer science

[edit] Software development

Part of this section is from the Perl Design Patterns Book.

In the software development process, the top-down and bottom-up approaches play a key role.

Top-down approaches emphasise planning and a complete understanding of the system. It is inherent that no coding can begin until a sufficient level of detail has been reached in the design of at least some part of the system. This, however, delays testing of the ultimate functional units of a system until significant design is complete. Bottom-up emphasizes coding and early testing, which can begin as soon as the first module has been specified. This approach, however, runs the risk that modules may be coded without having a clear idea of how they link to other parts of the system, and that such linking may not be as easy as first thought. Re-usability of code is one of the main benefits of the bottom-up approach.

Top-down design was promoted in the 1970s by IBM researcher Harlan Mills and Niklaus Wirth. Mills developed structured programming concepts for practical use and tested them in a 1969 project to automate the New York Times morgue index. The engineering and management success of this project led to the spread of the top-down approach through IBM and the rest of the computer industry. Niklaus Wirth, among other achievements the developer of Pascal programming language, wrote the influential paper Program Development by Stepwise Refinement. Top-down methods were favored in software engineering until the rise of object-oriented programming in the late 1980s.

Modern software design approaches usually combine both top-down and bottom-up approaches. Although an understanding of the complete system is usually considered necessary for good design, leading theoretically to a top-down approach, most software projects attempt to make use of existing code to some degree. Pre-existing modules give designs a bottom-up flavour. Some design approaches also use an approach where a partially-functional system is designed and coded to completion, and this system is then expanded to fulfill all the requirements for the project.

[edit] Programming

Top-down programming is a programming style, the mainstay of traditional procedural languages, in which design begins by specifying complex pieces and then dividing them into successively smaller pieces. Eventually, the components are specific enough to be coded and the program is written. This is the exact opposite of the bottom-up programming approach which is common in object-oriented languages such as C++ or Java.

The technique for writing a program using top-down methods is to write a main procedure that names all the major functions it will need. Later, the programming team looks at the requirements of each of those functions and the process is repeated. These compartmentalized sub-routines eventually will perform actions so simple they can be easily and concisely coded. When all the various sub-routines have been coded the program is done.

Advantages of top-down programming:

  • Programming team stays focused on the goal
  • Everyone knows his or her job.
  • By the time the programming starts there are no questions.
  • Code is easier to follow, since it is written methodically and with purpose.

Disadvantages of top-down programming:

  • Top-down programming may complicate testing, since nothing executable will even exist until near the end of the project.
  • Bottom-up programming may allow for unit testing, but until more of the system comes together none of the system can be tested as a whole, often causing complications near the end of the project, "Individually we stand, combined we fall."
  • All decisions depend on the starting goal of the project, and some decisions cannot be made depending on how specific that description is.

Summarizing, in practice, there are few approaches which formally attempt to the integration of the top-down and bottom-up programming and problem specification strategies, one of them is proposed in the systemic goal-oriented TOGA metatheory.

[edit] Parsing

Parsing is the process of analyzing an input sequence (such as that read from a file or a keyboard) in order to determine its grammatical structure. This method is used in the analysis of both natural languages and computer languages, as in a compiler.

Bottom-up parsing is a strategy for analyzing unknown data relationships that attempts to identify the most fundamental units first, and then to infer higher-order structures from them. Top-down parsers, on the other hand, hypothesize general parse tree structures and then consider whether the known fundamental structures are compatible with the hypothesis. See Top-down parsing and Bottom-up parsing.

[edit] Nanotechnology

Main article: Nanotechnology

Top-down and bottom-up are used as two approaches for assembling nanoscale materials and devices. Bottom-up approaches seek to have smaller (usually molecular) components arrange themselves into more complex assemblies, while top-down approaches seek to create nanoscale devices by using larger, externally-controlled ones to direct their assembly.

The top-down approach often uses the traditional workshop or microfabrication methods where externally-controlled tools are used to cut, mill and shape materials into the desired shape and order. Bottom-up approaches, in contrast, use the chemical properites of single molecules to cause single-molecule components to automatically arrange themselves into some useful conformation. These approaches utilize the concepts of molecular self-assembly and/or molecular recognition. See also Supramolecular chemistry.

Such bottom-up approaches should, broadly speaking, be able to produce devices in parallel and much cheaper than top-down methods, but could potentially be overwhelmed as the size and complexity of the desired assembly increases.

[edit] Neuroscience and psychology

This vocabulary is also employed in neuroscience and psychology. The study of visual attention provides an example. If your attention is drawn to a flower in a field, it may be simply that the flower is more visually salient than the surrounding field. The information which caused you to attend to the flower came to you in a bottom-up fashion -- your attention was not contingent upon knowledge of the flower; the outside stimulus was sufficient on its own. Contrast this situation with one in which you are looking for a flower. You have a representation of what you are looking for. When you see the object you are looking for, it is salient. This is an example of the use of top-down information.

[edit] Architectural

Often, the École des Beaux-Arts school of design is said to have primarily promoted top-down-design because it taught that an architectural design should begin with a parti, a basic plan drawing of the overall project. By contrast, the Bauhaus focused on bottom-up-design. This method manifested itself in the study of translating small-scale organizational systems to a larger, more architectural scale (as with the woodpanel carving and furniture design).

[edit] External links