1
Function-Oriented
Software Design (lecture 5)
Prof. R. Mall
Dept. of CSE, IIT, Kharagpur
2
Introduction
â—Ź Function-oriented design techniques
are very popular:
– Currently in use in many software
development organizations.
â—Ź Function-oriented design techniques:
– Start with the functional requirements
specified in the SRS document.
3
Introduction
â—Ź During the design process:
–High-level functions are
successively decomposed:
â—Ź Into more detailed functions.
–Finally the detailed functions
are mapped to a module
structure.
4
Introduction
â—Ź Successive decomposition of
high-level functions:
– Into more detailed functions.
– Technically known as top-
down decomposition.
5
Introduction
â—Ź SA/SD methodology:
– has essential features of several
important function-oriented design
methodologies:
â—Ź If you need to use any specific design
methodology later on,
â—Ź You can do so easily with small
additional effort.
6
SA/SD (Structured
Analysis/Structured Design)
â—Ź SA/SD technique draws heavily from the
following methodologies:
– Constantine and Yourdon's methodology
– Hatley and Pirbhai's methodology
– Gane and Sarson's methodology
– DeMarco and Yourdon's methodology
â—Ź SA/SD technique can be used to perform
– high-level design.
7
Overview of SA/SD
Methodology
â—Ź SA/SD methodology consists of two
distinct activities:
– Structured Analysis (SA)
– Structured Design (SD)
â—Ź During structured analysis:
– functional decomposition takes place.
â—Ź During structured design:
– module structure is formalized.
8
Functional Decomposition
â—Ź Each function is analyzed:
– Hierarchically decomposed into
more detailed functions.
– Simultaneous decomposition of
high-level data
â—Ź Into more detailed data.
9
Structured Analysis
â—Ź Transforms a textual problem
description into a graphic model.
– Done using data flow diagrams
(DFDs).
– DFDs graphically represent the
results of structured analysis.
10
Structured Design
â—Ź All the functions represented in
the DFD:
– Mapped to a module structure.
â—Ź The module structure:
– Also called as the software
architecture:
11
Detailed Design
â—Ź Software architecture:
– Refined through detailed design.
– Detailed design can be directly
implemented:
â—Ź Using a conventional programming
language.
12
Structured Analysis vs.
Structured Design
â—Ź Purpose of structured analysis:
– Capture the detailed structure of
the system as the user views it.
â—Ź Purpose of structured design:
– Arrive at a form that is suitable
for implementation in some
programming language.
13
Structured Analysis vs.
Structured Design
â—Ź The results of structured analysis can be easily
understood even by ordinary customers:
– Does not require computer knowledge.
– Directly represents customer’s perception of the
problem.
– Uses customer’s terminology for naming different
functions and data.
â—Ź The results of structured analysis can be
reviewed by customers:
– To check whether it captures all their
requirements.
14
Structured Analysis
â—Ź Based on principles of:
– Top-down decomposition approach.
– Divide and conquer principle:
â—Ź Each function is considered individually (i.e.
isolated from other functions).
â—Ź Decompose functions totally disregarding
what happens in other functions.
– Graphical representation of results using
â—Ź Data flow diagrams (or bubble charts).
15
Data Flow Diagrams
â—Ź DFD is an elegant modelling
technique:
– Useful not only to represent the
results of structured analysis.
– Applicable to other areas also:
â—Ź e.g. for showing the flow of documents or
items in an organization,
â—Ź DFD technique is very popular:
– It is powerful and yet simple to
understand and use.
16
Data Flow Diagram
â—Ź DFD is a hierarchical graphical
model:
– Shows the different functions (or
processes) of the system and
– Data interchange among the
processes.
17
DFD Concepts
â—Ź It is useful to consider each
function as a processing
station:
– Each function consumes some
input data.
– Produces some output data.
18
Data Flow Model of a Car
Assembly Unit
Fit
Engine
Paint and
Test
Fit
Wheels
Fit
Doors
Chassis Store
Door Store
Wheel Store
Engine Store
Car
Partly
Assembled
Car
Assembled
Car
Chassis
with Engine
19
Data Flow Diagrams (DFDs)
â—Ź A DFD model:
– Uses limited types of symbols.
– Simple set of rules
– Easy to understand:
â—Ź It is a hierarchical model.
20
Hierarchical Model
â—Ź Human mind can easily understand
any hierarchical model:
– In a hierarchical model:
â—Ź We start with a very simple and
abstract model of a system,
â—Ź Details are slowly introduced through
the hierarchies.
21
Hierarchical Model
22
Data Flow Diagrams (DFDs)
â—Ź Primitive Symbols Used for Constructing DFDs:
23
External Entity Symbol
â—Ź Represented by a rectangle
â—Ź External entities are real
physical entities:
– input data to the system or
– consume data produced by the system.
– Sometimes external entities are called
terminator, source, or sink.
Librarian
24
Function Symbol
● A function such as “search-book” is
represented using a circle:
– This symbol is called a
process or bubble or transform.
– Bubbles are annotated with corresponding
function names.
– Functions represent some activity:
â—Ź Function names should be verbs.
search-
book
25
Data Flow Symbol
â—Ź A directed arc or line.
– Represents data flow in the
direction of the arrow.
– Data flow symbols are annotated
with names of data they carry.
book-name
26
Data Store Symbol
â—Ź Represents a logical file:
– A logical file can be:
â—Ź a data structure
â—Ź a physical file on disk.
– Each data store is connected to a
process:
â—Ź By means of a data flow symbol.
book-details
27
Data Store Symbol
â—Ź Direction of data flow arrow:
– Shows whether data is being read
from or written into it.
â—Ź An arrow into or out of a data store:
– Implicitly represents the entire data of the
data store
– Arrows connecting to a data store need not
be annotated with any data name.
find-book
Books
28
Output Symbol
â—Ź Output produced by the system
29
Synchronous Operation
â—Ź If two bubbles are directly connected by
a data flow arrow:
– They are synchronous
Data-
items
Read-
numbers
0.1
Validate-
numbers
0.2 Valid
number
number
30
Asynchronous Operation
â—Ź If two bubbles are connected via a
data store:
– They are not synchronous.
Data-
items
Read-
numbers
0.1
Validate-
numbers
0.2 Valid
number
numbers
31
Yourdon's vs. Gane Sarson
Notations
â—Ź The notations that we would be
following are closer to the Yourdon's
notations
â—Ź You may sometimes find notations in
books that are slightly different
– For example, the data store may look
like a box with one end closed
32
How is Structured Analysis
Performed?
â—Ź Initially represent the software
at the most abstract level:
– Called the context diagram.
– The entire system is represented as
a single bubble,
– This bubble is labelled according to
the main function of the system.
33
Tic-tac-toe: Context
Diagram
Human Player
Tic-tac-
toe
software
display
move
34
Context Diagram
â—Ź A context diagram shows:
– Data input to the system,
– Output data generated by
the system,
– External entities.
35
Context Diagram
â—Ź Context diagram captures:
– Various entities external to the system
and interacting with it.
– Data flow occurring between the
system and the external entities.
â—Ź The context diagram is also called as
the level 0 DFD.
36
Context Diagram
â—Ź Establishes the context of
the system, i.e.
– Represents:
â—Ź Data sources
â—Ź Data sinks.
37
Level 1 DFD
â—Ź Examine the SRS document:
– Represent each high-level function as a
bubble.
– Represent data input to every high-
level function.
– Represent data output from every
high-level function.
38
Higher Level DFDs
â—Ź Each high-level function is separately
decomposed into subfunctions:
– Identify the subfunctions of the function
– Identify the data input to each subfunction
– Identify the data output from each
subfunction
â—Ź These are represented as DFDs.
39
Decomposition
â—Ź Decomposition of a bubble:
– Also called factoring or
exploding.
â—Ź Each bubble is decomposed to
– Between 3 to 7 bubbles.
40
Decomposition
â—Ź Too few bubbles make
decomposition superfluous:
– If a bubble is decomposed to
just one or two bubbles:
â—Ź Then this decomposition is
redundant.
41
Decomposition
â—Ź Too many bubbles:
– More than 7 bubbles at any level
of a DFD.
– Make the DFD model hard to
understand.
42
Decompose How Long?
â—Ź Decomposition of a bubble
should be carried on until:
– A level at which the function of
the bubble can be described
using a simple algorithm.
43
Example 1: RMS Calculating
Software
â—Ź Consider a software called RMS
calculating software:
– Reads three integers in the range of -
1000 and +1000
– Finds out the root mean square (rms)
of the three input numbers
– Displays the result.
44
Example 1: RMS Calculating
Software
â—Ź The context diagram is simple
to develop:
– The system accepts 3 integers
from the user
– Returns the result to him.
45
Example 1: RMS Calculating
Software
Compute-
RMS
0
User
Data-
items
result
Context Diagram
46
Example 1: RMS Calculating
Software
â—Ź From a cursory analysis of
the problem description:
– We can see that the system
needs to perform several
things.
47
Example 1: RMS Calculating
Software
â—Ź Accept input numbers from
the user:
– Validate the numbers,
– Calculate the root mean square
of the input numbers
– Display the result.
48
Example 1: RMS Calculating
Software
Data-
items
result
Read-
numbers
0.1
Validate-
numbers
0.2
Compute-
rms
0.3
Display
0.4
RMS
numbers
Valid -
numbers
error
49
Example 1: RMS Calculating
Software
Calculate-
squared-
sum
0.3.1
Calculate-
mean
0.3.2
Calculate-
root
0.3.3
Valid -
numbers
Squared-
sum
RMS
Mean-
square
50
Example: RMS Calculating
Software
Square
0.3.1.1
Square
0.3.1.2
Square
0.3.1.3
Sum
0.3.1.4
a
b
c
asq
bsq
csq
Squared-sum
51
Example: RMS Calculating
Software
â—Ź Decomposition is never carried on
up to basic instruction level:
– A bubble is not decomposed any
further:
â—Ź If it can be represented by a simple
set of instructions.
52
Data Dictionary
â—Ź A DFD is always accompanied by a data
dictionary.
â—Ź A data dictionary lists all data items appearing
in a DFD:
– Definition of all composite data items in terms of
their component data items.
– All data names along with the purpose of the data
items.
â—Ź For example, a data dictionary entry may be:
– grossPay = regularPay+overtimePay
53
Importance of Data
Dictionary
â—Ź Provides all engineers in a project with
standard terminology for all data:
– A consistent vocabulary for data is very
important
– Different engineers tend to use different
terms to refer to the same data,
â—Ź Causes unnecessary confusion.
54
Importance of Data
Dictionary
â—Ź Data dictionary provides the definition of
different data:
– In terms of their component elements.
â—Ź For large systems,
– The data dictionary grows rapidly in size and
complexity.
– Typical projects can have thousands of data
dictionary entries.
– It is extremely difficult to maintain such a
dictionary manually.
55
Data Dictionary
â—Ź CASE (Computer Aided Software
Engineering) tools come handy:
– CASE tools capture the data items
appearing in a DFD automatically to
generate the data dictionary.
56
Data Dictionary
â—Ź CASE tools support queries:
– About definition and usage of data items.
â—Ź For example, queries may be made to find:
– Which data item affects which processes,
– A process affects which data items,
– The definition and usage of specific data items, etc.
â—Ź Query handling is facilitated:
– If data dictionary is stored in a relational database
management system (RDBMS).
57
Data Definition
â—Ź Composite data are defined in terms of
primitive data items using following operators:
â—Ź +: denotes composition of data items, e.g
– a+b represents data a and b.
â—Ź [,,,]: represents selection,
– i.e. any one of the data items listed inside the
square bracket can occur.
– For example, [a,b] represents either a occurs or
b occurs.
58
Data Definition
â—Ź ( ): contents inside the bracket
represent optional data
– which may or may not appear.
– a+(b) represents either a or a+b occurs.
â—Ź {}: represents iterative data definition,
– e.g. {name}5 represents five name data.
59
Data Definition
â—Ź {name}* represents
– zero or more instances of name data.
â—Ź = represents equivalence,
– e.g. a=b+c means that a represents b and
c.
â—Ź * *: Anything appearing within * * is
considered as comment.
60
Data Dictionary for RMS
Software
â—Ź numbers=valid-numbers=a+b+c
â—Ź a:integer * input number *
â—Ź b:integer * input number *
â—Ź c:integer * input number *
â—Ź asq:integer
â—Ź bsq:integer
â—Ź csq:integer
â—Ź squared-sum: integer
â—Ź Result=[RMS,error]
â—Ź RMS: integer * root mean square value*
â—Ź error:string * error message*
61
Balancing a DFD
â—Ź Data flowing into or out of a bubble:
– Must match the data flows at the next level of
DFD.
â—Ź In the level 1 of the DFD,
– Data item c flows into the bubble P3 and the data
item d and e flow out.
â—Ź In the next level, bubble P3 is decomposed.
– The decomposition is balanced as data item c flows
into the level 2 diagram and d and e flow out.
62
Balancing a DFD
a
b
e
d
c
c
d
e
c1
d1
e1
Level 1
Level 2
63
Numbering of Bubbles
â—Ź Number the bubbles in a DFD:
– Numbers help in uniquely identifying any bubble
from its bubble number.
â—Ź The bubble at context level:
– Assigned number 0.
â—Ź Bubbles at level 1:
– Numbered 0.1, 0.2, 0.3, etc
â—Ź When a bubble numbered x is decomposed,
– Its children bubble are numbered x.1, x.2, x.3, etc.
64
Example 2: Tic-Tac-Toe
Computer Game
â—Ź A human player and the computer make
alternate moves on a 3 X 3 square.
â—Ź A move consists of marking a previously
unmarked square.
â—Ź The user inputs a number between 1 and 9 to
mark a square
â—Ź Whoever is first to place three consecutive
marks along a straight line (i.e., along a row,
column, or diagonal) on the square wins.
65
Example: Tic-Tac-Toe
Computer Game
â—Ź As soon as either of the human player or the
computer wins,
– A message announcing the winner should be
displayed.
â—Ź If neither player manages to get three
consecutive marks along a straight line,
– And all the squares on the board are filled up,
– Then the game is drawn.
â—Ź The computer always tries to win a game.
66
Context Diagram for
Example
Human Player
Tic-tac-
toe
software
0
display
move
67
Level 1 DFD
board
Display-
board
0.1
Check-
winner
0.4
Validate-
move
0.2
Play-
move
0.3
move
result
game
68
Data Dictionary
â—Ź Display=game + result
â—Ź move = integer
â—Ź board = {integer}9
â—Ź game = {integer}9
â—Ź result=string
69
Summary
â—Ź We discussed a sample function-oriented
software design methodology:
– Structured Analysis/Structured
Design(SA/SD)
– Incorporates features from some important
design methodologies.
â—Ź SA/SD consists of two parts:
– Structured analysis
– Structured design.
70
Summary
â—Ź The goal of structured analysis:
– functional decomposition of the system.
â—Ź Results of structured analysis:
– represented using Data Flow Diagrams
(DFDs).
â—Ź We examined why any hierarchical model
is easy to understand.
– Number 7 is called the magic number.
71
Summary
â—Ź During structured design,
– The DFD representation is
transformed to a structure chart
representation.
â—Ź DFDs are very popular:
– Because it is a very simple
technique.
72
Summary
â—Ź A DFD model:
– Difficult to implement using a
programming language:
– Structure chart representation can be
easily implemented using a programming
language.
73
Summary
â—Ź We discussed structured
analysis of two small
examples:
– RMS calculating software
– Tic-tac-toe computer game
software
74
Summary
â—Ź Several CASE tools are available:
– Support structured analysis and
design.
– Maintain the data dictionary,
– Check whether DFDs are balanced
or not.

