1 / 28 Specification Miaoqing Huang University of Arkansas Spring 2010
2 / 28 Outline 1 2
3 / 28 Outline 1 2
How to verify a specification? Specification itself has to be correct Verification methods Observe dynamic behavior of specified system (simulation, prototyping, testing specs) Analyze properties of the specified system Analogy with traditional engineering Physical model of a bridge A model designed using software Mathematical model of a bridge 4 / 28
Barricade at Washington DC 5 / 28
Barricade at Washington DC Simulation 6 / 28
7 / 28 Outline 1 2
Data Flow Diagrams A semi-formal operational specification System viewed as collection of data manipulated by functions Data can be persistent They are stored in data repositories Data can flow They are represented by data flows DFDs have a graphical notation One of the most popular method to describe system, design, algorithm, etc. 8 / 28
Graphical notation bubbles represent functions arcs represent data flows open boxes represent persistent store closed boxes represent I/O interaction 9 / 28
A Simple Example specifies the evaluation of (a + b) (a d + c) 10 / 28
11 / 28 Construction Method (Top-down approach) - Step 1 Start from the context diagram Input 1 Input 2 Input n information...... system Output 1 Output 2 Output m
Construction Method (Top-down approach) - Step 2 Proceed by refinements until you reach elementary functions Preserve balancing I A O 12 / 28
Construction Method (Top-down approach) - Step 2 Proceed by refinements until you reach elementary functions Preserve balancing I A O I A1 H K A3 A2 J M A4 N P A5 Q R A6 S A7 O 13 / 28
Construction Method (Top-down approach) - Step 2 Proceed by refinements until you reach elementary functions Preserve balancing I A O I A1 H K A3 A2 J M A4 N P A5 Q R A6 S A7 O K B1 K2 B2 M Ag T K1 B3 K3 K4 B4 N 14 / 28
A Library Example Shelves Author request by the user Title and author of requested book; name of the user List of Authors Get a book reception List of titles Title title; user name Title List of books borrowed List of topics Topic Search by topics Topic List of titles referring to the topic Display of the list of titles Topic request by the user 15 / 28
A Library Example Shelves Author request by the user Title and author of requested book; name of the user List of Authors Get a Get a book book reception List of titles Title title; user name Title List of books borrowed List of topics Topic Search by topics Topic List of titles referring to the topic Display of the list of titles Topic request by the user 16 / 28
A Library Example Refinement of Get a book Shelves Author Get the book List of Authors Title List of titles Find book position <shelf#, book #> List of books borrowed reception request by the user Title and author of requested book; name of the user title; user name 17 / 28
Patient Monitoring System Nurse Patient Report Request Clinical Data Patient Monitoring Report Alarm Nurse Recent data Data for report Persistent data Description The purpose is to monitor the patients vital factors blood, pressure, temperature,... reading them at specified frequencies from analog devices and storing readings in a database. If readings fall outside the range specified for patient or device fails an alarm must be sent to a nurse. The system also provides reports. 18 / 28
19 / 28 Patient Monitoring System Nurse Patient Report Request Clinical Data Patient Monitoring Report Alarm Nurse Recent data Data for report Persistent data Description The purpose is to monitor the patients vital factors blood, pressure, temperature,... reading them at specified frequencies from analog devices and storing readings in a database. If readings fall outside the range specified for patient or device fails an alarm must be sent to a nurse. The system also provides reports.
Patient Monitoring System A Refinement Recent Data Update archive Patient archive Formatted data Data for Report Central Monitoring Generate Report Alarm Report Request Report Nurse Nurse Limits Patient data Limits for patient Local Monitoring Clinical Data Patient 20 / 28
Patient Monitoring System A Refinement Recent Data Update archive Patient archive Formatted data Data for Report Central Monitoring Generate Report Alarm Report Request Report Nurse Nurse Limits Patient data Limits for patient Local Monitoring Clinical Data Patient 21 / 28
22 / 28 Patient Monitoring System More Refinement Limits Pressure, pulse Format data Formatted data Date Time Check limit violations clock Pressure Temperature decode Result Pulse produce message Patient alarm data
23 / 28 Evaluation of DFDs Informal semantics How to define leaf functions? Inherent ambiguities Shelves List of Authors List of titles Title Author Find Find book position Title and author of requested book; name of the user request by the user Get the book <shelf#, book #> List of books borrowed title; user name reception
24 / 28 Evaluation of DFDs Informal semantics How to define leaf functions? Inherent ambiguities Shelves List of Authors List of titles Title Author Find Find book position Title and author of requested book; name of the user request by the user Get the book <shelf#, book #> List of books borrowed title; user name reception if the user supplies both author name(s) and book title then if the book exists then determine book position; else give an appropriate message; else if only the author is given then supply 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...;
Evaluation of DFDs Control information is absent Outputs from A, B, C are all needed? Outputs for E and F are produced at the same time? 25 / 28
Evaluation of DFDs Control information is absent Outputs from A, B, C are all needed? Outputs for E and F are produced at the same time? Possible interpretations: A produces datum, waits until B consumes it B can read the datum many times without consuming it a pipe is inserted between A and B 26 / 28
Formalization/extensions There have been attempts to formalize DFDs Use complementary notations Augment DFD model There have been attempts to extend DFDs (e.g., for real-time systems) 27 / 28
28 / 28 Verification of specifications Data flow diagrams (DFDs) Symbols Construction method Pros, cons, and extensions Homework: FSE 5.4, 5.5, 5.7 Due Feb 1 st (Monday) before the class