Module - 3 SE
Module - 3 SE
Software
Design
❖ More creative than analysis
WHAT IS DESIGN
‘HOW’
2
Software
Design
Initial requirements
Completed design
Fig. 1 : Design framework
3
Software
Design
design
Satisfy
Customer Developers
(Implementers)
4
Software
Design
Conceptual Design and Technical Design
D
e
What How
s
Conceptual Technical
design i design
g
A two part
e design System
Customer
process
r Builders
Fig. 2 : A two part design process
5
s
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?
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.
7
Software
Design
The design needs to be
➢ Correct & complete
➢ Understandable
➢ At the right level
➢ Maintainable
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
10
Software
Design
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.
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
implementation,
eases debugging, testing,
documenting, and maintenance of software
product.
13
Software
Design
(Uncoupled : no dependencies)
(a)
15
Software
Design
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.
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 ID, Student
record record
address, ID
EOF EOF
course
Retrieve Retrieve
student record student record
Poor design: Tight Coupling Good design: Loose Coupling
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.
21
Software
Design
23
Software
Design
Module
strength
➢ Procedural cohesion
➢ Temporal cohesion
➢ Logical cohesion
➢ Coincident cohesion
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.
28
Software
Design
Procedural Cohesion
➢Procedural Cohesion occurs in modules whose
although instructions different tasks yet have
accomplish
because there is a been
specificcombined
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.
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.
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.
34
Software
Design
Hybrid Design
For top-down approach to be effective, some bottom-up approach is
essential for the following reasons:
35
Software
Design
FUNCTION ORIENTED DESIGN
36
Software
Design
37
Software
Design
We continue the refinement of each module until we reach the statement
level of our programming language. At that point, we can describe the
structure of our program as a tree of refinement as in design top-down
structure as shown in fig. 14.
➢ Data Dictionaries
➢ Structure Charts
➢ Pseudocode
40
Software
Design
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.
42
Software
Design
A structure chart for “update file” is given in fig. 18.
44
Software
Design
In the above figure the MAIN module controls the system operation
its functions is to:
45
Software
Design
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 It-Then-Else, While-Do, and End.
46
Software
Design
Functional Procedure Layers
➢ Function are built in layers, Additional notation is used to
specify details.
➢ Level 0
▪ Function or procedure name
▪ Relationship to other system components (e.g.,
partof which system, called by which routines, etc.)
▪ Brief description of the function purpose.
▪ Author, date
47
Software
➢ Level 1
Design
▪ Function Parameters (problem variables, types, purpose,
etc.)
▪ Global variables (problem variable, type,
purpose, sharing information)
▪ Routines called by the function
▪ Side effects
▪ Input/Output Assertions
48
Software
➢ Level 2
Design
▪ Local data structures (variable etc.)
▪ Timing constraints
▪ Exception handling (conditions, responses, events)
▪ Any other limitations
➢ Level 3
▪ Body (structured chart, English pseudo code,
decision tables, flow charts, etc.)
49
Software
Design
IEEE Recommended practice for software design
descriptions (IEEE STD 1016-1998)
➢ Scope
An SDD is a representation of a software system that is used as a medium
for communicating software design information.
➢ References
50
Software
➢ Definitions
Design
i. Design entity. An element (Component) of a design that is
structurally and functionally distinct from other elements and
that is separately named and referenced.
51
Software
Design
➢ Purpose of an SDD
The SDD shows how the software system will be structured to
satisfy the requirements identified in the SRS. It is basically the
translation of requirements into a description of the software
structure, software components, interfaces, and data necessary for
the implementation phase. Hence, SDD becomes the blue print for
the implementation activity.
▪ Design entities
▪ Design entity attributes
52
Software
Design
The attributes and associated information items are defined in the
following subsections:
a) Identification f) Dependencies
b) Type g) Interface
c) Purpose h) Resources
d) Function i) Processing
e) Subordinates j) Data
53
Software
Design
➢ Design Description Organization
54
Software
Design
Cont…
55
Software
Design
Table 1:
Organization of
SDD
56
Software
Design View
Design
Scope Entity attribute Example
representation
Decomposition Partition of the system into Identification, type Hierarchical
description design entities purpose, function, decomposition diagram,
subordinate natural language
58
Software
Design
➢ Basic Concepts
Object Oriented Design is not dependent on any specific
implementation language. Problems are modeled using
Objects have: objects.
59
Software Design
The various terms related to object design are:
i. Objects
60
Software
Design
ii. Messages
Objects communicate by message passing. Messages consist of the
identity of the target object, the name of the requested operation and
any other operation needed to perform the function. Message are often
implemented as procedure or function calls.
iii. Abstraction
In object oriented design, complexity is managed using abstraction.
Abstraction is the elimination of the irrelevant and the amplification of
the essentials.
61
Software
iv. Class
Design
In any system, there shall be number of objects. Some of the objects
may have common characteristics and we can group the objects
according to these characteristics. This type of grouping is known as a
class. Hence, a class is a set of objects that share a common structure
and a common behavior.
We may define a class “car” and each object that represent a car
becomes an instance of this class. In this class “car”, Indica, Santro,
Maruti, Indigo are instances of this class as shown in fig. 20.
Fig.20: Indica, Santro, Maruti, Indigo are all instances of the class “car”
63
Software
Design
64
Software
v. Attributes
Design
An attributes is a data value held by the objects in a class. The square
class has two attributes: a colour and array of points. Each attributes
has a value for each object instance. The attributes are shown as
second part of the class as shown in fig. 21.
vi. Operations
An operation is a function or transformation that may be applied to or
by objects in a class. In the square class, we have two operations: set
colour() and draw(). All objects in a class share the same operations.
An object “knows” its class, and hence the right implementation of the
operation. Operation are shown in the third part of the class as
indicated in fig. 21.
65
Software
vii. Inheritance
Design
Imagine that, as well as squares, we have triangle class. Fig. 22 shows
the class for a triangle.
66
Software
Design
Now, comparing fig. 21 and 22, we can see that there is some
difference between triangle and squares classes.
For example, at a high level of abstraction, we might want to think of a
picture as made up of shapes and to draw the picture, we draw each
shape in turn. We want to eliminate the irrelevant details: we do not
care that one shape is a square and the other is a triangle as long as
both can draw themselves.
To do this, we consider the important parts out of these classes in to a
new class called Shape. Fig. 23 shows the results.
67
Software
Design
69
Software
Design
70
Software
Design
➢ Steps to Analyze and Design Object Oriented System
71
Software
Design
72
Software
Design
i. Create use case model
First step is to identify the actors interacting with the system. We
should then write the use case and draw the use case diagram.
73
Software
Design
75
Software
Design
The object types used in this analysis model are entity
objects, interface objects and control objects as given in fig. 27.
76
Software
Design
iv. Draw the class diagram
The class diagram shows the relationship amongst classes. There are
four types of relationships in class diagrams.
77
Software
Design
b) Dependencies connect two classes. Dependencies are
always unidirectional and show that one class, depends on the
definitions in another class.
78
Software
Design
v. Design of state chart diagrams
A state chart diagram is used to show the state space of a given class,
the event that cause a transition from one state to another, and the
action that result from a state change. A state transition diagram for a
“book” in the library system is given in fig. 28.
80
Software
Design
A software has to be developed for automating the manual library of a
University. The system should be stand alone in nature. It should be
designed to provide functionality’s as explained below:
Issue of Books:
❖ A student of any course should be able to get books issued.
❖ Books from General Section are issued to all but Book bank
books are issued only for their respective courses.
❖ A limitation is imposed on the number of books a student can
issue.
❖ A maximum of 4 books from Book bank and 3 books from
General section is issued for 15 days only.The software takes
the current system date as the date of issue and calculates date
of return.
81
Software
Design
❖ A bar code detector is used to save the student as well as book
information.
❖ The due date for return of the book is stamped on the book.
Return of Books:
❖ Any person can return the issued books.
❖ The student information is displayed using the bar
detector.
code
❖ The system displays the student details on whose name the
books were issued as well as the date of issue and return of the
book.
❖ The system operator verifies the duration for the issue.
❖ The information is saved and the corresponding updating take
place in the database.
82
Software
Design
Query Processing:
❖ The system should be able to provide information like:
❖ Availability of a particular book.
❖ Availability of book of any particular author.
❖ Number of copies available of the desired book.
83
Software
Design
84
Software
Design
85
Software
Design
86
Software
Design
87
Software
Design
88
Software
Design
89
Software
Design
90
Software
Design
91
Software
Design
92
Software
Design
93