UNIT-3 Software Design
UNIT-3 Software Design
UNIT-3 Software Design
SOFTWARE
DESIGN
Software Design
‘HOW’
2
Why design is important?
1. Correctness
2. Understandability
3. Efficiency
4. Maintainability
3
Good design vs Bad Design
Characteristics Good design Bad design
Change Change in one part of One change
the system does not requires changes to
always require a many parts of the
change in another part system.
of the system.
Cost Small High
Nature Simple Complex
Extension System can be System cannot be
extended with changes extended easily.
in only one place
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
Any other thing that translates the requirements into a solution to the customer’s
problem.
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.
• Modular systems are easier to document because each part can be documented
as an independent unit.
• Testing and debugging individual modules is easier because they can be dealt
with in isolation from the rest of the program.
• Bugs are easier to isolate and understand and they can be fixed without fear
of introducing problems outside the module.
1
4
DESIGN MODEL
After analyzing and specifying all the requirements, the process of software
design begins. Each of the elements of analysis model is used to create the
design model. The elements of design model are:-
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
HIGH LEVEL DESIGN
ARCHITECTURAL DESIGN
4
5
Attributes
The height or depth of the design hierarchy is the number of
modules along the longest path from the top-level module
down to the lowest module in the hierarchy.
4
6
STRATEGY OF DESIGN
50
Structure Chart
It partition a system into block boxes. A black box means
that functionality is known to the user without the knowledge of
internal design.
52
A structure chart for “update file” is given in fig.
54
In the above figure the MAIN module controls the system operation its
functions is to:
55
Pseudocode
•Pseudocode notation can be used in both the
preliminary and detailed design phases.
•Using pseudocode, the designer describes
system characteristics using short, concise,
English language phrases that are structured by
key words such as If-Then-Else, While-Do, and
End.
56