More Related Content

PDF
APznzaZSEwUJhKEim-rOA-Svk6nc1xZygCeBBAW4QZluPqM0dLSELK_S9YNDE8po44L2LgB6Is5VJ...
PPT
Chapter 3- Software Project Management(Reduced).ppt
PPT
2. Life Cycle Models for Software Engineeting
PPT
6.SE_Requirements Modeling.ppt
PDF
Requirements Analysis and Specification.pdf
PDF
Ch. 3.pdf
PPTX
Software Eng S3 ( Software Design ).pptx
PPTX
SMD.pptx
APznzaZSEwUJhKEim-rOA-Svk6nc1xZygCeBBAW4QZluPqM0dLSELK_S9YNDE8po44L2LgB6Is5VJ...
Chapter 3- Software Project Management(Reduced).ppt
2. Life Cycle Models for Software Engineeting
6.SE_Requirements Modeling.ppt
Requirements Analysis and Specification.pdf
Ch. 3.pdf
Software Eng S3 ( Software Design ).pptx
SMD.pptx

Similar to Function-Oriented(Lec5) Pantnagar college.pdf (20)

PPT
Software Design (Lectu. re 4).ppt
PDF
SWE-401 - 6. Software Analysis and Design Tools
PPT
Data Flow Diagram - Design and Analysses
PPT
SAD 2nd PPT
PDF
Desining---systems@@@@@@@@@@@@@@.ppt.pdf
PPTX
BM322_05.pptxBusiness Management Integral University
PPTX
Chapter 1- IT.pptx
PPT
Design Concepts & Principles
PPT
5 software design
PPTX
Introduction to databae eChapter 1-.pptx
PPT
assignment character education assignment
PPTX
Structure system analysis and design method -SSADM
PPT
Sys_Lec 599999999999999999999999999999.ppt
PPT
Chapter 3 requirements
PPT
Chapter12.ppt
PPT
Object-Oriented Design CS177 Python Programming
PPT
Chapter12 python object oriented concepts.ppt
PPT
SE-software design.ppt
PPT
software design cet ererg rgg rggerv rgeg
PPTX
System Analysis and Design Lecture notes
Software Design (Lectu. re 4).ppt
SWE-401 - 6. Software Analysis and Design Tools
Data Flow Diagram - Design and Analysses
SAD 2nd PPT
Desining---systems@@@@@@@@@@@@@@.ppt.pdf
BM322_05.pptxBusiness Management Integral University
Chapter 1- IT.pptx
Design Concepts & Principles
5 software design
Introduction to databae eChapter 1-.pptx
assignment character education assignment
Structure system analysis and design method -SSADM
Sys_Lec 599999999999999999999999999999.ppt
Chapter 3 requirements
Chapter12.ppt
Object-Oriented Design CS177 Python Programming
Chapter12 python object oriented concepts.ppt
SE-software design.ppt
software design cet ererg rgg rggerv rgeg
System Analysis and Design Lecture notes
Ad

