1 14/08/00 Arcot Sowmya
Software EngineeringSoftware Engineering
COMP3111/COMP9008COMP3111/COMP9008
Data Flow DiagramsData Flow Diagrams
2 14/08/00 Arcot Sowmya
Tools of Structured Tools of Structured AnalysisAnalysis Much of SA consists of system modelingMuch of SA consists of system modeling modeling allows us to modeling allows us to
– focus on important featuresfocus on important features– change/correct user’s requirements at low change/correct user’s requirements at low
cost and riskcost and risk– verify that analyst’s understanding is correctverify that analyst’s understanding is correct
include: data flow diagrams, entity-include: data flow diagrams, entity-relationship diagram and state-transition relationship diagram and state-transition diagram.diagram.
3 14/08/00 Arcot Sowmya
Data Flow DiagramData Flow Diagram
What system functions, their What system functions, their interactions?interactions?
What transformations, what inputs What transformations, what inputs and outputs?and outputs?
What work, what information, what What work, what information, what results?results?
Data flow diagram models Data flow diagram models transformation of inputs to outputs.transformation of inputs to outputs.
4 14/08/00 Arcot Sowmya
A Data Flow DiagramA Data Flow Diagram
TapeTransaction
1
CustomerTransaction
Membernumber
Rentalcost
Prices
Library
CustomerGenerate
Report
3Reports
UpdatePricing
2
NewPrices
5 14/08/00 Arcot Sowmya
Components of DFD: Components of DFD: ProcessProcess Also called bubble, function, Also called bubble, function,
transformationtransformation shows part of system that shows part of system that
transforms inputs to outputstransforms inputs to outputs represented graphically as a circlerepresented graphically as a circle named with a single word, phrase named with a single word, phrase
or sentenceor sentence
6 14/08/00 Arcot Sowmya
Components of DFD: The Components of DFD: The FlowFlow Represented graphically by an Represented graphically by an
arrow into/out of aprocessarrow into/out of aprocess describes movement of describes movement of
information in the systeminformation in the system ““data in motion”data in motion” in non-computerized systems, in non-computerized systems,
could describe flow of materialscould describe flow of materials
7 14/08/00 Arcot Sowmya
The Flow- cntdThe Flow- cntd
must be named (with one must be named (with one exception)exception)
flow shows directionflow shows direction double-headed arrow stands for double-headed arrow stands for
dialogue- convenient packaging of dialogue- convenient packaging of two data packetstwo data packets
dalatflows can diverge or converge dalatflows can diverge or converge in a DFDin a DFD
8 14/08/00 Arcot Sowmya
Components of DFD: The Components of DFD: The StoreStore Used to model a collection of data Used to model a collection of data
packets at rest- store is passivepackets at rest- store is passive named, notation is two parallel linesnamed, notation is two parallel lines stored connected by flows to processesstored connected by flows to processes flow from a store is a read- store is not flow from a store is a read- store is not
changedchanged flow to a store is a write/update/delete- flow to a store is a write/update/delete-
store is changedstore is changed
9 14/08/00 Arcot Sowmya
Components of DFD: The Components of DFD: The TerminatorTerminator Represented graphically as a rectangleRepresented graphically as a rectangle represents external entities which represents external entities which
system communicates withsystem communicates with outside control of system being modeledoutside control of system being modeled flows between terminators and processes flows between terminators and processes
or stores is the system interfaceor stores is the system interface relationships between terminators will relationships between terminators will
not be modelednot be modeled
10 14/08/00 Arcot Sowmya
Guidelines for constructing Guidelines for constructing DFDDFD Choose meaningful namesChoose meaningful names
– try to identify functions of processestry to identify functions of processes– avoid vague names (`Do STUFF’)avoid vague names (`Do STUFF’)– Use words meaningful to userUse words meaningful to user
number the processesnumber the processes– be consistentbe consistent– easier to refer to aprocess by number!easier to refer to aprocess by number!– Useful in hierarchy of processesUseful in hierarchy of processes
11 14/08/00 Arcot Sowmya
Guidelines- cntdGuidelines- cntd
redraw for aestheticsredraw for aesthetics– size/shape of bubblessize/shape of bubbles– curved versus straight dataflowscurved versus straight dataflows– hand-drawn versus machine-generated hand-drawn versus machine-generated
diagramsdiagrams avoid overly complex DFDsavoid overly complex DFDs
– must be comprehensiblemust be comprehensible– not too many processes, flows, stores, not too many processes, flows, stores,
terminatorsterminators
12 14/08/00 Arcot Sowmya
Guidelines- cntdGuidelines- cntd
make sure the DFD is logically make sure the DFD is logically consistentconsistent– avoid infinite sinksavoid infinite sinks– avoid spontaneous generation bubblesavoid spontaneous generation bubbles– beware of unlabeled flows and beware of unlabeled flows and
processesprocesses– beware of read-only or write-only beware of read-only or write-only
storesstores
13 14/08/00 Arcot Sowmya
Hierarchical DFDsHierarchical DFDs
To handle large, complex systems To handle large, complex systems (DFDs),(DFDs),
organise them in a series of levelsorganise them in a series of levels each level provides more detail each level provides more detail
about a portion of the level above about a portion of the level above itit
14 14/08/00 Arcot Sowmya
DFD: A Hierarchical DFD: A Hierarchical SystemSystem
ContextDiagram
Level 0
Level 1
Level 2
15 14/08/00 Arcot Sowmya
Context Diagram- Level 0Context Diagram- Level 0
Single bubble represents whole systemSingle bubble represents whole system show show
– all people, organisations, systems with all people, organisations, systems with which our system communicates- as which our system communicates- as terminatorsterminators
– system inputs and outputssystem inputs and outputs– data storesdata stores– boundary between our system and boundary between our system and
outside world.outside world.
16 14/08/00 Arcot Sowmya
DFD: Context Level DFD: Context Level DiagramDiagram
VideoShop
System
Member Manager
New Memberdetails
Rentaldetails
Rentalcost
Membernumber
NewPrices
Reports
17 14/08/00 Arcot Sowmya
DFD: Level 0 DiagramDFD: Level 0 Diagram
TapeTransaction
1
CustomerTransaction
Membernumber
Rentalcost
Prices
Library
CustomerGenerate
Report
3Reports
UpdatePricing
2
NewPrices
18 14/08/00 Arcot Sowmya
DFD: Numbering DFD: Numbering ProcessesProcesses
ContextDiagram
Level 0
Level 1
Level 2
19 14/08/00 Arcot Sowmya
Numbering ProcessesNumbering Processes
Number all processes as 1, 2, 3, .. in Number all processes as 1, 2, 3, .. in Level 0Level 0
If parent process at Level 0 was If parent process at Level 0 was numbered 1, then its child processes at numbered 1, then its child processes at Level 1 will be 1.1, 1,2,….Level 1 will be 1.1, 1,2,….
Processes in context diagram are not Processes in context diagram are not numberednumbered
not all processes are decomposed to not all processes are decomposed to the same depththe same depth
20 14/08/00 Arcot Sowmya
Points to PonderPoints to Ponder
How many levels in a DFD?How many levels in a DFD? decompose to same level of detail?decompose to same level of detail? How to present to user?How to present to user? How to ensure consistency in levels?How to ensure consistency in levels? How to show stores at different levels?How to show stores at different levels? How to DO the levelling?How to DO the levelling?
21 14/08/00 Arcot Sowmya
DFDs: Common MistakesDFDs: Common Mistakes
Customer VSS
Name
Address
Phone
Order
Invoice
Should be rationalisedinto a single data flow: “Customer Detail”
22 14/08/00 Arcot Sowmya
DFDs: Common MistakesDFDs: Common Mistakes
CustomerDetails
Name
Address
ValidateCustomer
1.1 1.2
InvoiceGenerateInvoice
This is okay becauseit is still the same data flow
23 14/08/00 Arcot Sowmya
DFDs: Common MistakesDFDs: Common Mistakes
CustomerDetails
Name
Address
ValidateCustomer
1.1 1.2
InvoiceGenerateInvoice
This is NOT okay becausewe have split the data flowinto 2 new flows. Only processesare allowed to split data flows.
24 14/08/00 Arcot Sowmya
DFDs: Common MistakesDFDs: Common Mistakes
Items
Costs
You cannot mergedata flows. Only processesare allowed to merge dataflows.
25 14/08/00 Arcot Sowmya
DFDs: Common MistakesDFDs: Common Mistakes
PersonalInfo
Transactioninterface
Return-Key
PersonalDetails
Control Signalsshould be avoidedin logical DFDanalysis.
26 14/08/00 Arcot Sowmya
DFDs: Common MistakesDFDs: Common Mistakes
GetNextByte
CompilePacket
Ask for more
Byte
Packet
Avoid control loopsin logical DFDanalysis.
27 14/08/00 Arcot Sowmya
DFD: ExampleDFD: Example
A simple Video Shop System.A simple Video Shop System. General Requirements:General Requirements:
– Facility to add new members and Facility to add new members and issue member numbers.issue member numbers.
– Borrow and return tapes.Borrow and return tapes.– Change rental prices.Change rental prices.– Generate usage reports.Generate usage reports.
28 14/08/00 Arcot Sowmya
DFD: ExampleDFD: Example
AnalysisAnalysis– From the requirements, you should have From the requirements, you should have
identified the external entities to be the identified the external entities to be the ManagerManager and the and the Customer.Customer.
– Further analysis might suggest what data Further analysis might suggest what data is fed into and produced by the system.is fed into and produced by the system.
The following DFD is an interpretation The following DFD is an interpretation of the given requirements.of the given requirements.
29 14/08/00 Arcot Sowmya
DFD: ExampleDFD: Example
VideoShop
System
Customer Manager
CustomerTransaction
Rentalcost
Membernumber
NewPrices
Reports
Context Diagram
30 14/08/00 Arcot Sowmya
DFD: ExampleDFD: Example
TapeTransaction
1
CustomerTransaction
Membernumber
Rentalcost
Prices
Library
CustomerGenerate
Report
3Reports
UpdatePricing
2
NewPrices
Level 0 Diagram
31 14/08/00 Arcot Sowmya
DFD: ExampleDFD: Example
DetermineMembership
1.1
Customer
CuntomerTransaction
New Member
TapeTransaction
RentalCost
Membernumber
AddNew
Member
ProcessBorrow/Return
1.2
1.3 Customer
Level 1 DiagramProcess 1
32 14/08/00 Arcot Sowmya
DFD: ExampleDFD: Example
Prices Customer
Library
TapeTransaction
TapeReturn
TapeBorrow
RentalCosts
FilterTransaction
Return
Borrow
1.3.1
1.3.2
1.3.3
Level 2 DiagramProcess 1.3