Design is where the customer's requirements first take the form of a solution. A poor design cannot be saved by good coding, so the design stage matters greatly.

The Design Process

Software design is an iterative process through which requirements are translated into a blueprint for building the software. The design begins at a high level, which gives the overall structure, and moves to lower levels of detail. Each design step produces a model that can be checked against the requirements before any code is written. Design is a link between the requirements and the code, and it must therefore be traceable to the requirements.

Definition: Software design. The process of translating requirements into a blueprint of the structure, data, interfaces and components of the software.

Design Quality

A good design must implement all the explicit requirements of the analysis model and all the implicit ones the customer wants. It must be readable and understandable by those who build, test and support the software. It must give a complete picture of the data, the functions and the behaviour from an implementation point of view. Quality is judged by guidelines such as a modular structure, a distinct representation of data, architecture, interfaces and components, and components that show independent functional characteristics.

Design Concepts

Several ideas guide the designer. Abstraction hides the detail and shows only the essential idea, as in a procedure name that represents a long set of steps. Architecture is the overall structure of the software. Modularity divides the software into separately named components that are integrated to meet the requirements. Information hiding keeps the internal detail of a module private behind a stable interface. Functional independence is achieved by modules that have a single purpose, and it is measured by cohesion, which should be high, and coupling, which should be low. Refinement develops a design by stepwise detail, and refactoring improves the design without changing the behaviour. Separation of concerns divides a problem into parts that can be handled independently.

Table 3.1: Cohesion and coupling

Measure Meaning Aim
Cohesion How strongly the elements of one module belong together High
Coupling How much one module depends on others Low
Best form Functional cohesion Data coupling
Worst form Coincidental cohesion Content coupling

Example 3.1: Judging a module

Problem: A module named Utility handles printing a report, validating a date and calculating tax. Comment on its cohesion and suggest a change.

Solution:

  1. The three tasks are unrelated, so the module has coincidental cohesion, which is the weakest form.
  2. Split it into three modules, each with one purpose.

Result: Cohesion rises to functional cohesion, and a change in one task no longer affects the others.

Common mistakes

  • Creating a large module that does many unrelated jobs.
  • Letting modules share global data, which raises coupling.
  • Treating design as a step to be skipped when the schedule is short.

Key takeaways

  • Design converts requirements into a blueprint.
  • Good design is modular, with high cohesion and low coupling.
  • Abstraction and information hiding reduce complexity.
  • Design must be traceable to the requirements.

Practice questions

  1. What is the aim of cohesion and coupling in design?
  2. What is information hiding?
  3. Name three design concepts.

Answers to the practice questions

  1. High cohesion within modules and low coupling between modules.
  2. Keeping the internal details of a module private behind a stable interface.
  3. Abstraction, modularity and refinement (also architecture and information hiding).

Sources

  • Official BCA syllabus Software Engineering, course code 26BCA403DS03, Unit III