Professional Documents
Culture Documents
Yuanfang Cai
CS751 Jan 29, 2003
Overview
Definition
5.1 The Uses of Specification
5.2 Specification Qualities
5.3 Classification of Specification Styles
5.4 Verification of Specification
5.5 Operational Specifications
5.6 Descriptive Specifications
5.7 Building and Using Specifications in Practice
Overview
Definition
5.1 The Uses of Specification
5.2 Specification Qualities
5.3 Classification of Specification Styles
5.4 Verification of Specification
5.5 Operational Specifications
5.6 Descriptive Specifications
5.7 Building and Using Specifications in Practice
Overview
Definition
5.1 The Uses of Specification
5.2 Specification Qualities
5.3 Classification of Specification Styles
5.4 Verification of Specification
5.5 Operational Specifications
5.5.1 Data Flow Diagram (DFD): Function
5.5.2 Unified Modeling Language (UML): Behavior
5.5.3 Finite State Machine (FSM): Control Flow
5.5.4 Petri Nets: Asynchronous Systems
Overview
Definition
5.1 The Uses of Specification
5.2 Specification Qualities
5.3 Classification of Specification Styles
5.4 Verification of Specification
5.5 Operational Specifications
5.6 Descriptive Specifications
5.6.1 Entity Relationship Diagrams
5.6.2 Logic Specification
5.6.3 Algebraic Specifications
5.7 Building and Using Specifications in Practice
Definition
The statement of an agreement between a producer of a
service and the consumer of the service or between an
implementer and a user
Requirement specification
Design specification
Module specification
Definition
The statement of an agreement between a producer of a
service and the consumer of the service or between an
implementer and a user
Requirement specification
Design specification
Module specification
Definition
The statement of an agreement between a producer of a
service and the consumer of the service or between an
implementer and a user
Requirement specification
Design specification
Module specification
Definition
The statement of an agreement between a producer of a
service and the consumer of the service or between an
implementer and a user
Requirement specification
Design specification
Module specification
Internally complete
Externally complete
Simulation
Prototype
Functional
Consistency
completeness
Features
Example
limitations
Function symbol
Data flow
Data store symbol
(a + b) * ( c + a * d)
E
D
F
E
D
F
E
D
F
Features
Example
Limitations
Definiation
Features
Example
Limitations
Formal notation
Suitable for describing systems that can be in a
finite set of states and that can go from one
state into another as a consequence of some
event, modeled by an input symbol.
Widely used: specification of control systems,
compilation, pattern matching, etc.
Example
Push switch
Off
On
Push switch
High-temperature alarm
Off
On
Restart
Normal
Temperature signal
Temperature signal
Pressure
Recovery
Successful
Unsuccessful
recovery
recovery
Successful
Unsuccessful
recovery
recovery
Temperature
Recovery
Off
Pressure signal
Limitations
write
P2
P1
C2
C1
read
produce
write
write
empty
0
read
2
read
full
write
<0,p1,c1>
<2,p1,c1>
<1,p1,c1>
consume
consume
consume
Produce
Produce
Produce
<0,p2,c1>
<0,p1,c2>
<2,p1,c2>
<1,p1,c2>
read
read
Produce
<0,p2,c1>
<1,p2,c1>
read
Produce
Produce
read
write
consume
consume
consume
<0,p2,c2>
<1,p2,c2>
<2,p2,c2>
Limitations:
Definition
Example
Features
Limitations
Definition
A Petri Net is a quadruple (P, T, F, W), where
1.
P is the finite set of places;
2.
T is a finite set of transitions;
3.
P T ;
4.
F { P T} { T P} is the flow relation; and
5.
W: F N {0} is the weight function, which associates
a nonzero natural value to each element of F. If no
weight value is explicitly associated with a flow
element, the default value 1 is assumed for the function
write
Place
p2
p1
Token
produce
write
Place
p2
p1
Token
2
produce
write
Place
p2
p1
2
produce
Token
consume
p2
p1
c2
c1
produce
read
read
read
write
write
consume
c2
c1
read
read
write
p1
write
p2
produce
consume
c2
c1
read
read
write
p1
write
p2
produce
consume
c2
c1
read
read
write
p1
write
p2
produce
Limitations
Entities:
a collection of items that
share common properties
AGE
STUDENT
SEX
Relations:
A set of pairs <a, b>, where
a is an element of
STUDENT and b is an
element of CLASS
Attribute:
ENROLLED_IN
SUBJECT
CLASS
COURSE_ID
MAX_ENROLLMENT
A R B is one to one
A R B is one to many
A R B is many to one
A R B is many to
many
Interaction view
Sequence diagram
Collaboration diagram
Interaction view
Sequence diagram
Collaboration diagram
Class
Customer
Name: String
Phone: String
Add(name,phone)
Class Diagram:
attributes
class-scope operation
1
association
*
Reservation
Date: Date
Show
generalization
Name: String
Subscription Series
Individual
Reservation
Series: integer
multiplicities
0..1
0..1
3..6
Ticket
1..*
Performance
Available: Boolean
Sell (c. Customer)
Exchange()
Seat: Sting
qualifier
Date: Date
Time: TimeOfDay
system
actor
buy
tickets
<<include>>
relationship
Clerk
buy
subscription
<<include>>
Kiosk
make
charges
survey
sales
Supervisor
Interaction view
Sequence diagram
Collaboration diagram
Sequence Diagram
Active object
credit card service
box office
Kiosk
lifeline (active)
Select(seats)
Demand payment(cost)
Insert card(card number)
message
charge(card number,cost))
authorized
Collaboration
Diagram:
active object
Kiosk
link
4: offer(seat-list)
5:buy(seats)
8:confirm (seats, cost)
ticketseller
3: seat-list := lock(count)
6: claim (seats)
7: unlock(seat-list)
<<local>>db
transient link
message
2: db := findDB(performance)
performanceGuide
passive object
Db: performanceDB
multi object
Db: performanceDB
Initial state
Time out
Available
lock
state
Locked
buy
Sold
unlock
transition
exchange
Trigger event
Activity Diagram
Pick show
activity
schedule show
fork
publicize show
Hire
artists
Buy scripts
and music
Sell tickets
Build
sets
Design
lighting
Completion
transition
rehearse
Dress rehearsal
join
perform
Make
costumes
Questions?