Page 135 - DCAP405_SOFTWARE_ENGINEERING
P. 135
Software Engineering
Notes Modular Design
A modular design reduces the design complexity and results in easier and faster implementation
by allowing parallel development of different parts of a system. We discuss the various concepts
of modular design in detail in this section:
1. Functional Independence: This concept evolves directly from the concepts of abstraction,
information hiding and modularity. Functional independence is achieved by developing
functions that perform only one kind of task and do not excessively interact with other
modules. Independence is important because it makes implementation easier and faster.
The independent modules are easier to maintain, test, and reduce error propagation and
can be reused in other programs as well. Thus, functional independence is a good design
feature which ensures software quality. It is measured using two criteria: coupling and
cohesion.
2. Module Coupling:
Figure 8.1: Module Coupling
Uncoupled: Loosely coupled: Highly coupled:
no dependence some dependence large dependence
Task Analyze at what extend the functional dependence affects the modular design.
Coupling is the measure of degree of interdependence amongst modules. Two modules
that are tightly coupled are strongly dependent on each other. However, two modules
that are loosely coupled are not dependent on each other. Uncoupled modules have no
interdependence at all within them. The various types of coupling techniques are depicted
in Figure 8.1.
A good design is the one that has low coupling. Coupling is measured by the number of
interconnections between the modules. That is, the coupling increases as the number of
calls between modules increase or the amount of shared data is large. Thus, it can be said
that a design with high coupling will have more errors. Different types of coupling are
content, common, external, control, stamp and data. The level of coupling in each of these
types is given in Figure 8.2.
The direction of the arrow in Figure 8.2 points from the lowest coupling to highest
coupling. The strength of coupling is influenced by the complexity of the modules, the
type of connection and the type of communication. Modifications done in the data of one
block may require changes in other block of a different module which is coupled to the
former module.
128 LOVELY PROFESSIONAL UNIVERSITY