Recently uploaded (20)

PDF
August -2025_Top10 Read_Articles_ijait.pdf
 
PDF
Computer organization and architecuture Digital Notes....pdf
PDF
Unit1 - AIML Chapter 1 concept and ethics
PDF
distributed database system" (DDBS) is often used to refer to both the distri...
PPTX
"Array and Linked List in Data Structures with Types, Operations, Implementat...
PDF
Unit I -OPERATING SYSTEMS_SRM_KATTANKULATHUR.pptx.pdf
PDF
Exploratory_Data_Analysis_Fundamentals.pdf
PPTX
ai_satellite_crop_management_20250815030350.pptx
PPTX
Management Information system : MIS-e-Business Systems.pptx
PPTX
Feature types and data preprocessing steps
PDF
Computer System Architecture 3rd Edition-M Morris Mano.pdf
PDF
Prof. Dr. KAYIHURA A. SILAS MUNYANEZA, PhD..pdf
PDF
Introduction to Power System StabilityPS
PPTX
Module 8- Technological and Communication Skills.pptx
PPTX
CyberSecurity Mobile and Wireless Devices
PDF
20250617 - IR - Global Guide for HR - 51 pages.pdf
PPTX
A Brief Introduction to IoT- Smart Objects: The "Things" in IoT
PDF
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
PPTX
AUTOMOTIVE ENGINE MANAGEMENT (MECHATRONICS).pptx
PPTX
CN_Unite_1 AI&DS ENGGERING SPPU PUNE UNIVERSITY
August -2025_Top10 Read_Articles_ijait.pdf
 
