View
218
Download
0
Tags:
Embed Size (px)
Citation preview
6
FSM example: A refinement of plant control system
Pressure signal Temperature signal
Successful recovery
Unsuccessful recovery
OffNormal
Pressure action
OffNormal
Pressure action
Temperature signalTemperature action
Successful recovery
Unsuccessful recovery
Pressure signal
9
FSMs as recognizers (contd..)
q1 q2 q3 q4
q5 q6 q7 q8
qfq0
brr e a
d
h
wr
i
o
te
What are the strings accepted by this FSM?
11
Limitations of FSMs (contd..)
Producer
p1
c2
Storage
1
produce
deposit
get
consume
deposit
get get
deposit
p2
Consumer
c1
20
12
Limitations of FSMs (contd..)
In the composite FSM, a state is given by a 3-tuple:
State of the storage:State of the producer:State of the consumer:
Initial state:Total number of states in the composite FSM:
13
Limitations of FSM (contd..)
The resulting FSM
<0, p ,c >
<0, p ,c >
consume
produce
consume
produce
consume
produce
consume
produce
produce produce
consume consume
write
read
write
read
read
write read
write
1
1 2
<0, p , c >
1
2 2
<1, p ,c >
<0, p ,c >
1 1
<1, p ,c>
<1, p ,c >
<1, p ,c >
2 1
1 2
1
2
2 2 <2, p ,c > 2 2
<2, p ,c > 1 2
<2, p ,c > 2 1
<2, p ,c > 1 1
14
FSMs summary
Simple and widely used:
Most software can be modeled using FSMs FSMs may become complex:
FSMs can be composed to create new FSMs
16
Use case diagrams
Show all the possible functionality
Do not describe any details Used during requirements analysis
20
Uses of use case diagrams
Determining features (requirements):
Communicating with clients:
Generating test cases:
21
Suggestions for designing good use cases
Choose a good name:
Show a complete and completable behavior:
Show inverse use cases if applicable:
Limit a use case to one behavior/function:
Write the use cases from the actor’s point of view:
22
Use case diagrams – Example #1
Consider an airline reservation system. A customer can use this systemto either make or cancel a reservation. The system obtains flight information such as the availability of the flights from an external flight database system. During the process of making a reservation, the system may be required to obtain credit card authorization from the credit card system. Every day, the system compiles a list of passengers with reservations on each flight is forwarded to the security personnel.