Chapter 5 Software Design
Chapter 5 Software Design
K Aggarwal & Yogesh Singh, Copyright © New Age International Publishers, 2007 1
Software
Design
❖ More creative than analysis
WHAT IS DESIGN
‘HOW’
Software Engineering (3rd ed.), By K.K Aggarwal & Yogesh Singh, Copyright © New Age International Publishers, 2007 2
Software
Design
Initial requirements
Completed design
Fig. 1 : Design framework
Software Engineering (3rd ed.), By K.K Aggarwal & Yogesh Singh, Copyright © New Age International Publishers, 2007 3
Software
Design
design
Satisfy
Customer Developers
(Implementers)
Software Engineering (3rd ed.), By K.K Aggarwal & Yogesh Singh, Copyright © New Age International Publishers, 2007 4
Software
Design
Conceptual Design and Technical Design
D
e
s How
What
i
Conceptual g Technical
design n design
e
r
s
A two part design System
Customer
process Builders
Fig. 2 : A two part design process
Software Engineering (3rd ed.), By K.K Aggarwal & Yogesh Singh, Copyright © New Age International Publishers, 2007 5
Software
Design
Conceptual design answers :
✓ Where will the data come from ?
✓ What will happen to data in the system?
✓ How will the system look to users?
✓ What choices will be offered to users?
✓ What is the timings of events?
✓ How will the reports & screens look like?
Software Engineering (3rd ed.), By K.K Aggarwal & Yogesh Singh, Copyright © New Age International Publishers, 2007 6
Software
Design
Technical design describes :
❖ Hardware configuration
❖ Software needs
❖ Communication interfaces
❖ I/O of the system
❖ Software architecture
❖ Network architecture
❖ Any other thing that translates the requirements in to a
solution to the customer’s problem.
Software Engineering (3rd ed.), By K.K Aggarwal & Yogesh Singh, Copyright © New Age International Publishers, 2007 7
Software
Design
The design needs to be
➢ Correct & complete
➢ Understandable
➢ At the right level
➢ Maintainable
Software Engineering (3rd ed.), By K.K Aggarwal & Yogesh Singh, Copyright © New Age International Publishers, 2007 8
Software
Design
Informal More
design Informal formal Finished
outline design design design
i. Fortran subroutine
ii. Ada package
iii. Procedures & functions of PASCAL & C
iv. C++ / Java classes
v. Java packages
vi. Work assignment for an individual programmer
Software Engineering (3rd ed.), By K.K Aggarwal & Yogesh Singh, Copyright © New Age International Publishers, 2007 10
Software
Design
Software Engineering (3rd ed.), By K.K Aggarwal & Yogesh Singh, Copyright © New Age International Publishers, 2007 11
Software
Design
Properties :
i. Well defined subsystem
ii. Well defined purpose
iii. Can be separately compiled and stored in a
library.
iv. Module can use other modules
v. Module should be easier to use than to build
vi. Simpler from outside than from the inside.
Software Engineering (3rd ed.), By K.K Aggarwal & Yogesh Singh, Copyright © New Age International Publishers, 2007 12
Software
Design
Modularity is the single attribute of software that
allows a program to be intellectually manageable.
It enhances design clarity, which in turn eases
implementation, debugging, testing,
documenting, and maintenance of software
product.
Software Engineering (3rd ed.), By K.K Aggarwal & Yogesh Singh, Copyright © New Age International Publishers, 2007 13
Software
Design
(Uncoupled : no dependencies)
(a)
Software Engineering (3rd ed.), By K.K Aggarwal & Yogesh Singh, Copyright © New Age International Publishers, 2007 15
Software
Design
Software Engineering (3rd ed.), By K.K Aggarwal & Yogesh Singh, Copyright © New Age International Publishers, 2007 16
Software
Design
This can be achieved as:
❑ Controlling the number of parameters passed
amongst modules.
❑ Avoid passing undesired data to calling
module.
❑ Maintain parent / child relationship between
calling & called modules.
❑ Pass data, not the control information.
Software Engineering (3rd ed.), By K.K Aggarwal & Yogesh Singh, Copyright © New Age International Publishers, 2007 17
Software
Design
Consider the example of editing a student record in a
‘student information system’.
Edit student Edit student
record record
Student name,
Student Student Student
student ID,
record ID record
address,
EOF EOF
course
Retrieve Retrieve
student record student record
Poor design: Tight Coupling Good design: Loose Coupling
Software Engineering (3rd ed.), By K.K Aggarwal & Yogesh Singh, Copyright © New Age International Publishers, 2007 20
Software
Design
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.
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
back to all the modules which access that data to evaluate the
effect of changes.
Software Engineering (3rd ed.), By K.K Aggarwal & Yogesh Singh, Copyright © New Age International Publishers, 2007 21
Software
Design
Software Engineering (3rd ed.), By K.K Aggarwal & Yogesh Singh, Copyright © New Age International Publishers, 2007 23
Software
Design
Module
strength
➢ Procedural cohesion
➢ Temporal cohesion
➢ Logical cohesion
➢ Coincident cohesion
Software Engineering (3rd ed.), By K.K Aggarwal & Yogesh Singh, Copyright © New Age International Publishers, 2007 26
Software
Design
Functional Cohesion Best (high)
Sequential Cohesion
Communicational Cohesion
Procedural Cohesion
Temporal Cohesion
Logical Cohesion
Sequential Cohesion
➢Module A outputs some data which forms the input to B. This is
the reason for them to be contained in the same procedure.
Software Engineering (3rd ed.), By K.K Aggarwal & Yogesh Singh, Copyright © New Age International Publishers, 2007 28
Software
Design
Procedural Cohesion
➢Procedural Cohesion occurs in modules whose instructions
although accomplish different tasks yet have been combined
because there is a specific order in which the tasks are to be
completed.
Temporal Cohesion
➢Module exhibits temporal cohesion when it contains tasks that
are related by the fact that all tasks must be executed in the
same time-span.
Software Engineering (3rd ed.), By K.K Aggarwal & Yogesh Singh, Copyright © New Age International Publishers, 2007 29
Software
Design
Logical Cohesion
➢ Logical cohesion occurs in modules that contain instructions
that appear to be related because they fall into the same logical
class of functions.
Coincidental Cohesion
➢Coincidental cohesion exists in modules that contain
instructions that have little or no relationship to one another.
Software Engineering (3rd ed.), By K.K Aggarwal & Yogesh Singh, Copyright © New Age International Publishers, 2007 30
Software
Design
Relationship between Cohesion & Coupling
If the software is not properly modularized, a host of seemingly
trivial enhancement or changes will result into death of the project.
Therefore, a software engineer must design the modules with goal of
high cohesion and low coupling.