Specification - University of Arkansasmqhuang/courses/3513/s2010/lectures/SE_Lecture_5.pdf · Data...
Transcript of Specification - University of Arkansasmqhuang/courses/3513/s2010/lectures/SE_Lecture_5.pdf · Data...
Verification of SpecificationsData Flow Diagrams (DFD)
Summary
Specification
Miaoqing HuangUniversity of Arkansas
Spring 2010
1 / 28
Verification of SpecificationsData Flow Diagrams (DFD)
Summary
Outline
1 Verification of Specifications
2 Data Flow Diagrams (DFD)
2 / 28
Verification of SpecificationsData Flow Diagrams (DFD)
Summary
Outline
1 Verification of Specifications
2 Data Flow Diagrams (DFD)
3 / 28
Verification of SpecificationsData Flow Diagrams (DFD)
Summary
How to verify a specification?
Specification itself has to be correctVerification methods
“Observe” dynamic behavior of specified system (simulation,prototyping, “testing” specs)Analyze properties of the specified system
Analogy with traditional engineeringPhysical model of a bridge
A model designed using software
Mathematical model of a bridge
4 / 28
Verification of SpecificationsData Flow Diagrams (DFD)
Summary
Barricade at Washington DC
5 / 28
Verification of SpecificationsData Flow Diagrams (DFD)
Summary
Barricade at Washington DC – Simulation
6 / 28
Verification of SpecificationsData Flow Diagrams (DFD)
Summary
Outline
1 Verification of Specifications
2 Data Flow Diagrams (DFD)
7 / 28
Verification of SpecificationsData Flow Diagrams (DFD)
Summary
Data Flow Diagrams
A semi-formal operational specificationSystem viewed as collection of data manipulated by “functions”Data can be persistent
They are stored in data repositoriesData can flow
They are represented by data flows
DFDs have a graphical notationOne of the most popular method to describe system, design,algorithm, etc.
8 / 28
Verification of SpecificationsData Flow Diagrams (DFD)
Summary
Graphical notation
bubbles represent functionsarcs represent data flowsopen boxes represent persistent storeclosed boxes represent I/O interaction
9 / 28
Verification of SpecificationsData Flow Diagrams (DFD)
Summary
A Simple Example
specifies the evaluation of
(a + b)× (a× d + c)
10 / 28
Verification of SpecificationsData Flow Diagrams (DFD)
Summary
Construction Method (Top-down approach) - Step 1
Start from the “context” diagram
... ...
Input 1
Input 2
Input n
Output 1
Output 2
Output m
information
system
11 / 28
Verification of SpecificationsData Flow Diagrams (DFD)
Summary
Construction Method (Top-down approach) - Step 2
Proceed by refinements until you reach “elementary” functionsPreserve balancing
AI O
12 / 28
Verification of SpecificationsData Flow Diagrams (DFD)
Summary
Construction Method (Top-down approach) - Step 2
Proceed by refinements until you reach “elementary” functionsPreserve balancing
A
A1
A3
A2
A4
A5
A6
A7
I O
I
O
H
K
J
M
N
P Q
R
S
13 / 28
Verification of SpecificationsData Flow Diagrams (DFD)
Summary
Construction Method (Top-down approach) - Step 2
Proceed by refinements until you reach “elementary” functionsPreserve balancing
A
A1
A3
A2
A4
A5
A6
A7
B1
B2
B3B4
Ag
I O
I
O
H
K
J
M
N
P Q
R
S
K
T
K1
K2
K3
K4
M
N
14 / 28
Verification of SpecificationsData Flow Diagrams (DFD)
Summary
A Library Example
Shelves
List of Authors
List of titles
List of topics
Title and author of requested book; name of the user
Get a book
Book
List of books borrowed
Book title; user name
Topic request by the user
Search by topics
Book request by the user
Book reception
TopicList of titles referring to the topic
Book
Author
Title
Display of the list of titles
Topic
Title
15 / 28
Verification of SpecificationsData Flow Diagrams (DFD)
Summary
A Library Example
Shelves
List of Authors
List of titles
List of topics
Title and author of requested book; name of the user
Get a book
Book
List of books borrowed
Book title; user name
Topic request by the user
Search by topics
Book request by the user
Book reception
TopicList of titles referring to the topic
Book
Author
Title
Display of the list of titles
Topic
Title
Get a book
16 / 28
Verification of SpecificationsData Flow Diagrams (DFD)
Summary
A Library ExampleRefinement of “Get a book”
Shelves
List of Authors
List of titles
Title and author of requested book; name of the user
Book
List of books borrowed
Book title; user name
Book request by the user
Book reception
Book
Author
TitleFind book position
<shelf#, book#>
Get the book
17 / 28
Verification of SpecificationsData Flow Diagrams (DFD)
Summary
Patient Monitoring System
Patient
Nurse
Patient Monitoring
Nurse
Persistent data
Report
AlarmData Clinical
Report Request
Recent data
Data for report
DescriptionThe purpose is to monitor the patients’ vital factors–blood, pressure,temperature,...–reading them at specified frequencies from analogdevices and storing readings in a database. If readings fall outsidethe range specified for patient or device fails an alarm must be sent toa nurse. The system also provides reports.
18 / 28
Verification of SpecificationsData Flow Diagrams (DFD)
Summary
Patient Monitoring System
Patient
Nurse
Patient Monitoring
Nurse
Persistent data
Report
AlarmData Clinical
Report Request
Recent data
Data for report
PatientMonitoring
DescriptionThe purpose is to monitor the patients’ vital factors–blood, pressure,temperature,...–reading them at specified frequencies from analogdevices and storing readings in a database. If readings fall outsidethe range specified for patient or device fails an alarm must be sent toa nurse. The system also provides reports.
19 / 28
Verification of SpecificationsData Flow Diagrams (DFD)
Summary
Patient Monitoring SystemA Refinement
Nurse
Nurse
Patient archive
Report Request
Limits for patient
MonitoringCentral
Limits
Update archive
Generate Report
Data for Report
Recent Data
Formatted data
Alarm
Patient Clinical Data Monitoring
Local
Patient data
Report
20 / 28
Verification of SpecificationsData Flow Diagrams (DFD)
Summary
Patient Monitoring SystemA Refinement
Nurse
Nurse
Patient archive
Report Request
Limits for patient
MonitoringCentral
Limits
Update archive
Generate Report
Data for Report
Recent Data
Formatted data
Alarm
Patient Clinical Data Monitoring
Local
Patient data
Report
CentralMonitoring
21 / 28
Verification of SpecificationsData Flow Diagrams (DFD)
Summary
Patient Monitoring SystemMore Refinement
Limits
Formatted data alarm
dataPatient
decode
Check
violations limit
Temperature
Pulse
Pressure
Result
Pressure, pulse…
Format
data clockDate Time
producemessage
22 / 28
Verification of SpecificationsData Flow Diagrams (DFD)
Summary
Evaluation of DFDs
Informal semanticsHow to define leaffunctions?Inherent ambiguities
Shelves
List of Authors
List of titles
Title and author of requested book; name of the user
Book
List of books borrowed
Book title; user name
Book request by the user
Book reception
Book
Author
TitleFind book position
<shelf#, book#>
Get the book
Findbook
position
if the user supplies both author name(s) and book title thenif the book exists then
determine book position;else
give an appropriate message;
else if only the author is given thensupply a list of all existing books by that author and ask the user for a selection;
else if only the title is given then......;
else......;
23 / 28
Verification of SpecificationsData Flow Diagrams (DFD)
Summary
Evaluation of DFDs
Informal semanticsHow to define leaffunctions?Inherent ambiguities
Shelves
List of Authors
List of titles
Title and author of requested book; name of the user
Book
List of books borrowed
Book title; user name
Book request by the user
Book reception
Book
Author
TitleFind book position
<shelf#, book#>
Get the book
Findbook
position
if the user supplies both author name(s) and book title thenif the book exists then
determine book position;else
give an appropriate message;
else if only the author is given thensupply a list of all existing books by that author and ask the user for a selection;
else if only the title is given then......;
else......;
24 / 28
Verification of SpecificationsData Flow Diagrams (DFD)
Summary
Evaluation of DFDsControl information is absent
Outputs from A, B, C are allneeded?Outputs for E and F are producedat the same time?
Possible interpretations:A produces datum, waitsuntil B consumes itB can read the datummany times withoutconsuming ita pipe is inserted betweenA and B
25 / 28
Verification of SpecificationsData Flow Diagrams (DFD)
Summary
Evaluation of DFDsControl information is absent
Outputs from A, B, C are allneeded?Outputs for E and F are producedat the same time?
Possible interpretations:A produces datum, waitsuntil B consumes itB can read the datummany times withoutconsuming ita pipe is inserted betweenA and B
26 / 28
Verification of SpecificationsData Flow Diagrams (DFD)
Summary
Formalization/extensions
There have been attempts to formalize DFDsUse complementary notationsAugment DFD model
There have been attempts to extend DFDs (e.g., for real-timesystems)
27 / 28
Verification of SpecificationsData Flow Diagrams (DFD)
Summary
Summary
Verification of specificationsData flow diagrams (DFDs)
SymbolsConstruction methodPros, cons, and extensions
Homework: FSE 5.4, 5.5, 5.7Due Feb 1st (Monday) before the class
28 / 28