Computer organization and architecuture Digital Notes....pdf
Unit1 - AIML Chapter 1 concept and ethics
distributed database system" (DDBS) is often used to refer to both the distri...
"Array and Linked List in Data Structures with Types, Operations, Implementat...
Unit I -OPERATING SYSTEMS_SRM_KATTANKULATHUR.pptx.pdf
Exploratory_Data_Analysis_Fundamentals.pdf
ai_satellite_crop_management_20250815030350.pptx
Management Information system : MIS-e-Business Systems.pptx
Feature types and data preprocessing steps
Computer System Architecture 3rd Edition-M Morris Mano.pdf
Prof. Dr. KAYIHURA A. SILAS MUNYANEZA, PhD..pdf
Introduction to Power System StabilityPS
Module 8- Technological and Communication Skills.pptx
CyberSecurity Mobile and Wireless Devices
20250617 - IR - Global Guide for HR - 51 pages.pdf
A Brief Introduction to IoT- Smart Objects: The "Things" in IoT
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
AUTOMOTIVE ENGINE MANAGEMENT (MECHATRONICS).pptx
CN_Unite_1 AI&DS ENGGERING SPPU PUNE UNIVERSITY
Ad

Function-Oriented(Lec5) Pantnagar college.pdf

  • 1. 1 Function-Oriented Software Design (lecture 5) Prof. R. Mall Dept. of CSE, IIT, Kharagpur
  • 2. 2 Introduction â—Ź Function-oriented design techniques are very popular: – Currently in use in many software development organizations. â—Ź Function-oriented design techniques: – Start with the functional requirements specified in the SRS document.
  • 3. 3 Introduction â—Ź During the design process: –High-level functions are successively decomposed: â—Ź Into more detailed functions. –Finally the detailed functions are mapped to a module structure.
  • 4. 4 Introduction â—Ź Successive decomposition of high-level functions: – Into more detailed functions. – Technically known as top- down decomposition.
  • 5. 5 Introduction â—Ź SA/SD methodology: – has essential features of several important function-oriented design methodologies: â—Ź If you need to use any specific design methodology later on, â—Ź You can do so easily with small additional effort.
  • 6. 6 SA/SD (Structured Analysis/Structured Design) â—Ź SA/SD technique draws heavily from the following methodologies: – Constantine and Yourdon's methodology – Hatley and Pirbhai's methodology – Gane and Sarson's methodology – DeMarco and Yourdon's methodology â—Ź SA/SD technique can be used to perform – high-level design.
  • 7. 7 Overview of SA/SD Methodology â—Ź SA/SD methodology consists of two distinct activities: – Structured Analysis (SA) – Structured Design (SD) â—Ź During structured analysis: – functional decomposition takes place. â—Ź During structured design: – module structure is formalized.
  • 8. 8 Functional Decomposition â—Ź Each function is analyzed: – Hierarchically decomposed into more detailed functions. – Simultaneous decomposition of high-level data â—Ź Into more detailed data.
  • 9. 9 Structured Analysis â—Ź Transforms a textual problem description into a graphic model. – Done using data flow diagrams (DFDs). – DFDs graphically represent the results of structured analysis.
  • 10. 10 Structured Design â—Ź All the functions represented in the DFD: – Mapped to a module structure. â—Ź The module structure: – Also called as the software architecture:
  • 11. 11 Detailed Design â—Ź Software architecture: – Refined through detailed design. – Detailed design can be directly implemented: â—Ź Using a conventional programming language.
  • 12. 12 Structured Analysis vs. Structured Design â—Ź Purpose of structured analysis: – Capture the detailed structure of the system as the user views it. â—Ź Purpose of structured design: – Arrive at a form that is suitable for implementation in some programming language.
  • 13. 13 Structured Analysis vs. Structured Design â—Ź The results of structured analysis can be easily understood even by ordinary customers: – Does not require computer knowledge. – Directly represents customer’s perception of the problem. – Uses customer’s terminology for naming different functions and data. â—Ź The results of structured analysis can be reviewed by customers: – To check whether it captures all their requirements.
  • 14. 14 Structured Analysis â—Ź Based on principles of: – Top-down decomposition approach. – Divide and conquer principle: â—Ź Each function is considered individually (i.e. isolated from other functions). â—Ź Decompose functions totally disregarding what happens in other functions. – Graphical representation of results using â—Ź Data flow diagrams (or bubble charts).
  • 15. 15 Data Flow Diagrams â—Ź DFD is an elegant modelling technique: – Useful not only to represent the results of structured analysis. – Applicable to other areas also: â—Ź e.g. for showing the flow of documents or items in an organization, â—Ź DFD technique is very popular: – It is powerful and yet simple to understand and use.
  • 16. 16 Data Flow Diagram â—Ź DFD is a hierarchical graphical model: – Shows the different functions (or processes) of the system and – Data interchange among the processes.
  • 17. 17 DFD Concepts â—Ź It is useful to consider each function as a processing station: – Each function consumes some input data. – Produces some output data.
  • 18. 18 Data Flow Model of a Car Assembly Unit Fit Engine Paint and Test Fit Wheels Fit Doors Chassis Store Door Store Wheel Store Engine Store Car Partly Assembled Car Assembled Car Chassis with Engine
  • 19. 19 Data Flow Diagrams (DFDs) â—Ź A DFD model: – Uses limited types of symbols. – Simple set of rules – Easy to understand: â—Ź It is a hierarchical model.
  • 20. 20 Hierarchical Model â—Ź Human mind can easily understand any hierarchical model: – In a hierarchical model: â—Ź We start with a very simple and abstract model of a system, â—Ź Details are slowly introduced through the hierarchies.
  • 22. 22 Data Flow Diagrams (DFDs) â—Ź Primitive Symbols Used for Constructing DFDs:
  • 23. 23 External Entity Symbol â—Ź Represented by a rectangle â—Ź External entities are real physical entities: – input data to the system or – consume data produced by the system. – Sometimes external entities are called terminator, source, or sink. Librarian
  • 24. 24 Function Symbol â—Ź A function such as “search-book” is represented using a circle: – This symbol is called a process or bubble or transform. – Bubbles are annotated with corresponding function names. – Functions represent some activity: â—Ź Function names should be verbs. search- book
  • 25. 25 Data Flow Symbol â—Ź A directed arc or line. – Represents data flow in the direction of the arrow. – Data flow symbols are annotated with names of data they carry. book-name
  • 26. 26 Data Store Symbol â—Ź Represents a logical file: – A logical file can be: â—Ź a data structure â—Ź a physical file on disk. – Each data store is connected to a process: â—Ź By means of a data flow symbol. book-details
  • 27. 27 Data Store Symbol â—Ź Direction of data flow arrow: – Shows whether data is being read from or written into it. â—Ź An arrow into or out of a data store: – Implicitly represents the entire data of the data store – Arrows connecting to a data store need not be annotated with any data name. find-book Books
  • 28. 28 Output Symbol â—Ź Output produced by the system
  • 29. 29 Synchronous Operation â—Ź If two bubbles are directly connected by a data flow arrow: – They are synchronous Data- items Read- numbers 0.1 Validate- numbers 0.2 Valid number number
  • 30. 30 Asynchronous Operation â—Ź If two bubbles are connected via a data store: – They are not synchronous. Data- items Read- numbers 0.1 Validate- numbers 0.2 Valid number numbers
  • 31. 31 Yourdon's vs. Gane Sarson Notations â—Ź The notations that we would be following are closer to the Yourdon's notations â—Ź You may sometimes find notations in books that are slightly different – For example, the data store may look like a box with one end closed
  • 32. 32 How is Structured Analysis Performed? â—Ź Initially represent the software at the most abstract level: – Called the context diagram. – The entire system is represented as a single bubble, – This bubble is labelled according to the main function of the system.
  • 34. 34 Context Diagram â—Ź A context diagram shows: – Data input to the system, – Output data generated by the system, – External entities.
  • 35. 35 Context Diagram â—Ź Context diagram captures: – Various entities external to the system and interacting with it. – Data flow occurring between the system and the external entities. â—Ź The context diagram is also called as the level 0 DFD.
  • 36. 36 Context Diagram â—Ź Establishes the context of the system, i.e. – Represents: â—Ź Data sources â—Ź Data sinks.
  • 37. 37 Level 1 DFD â—Ź Examine the SRS document: – Represent each high-level function as a bubble. – Represent data input to every high- level function. – Represent data output from every high-level function.
  • 38. 38 Higher Level DFDs â—Ź Each high-level function is separately decomposed into subfunctions: – Identify the subfunctions of the function – Identify the data input to each subfunction – Identify the data output from each subfunction â—Ź These are represented as DFDs.
  • 39. 39 Decomposition â—Ź Decomposition of a bubble: – Also called factoring or exploding. â—Ź Each bubble is decomposed to – Between 3 to 7 bubbles.
  • 40. 40 Decomposition â—Ź Too few bubbles make decomposition superfluous: – If a bubble is decomposed to just one or two bubbles: â—Ź Then this decomposition is redundant.
  • 41. 41 Decomposition â—Ź Too many bubbles: – More than 7 bubbles at any level of a DFD. – Make the DFD model hard to understand.
  • 42. 42 Decompose How Long? â—Ź Decomposition of a bubble should be carried on until: – A level at which the function of the bubble can be described using a simple algorithm.
  • 43. 43 Example 1: RMS Calculating Software â—Ź Consider a software called RMS calculating software: – Reads three integers in the range of - 1000 and +1000 – Finds out the root mean square (rms) of the three input numbers – Displays the result.
  • 44. 44 Example 1: RMS Calculating Software â—Ź The context diagram is simple to develop: – The system accepts 3 integers from the user – Returns the result to him.
  • 45. 45 Example 1: RMS Calculating Software Compute- RMS 0 User Data- items result Context Diagram
  • 46. 46 Example 1: RMS Calculating Software â—Ź From a cursory analysis of the problem description: – We can see that the system needs to perform several things.
  • 47. 47 Example 1: RMS Calculating Software â—Ź Accept input numbers from the user: – Validate the numbers, – Calculate the root mean square of the input numbers – Display the result.
  • 48. 48 Example 1: RMS Calculating Software Data- items result Read- numbers 0.1 Validate- numbers 0.2 Compute- rms 0.3 Display 0.4 RMS numbers Valid - numbers error
  • 49. 49 Example 1: RMS Calculating Software Calculate- squared- sum 0.3.1 Calculate- mean 0.3.2 Calculate- root 0.3.3 Valid - numbers Squared- sum RMS Mean- square
  • 51. 51 Example: RMS Calculating Software â—Ź Decomposition is never carried on up to basic instruction level: – A bubble is not decomposed any further: â—Ź If it can be represented by a simple set of instructions.
  • 52. 52 Data Dictionary â—Ź A DFD is always accompanied by a data dictionary. â—Ź A data dictionary lists all data items appearing in a DFD: – Definition of all composite data items in terms of their component data items. – All data names along with the purpose of the data items. â—Ź For example, a data dictionary entry may be: – grossPay = regularPay+overtimePay
  • 53. 53 Importance of Data Dictionary â—Ź Provides all engineers in a project with standard terminology for all data: – A consistent vocabulary for data is very important – Different engineers tend to use different terms to refer to the same data, â—Ź Causes unnecessary confusion.
  • 54. 54 Importance of Data Dictionary â—Ź Data dictionary provides the definition of different data: – In terms of their component elements. â—Ź For large systems, – The data dictionary grows rapidly in size and complexity. – Typical projects can have thousands of data dictionary entries. – It is extremely difficult to maintain such a dictionary manually.
  • 55. 55 Data Dictionary â—Ź CASE (Computer Aided Software Engineering) tools come handy: – CASE tools capture the data items appearing in a DFD automatically to generate the data dictionary.
  • 56. 56 Data Dictionary â—Ź CASE tools support queries: – About definition and usage of data items. â—Ź For example, queries may be made to find: – Which data item affects which processes, – A process affects which data items, – The definition and usage of specific data items, etc. â—Ź Query handling is facilitated: – If data dictionary is stored in a relational database management system (RDBMS).
  • 57. 57 Data Definition â—Ź Composite data are defined in terms of primitive data items using following operators: â—Ź +: denotes composition of data items, e.g – a+b represents data a and b. â—Ź [,,,]: represents selection, – i.e. any one of the data items listed inside the square bracket can occur. – For example, [a,b] represents either a occurs or b occurs.
  • 58. 58 Data Definition â—Ź ( ): contents inside the bracket represent optional data – which may or may not appear. – a+(b) represents either a or a+b occurs. â—Ź {}: represents iterative data definition, – e.g. {name}5 represents five name data.
  • 59. 59 Data Definition â—Ź {name}* represents – zero or more instances of name data. â—Ź = represents equivalence, – e.g. a=b+c means that a represents b and c. â—Ź * *: Anything appearing within * * is considered as comment.
  • 60. 60 Data Dictionary for RMS Software â—Ź numbers=valid-numbers=a+b+c â—Ź a:integer * input number * â—Ź b:integer * input number * â—Ź c:integer * input number * â—Ź asq:integer â—Ź bsq:integer â—Ź csq:integer â—Ź squared-sum: integer â—Ź Result=[RMS,error] â—Ź RMS: integer * root mean square value* â—Ź error:string * error message*
  • 61. 61 Balancing a DFD â—Ź Data flowing into or out of a bubble: – Must match the data flows at the next level of DFD. â—Ź In the level 1 of the DFD, – Data item c flows into the bubble P3 and the data item d and e flow out. â—Ź In the next level, bubble P3 is decomposed. – The decomposition is balanced as data item c flows into the level 2 diagram and d and e flow out.
  • 63. 63 Numbering of Bubbles â—Ź Number the bubbles in a DFD: – Numbers help in uniquely identifying any bubble from its bubble number. â—Ź The bubble at context level: – Assigned number 0. â—Ź Bubbles at level 1: – Numbered 0.1, 0.2, 0.3, etc â—Ź When a bubble numbered x is decomposed, – Its children bubble are numbered x.1, x.2, x.3, etc.
  • 64. 64 Example 2: Tic-Tac-Toe Computer Game â—Ź A human player and the computer make alternate moves on a 3 X 3 square. â—Ź A move consists of marking a previously unmarked square. â—Ź The user inputs a number between 1 and 9 to mark a square â—Ź Whoever is first to place three consecutive marks along a straight line (i.e., along a row, column, or diagonal) on the square wins.
  • 65. 65 Example: Tic-Tac-Toe Computer Game â—Ź As soon as either of the human player or the computer wins, – A message announcing the winner should be displayed. â—Ź If neither player manages to get three consecutive marks along a straight line, – And all the squares on the board are filled up, – Then the game is drawn. â—Ź The computer always tries to win a game.
  • 66. 66 Context Diagram for Example Human Player Tic-tac- toe software 0 display move
  • 68. 68 Data Dictionary â—Ź Display=game + result â—Ź move = integer â—Ź board = {integer}9 â—Ź game = {integer}9 â—Ź result=string
  • 69. 69 Summary â—Ź We discussed a sample function-oriented software design methodology: – Structured Analysis/Structured Design(SA/SD) – Incorporates features from some important design methodologies. â—Ź SA/SD consists of two parts: – Structured analysis – Structured design.
  • 70. 70 Summary â—Ź The goal of structured analysis: – functional decomposition of the system. â—Ź Results of structured analysis: – represented using Data Flow Diagrams (DFDs). â—Ź We examined why any hierarchical model is easy to understand. – Number 7 is called the magic number.
  • 71. 71 Summary â—Ź During structured design, – The DFD representation is transformed to a structure chart representation. â—Ź DFDs are very popular: – Because it is a very simple technique.
  • 72. 72 Summary â—Ź A DFD model: – Difficult to implement using a programming language: – Structure chart representation can be easily implemented using a programming language.
  • 73. 73 Summary â—Ź We discussed structured analysis of two small examples: – RMS calculating software – Tic-tac-toe computer game software
  • 74. 74 Summary â—Ź Several CASE tools are available: – Support structured analysis and design. – Maintain the data dictionary, – Check whether DFDs are balanced or not.