Top-down design

Top-down design is an approach to system design that emphasizes planning and big up-front design before construction begins. It is about the direction of work or the order of communication. In a top-down model, you start with something abstract and incrementally work toward something more concrete and detailed.

Top-down design is also known as stepwise refinement. It is sometimes used as a synonym for decomposition, which is a different but complementary design technique.

In a top-down design process, you start with a clear understanding of the overall architectural style that you want to achieve, and the architectural patterns that you want to use. Within that overall design framework, the solution is decomposed into a hierarchy of smaller, more manageable subsystems, modules, and components.

The first level components are defined initially as black boxes, with their interfaces specified but their internal workings left unspecified. Each component is then refined, with internal details described in greater detail. Additional levels of dependencies and interactions are added incrementally, until the complete system is fully specified.

Top-down design contrasts with bottom-up design, which emphasizes building a system from small, primitive components, gradually integrating lots of small parts to compose the complete solution.

Pure top-down design requires stable requirements and a strong understanding of the problem space. Bottom-up design tends to be the more natural approach where requirements are unclear or unstable, and the system can be built incrementally and iteratively from small, generic, reusable components.

ONe of the main advantages that top-down design has over bottom-up is that you get to think about, from a high level, multiple different architectural approaches, and weigh up the pros and cons of each approach, before committing to a specific design. Relative to a bottom-up approach, there is less likelihood of expensive architectural-level refactoring work being required.

Top-down design was promoted in the 1970s by IBM researchers Harlan Mills and Niklaus Wirth. Mills had implemented this method with success in a project for the New York Times, leading to the approach being adopted throughout IBM and then the wider IT industry. Wirth, the creator of the Pascal programming language, also advocated for top-down design in his work. He authored an influential paper titled Program Development by Stepwise Refinement, published in 1971, which outlined the principles of top-down design. Top-down design methods continued to be favored in software development until the late 1980s.

Modern software design practices tend to combine elements of both top-down and bottom-up design. It is hard to do either top-down or bottom-up design in a pure form. In practice, design requires a mix of both approaches. Both target a modular design, but start from different perspectives. Top-down design starts with the big picture and breaks it down into smaller parts, while bottom-up design starts with small parts and builds up to the big picture.

Programming abstractions such as object-oriented programming and functional programming support hybrid approaches that blend top-down and bottom-up design.

Data modeling is one discipline that explicitly uses both directions, drafting a top-down reference model and refining it bottom-up against existing data structures.

See also