Page 136 - DCAP305_PRINCIPLES_OF_SOFTWARE_ENGINEERING
P. 136
Principles of Software Engineering
Notes 6.4.2 Module-level Concepts
• A module is a logically separable part of a program. It is a program unit that is discreet
and identifiable with respect to compiling and loading.
• In terms of common programming language constructs, a module can be a macro, a
function, a procedure (or subroutine), a process, or a package.
• In systems using functional abstraction, a module is usually a procedure of function or a
collection of these.
• To produce modular designs, some criteria must be used to select modules so that the
modules support well-defined abstractions and are solvable and modifiable separately.
• In a system using functional abstraction, coupling and cohesion are two modularization
criteria, which are often used together.
6.5 Top-down Approach
A top-down approach (is also known as step-wise design) is essentially the breaking down of
a system to increase insight into its compositional sub-systems. In a top-down approach an
overview of the system is formulated, specifying but not detailing any first-level subsystems.
Each subsystem is then refined in yet greater detail, sometimes in many additional subsystem
levels, until the entire specification is reduced to base elements. A top-down model is often
specified with the assistance of “black boxes”, these make it easier to manipulate. However,
black boxes may fail to elucidate elementary mechanisms or be detailed enough to realistically
validate the model.
In this approach testing is conducted from main module to sub module. If the sub module is
not developed a temporary program called STUB is used for simulate the sub module.
Figure 6.2: Top-down Approach
Main modules Movement
Subordinate
module
(Movement in top-down approach)
Advantages:
(a) Advantageous if major flaws occur toward the top of the program.
(b) Once the I/O functions are added, representation of test cases is easier.
(c) Early skeletal Program allows demonstrations and boosts morale.
Disadvantages:
(a) Stub modules must be produced
130 LOVELY PROFESSIONAL UNIVERSITY