SE Module 3
SE Module 3
Module-3
Software
Design
Module-3 Contents
Software Design:
Overview of the Design Process
Cohesion and Coupling
Layered Arrangement of Modules
Approaches to Software Design
FOD:
SA/SD Methodology
DFD
Structured Design
Detailed Design
Introduction
SRS Design
Document Design Activities Documents
Items Designed in Design Phase
Modules
d3 d1 d4
Relationships among modules
interfaces among modules
1. High-level design
d1 d2
Also called
d3 d1 d4
structure chart
2. Detailed design
D1 ..
For each module, design : D2 .. Data
D3 ..
Data structure & F1 .. Functions
F2 ..
Algorithms (or functions) F3 ..
F4 ..
F5 ..
Characteristics of a good design
1. Correctness
2. Understandability
3. Maintainability
4. Efficiency
5. Modularity
6. Clean decomposition
7. Neat Arrangement
8. High cohesion & Low coupling
9. High Fan-In & Low Fan-Out
Characteristics of a good design
M1 M1
M2 M3
M2 M3
M4 M5 M6
M4 M5 M6
Modular Design
Design exhibiting poor
Characteristics of a good design
7. Neat arrangement
Bad Design
8. Cohesion & Coupling
D1 ..
D2 ..
D3 ..
Data
F1 .. Functions
F2 ..
F3 ..
F4 ..
F5 ..
Adv.s of Functional Independence
Ex
Initialization of a process
Start-up process
Shut-down process etc.
4. Procedural cohesion
search
display
7. Functional cohesion
common
content
1. Data Coupling & 2. Stamp coupling
Ex:
A flag set in Module-1 and tested in Module-2
If (Book Availability_Status = True)
Then Renew_Book
Else Display Regret message
Design Approaches
1.Function-oriented design
2.Object-oriented design
1. Function-Oriented Design
Unlike FOD,
in OOD, the basic component is not functions such
as “sort”, “display”, “track”, etc.
but real-world entities such as “employee”,
“machine”, “Account”, etc.
OOD VS FOD
1. As per Grady Booch : Identify verbs if you are doing FOD &
Identify nouns if you are doing OOD”
Introduction to function-oriented
design
High level Design
SA/SD Methodology
Data flow diagrams (DFDs)
Introduction
Symbols
Level-0 DFD (Context Diagram)
Level-1 DFD (Example)
Level-2 DFD (Example)
Rules of DFD
Examples
Detailed Design
FOD -
Introduction
Function-oriented design techniques are very
popular
Heavily used in many s/w dev. organizations
(DFDs)
Data flow diagrams
Function or Process:
External Entity
Process
Data Flow
Output
Data Store
(1) External Entity
Customer
Represented by a rectangle
(2) Process Symbol
Matching Book-Details
from or written to
Books
An arrow into or out of a DS
implicitly represents the entire data of the data
store
arrows connecting to a data store need not be
labelled
(5) Output Symbol
number
Read- Validate-
numbers numbers Valid
Data- 0.1 0.2 number
items
Asynchronous operation
Read- Validate-
numbers numbers
0.1 0.2
numbers Valid
Data- number
items
How is Structured Analysis Performed /
Developing DFD model of a system
* *:
Anything appearing within * * is considered as
comment
Data Dictionary – Tic-Tac-Toe Game DFD
Display=game + result
move = integer /* number between 1-9 */
board = {Integer}9
game = board /* number 1 to 9 */
result=string [“computer won”, “human won”,
“draw”]
Ex1: Transport Service Automation System
User credentials
Authentication Status
Car Inquiry Details
Available Car Details
Selected Car for Transport
Booking Service
Car Booking Auto.
Customer Confirmation System
Amend/Cancel Booking info
Booking Amendment/ 0
Cancel Confirmation
Payment Status
Level 1 DFD
Decomposition of a bubble:
Also called factoring or exploding
A simple algorithm
Ex1: Transport Service Automation System
User credentials
Authentication Status
Car Inquiry Details
Available Car Details
Selected Car for Transport
Booking Service
Car Booking Auto.
Customer Confirmation System
Amend/Cancel Booking info
Booking Amendment/ 0
Cancel Confirmation
Payment Status
DFD-1: Transport Service Auto. System
DFD-2: Transport Service Auto. System
Decomposition is stopped after reaching “simple set
instruction” level:
c
b c
c1
d1
a d
e
Level 1 d e1
e
Level 2
Rule-2: Numbering of
Bubbles
For this, the customer needs to supply his/her residence address, telephone
number, and the driving license number.
Each customer who registers for this scheme is assigned a unique customer number
(CN) by the computer.
A customer can present his CN to the check out staff when he makes any purchase.
In this case, the value of his purchase is credited against his CN.
At the end of each year, the supermarket intends to award surprise gifts to 10
customers who make the highest total purchase over the year.
Also, it intends to award a 22 caret gold coin to every customer whose purchase
exceeded Rs.10,000. The entries against the CN are the reset on the day of every
year after the prize winners’ lists are generated
Context diagram
Level 1
Level 2
Structure chart
Data Dictionary - Supermarket prize
scheme
Commonly made errors
• Unbalanced DFDs
• Forgetting to mention the names of the data flows
• Unrepresented functions or data
• External entities appearing at higher level DFDs
• Trying to represent control aspects
• Context diagram having more than one bubble
• A bubble decomposed into too many bubbles in the
next level (should be 3 to 7)
• Terminating decomposition too early
• Nouns used in naming bubbles
Shortcomings of the DFD Model
Customer-history Item-file
Accept- inventory
Customer-file order
order Process-
Accepted-
orders order
Shortcomings of the DFD Model
Transaction-
center
trans 3
trans 1
trans 2
Customer-history Item-file
query
Handle-
indent- Sales-statistics
Indent-request request
Indents
pending-order
Structure Chart
root
order query
indent