SE Unit3
SE Unit3
Software Design
2
Why design is important?
1. Correctness
2. Understandability
3. Efficiency
4. Maintainability
4
Objectives of Design
Understandable
Maintainable 5
Software Design
6
Design Framework
7
Software Design
8
Software Design
Conceptual Design and Technical Design
9
Software Design
Conceptual design answers :
Hardware configuration
Software needs
Communication Interfaces
I/O of the system
SoftwareArchitecture
NetworkArchitecture
1
1
HLD and LLD
1
2
LOW LEVEL DESIGN
MODULARIZATION
1
3
Advantages of Modular Systems
• Modular systems are easier to understand and explain
because their parts are functionally independent.
1
5
SOFTWARE DESIGN
Software design is a creative process, just like designing anything else
To see a wrong design, we can check with the requirements in the
analysis model
To see a bad design, we need to assess the design model and analyze the
components, whether the performance can be improved by changing the
modules or the interfaces
In analyzing the software Design, many factors are used, out of which
two important factors are –
Coupling
Cohesion
16
COUPLING
Coupling is the measure of “the degree of
interdependence between modules".
(Uncoupled : no dependencies)
(a)
18
Loosely coupled: Highly coupled:
some dependencies many dependencies
(B) (C)
Fig. : Module coupling
19
Consider the example of editing a student record in a
‘student information system’.
22
Control coupling
Module A and B are said to be control coupled if they
communicate by passing of control information. This is usually
accomplished by means of flags that are set by one module and
reacted upon by the dependent module.
External coupling
A form of a coupling in which a module has a dependency to other
module, external to the software being developed or to a particular
type of hardware. This is basically related to the communication to
external tools and devices such as the operating system, shared
libraries or the hardware .
Common coupling
With common coupling, module A and module B have shared
data. Global data areas are commonly found in programming
languages. Making a change to the common data means tracing back23
to all the modules which access that data to evaluate the effect of
Fig : Example of common coupling
24
Content coupling
Content coupling occurs when module A changes data of
module B or when control is passed from one module to
the middle of another.
25
Impact of Coupling on Design
26
COHESION
Cohesion measures how a single module is related to a particular
functionality in the system.
– only one module is involved
– ideally, a highly cohesive module should do only one task/
activity/function
– example:
• a sorting module that contains only one sorting function and this
function sorts integers only.
• a sorting module that contains several sorting functions that implement
various sorting techniques but all sort integers only.
• a sorting module that contains several sorting functions that implement
various sorting techniques but sort integers and floats.
27
COHESION
Module
strength
➢ Functional cohesion
➢ Sequential cohesion
➢ Procedural cohesion
➢ Temporal cohesion
➢ Logical cohesion
➢ Coincident cohesion
29
Given a procedure that carries out operations A & B, we can
describe various forms of cohesion between A & B.
Functional Cohesion Best (high)
Sequential Cohesion
Communicational Cohesion
Procedural Cohesion
Temporal Cohesion
Logical Cohesion
31
Sequential Cohesion
32
Communicational Cohesion
end module
33
Procedural Cohesion
35
Logical Cohesion
Function A
Function B
Function C
Procedural
Related by order of functions
Examples of Cohesion
Function A Function A
Function B Function B
Function C Function C
Communicational Sequential
Access same data Output of one is input to another
Function A part 1
Function A part 2
Function A part 3
Functional
Sequential with complete, related functions
Impact of Cohesion on Design
40
Relationship between Cohesion & Coupling
42