Presentation is loading. Please wait.

Presentation is loading. Please wait.

Ch5: Software Specification. 1 Finite State Machines (FSMs)  Consist of:  Use of FSMs:

Similar presentations


Presentation on theme: "Ch5: Software Specification. 1 Finite State Machines (FSMs)  Consist of:  Use of FSMs:"— Presentation transcript:

1 Ch5: Software Specification

2 1 Finite State Machines (FSMs)  Consist of:  Use of FSMs:

3 2 FSMs (contd..) aa b bc q q q q 1 2 0 3 Graphically, -

4 3 FSM example: A lamp On Off Push switch

5 4 FSM example: A plant control system OnOff High-pressure alarm High-temperature alarm Restart

6 5 FSM example: A refinement of plant control system Pressure signal Temperature signal Successful recovery Unsuccessful recovery OffNormal Pressure action OffNormal Pressure action Temperature signal Temperature action Successful recovery Unsuccessful recovery Pressure signal

7 6 Classes of FSMs  Deterministic/non deterministic:  FSMs as recognizers:  FSMs as transducers:

8 7 FSMs as recognizers q qqqq qq q b egi n e n d 0 12 3 4 56 f

9 8 FSMs as recognizers (contd..) q1q2q3q4q5q6q7q8qfq0 b r r e a d h w r i o t e What are the strings accepted by this FSM?

10 9 Limitations of FSMs  Finite memory  State explosion

11 10 Limitations of FSMs (contd..)

12 11 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 12 Limitations of FSM (contd..) The resulting FSM

14 13 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

15 14 UML diagrams  Use case diagrams  Sequence diagrams  Collaboration diagrams

16 15 Use case diagrams  Show all the possible functionality  Do not describe any details  Used during requirements analysis

17 16 Components of use case diagrams Actors

18 17 Components of use case diagrams (contd..) Use Cases

19 18 Components of use case diagrams (contd..) Association

20 19 Uses of use case diagrams  Determining features (requirements):  Communicating with clients:  Generating test cases:

21 20 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 21 Use case diagrams – Example #1 Consider an airline reservation system. A customer can use this system to 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.

23 22 Use case diagrams – Example #1 Compile List Make Reservation Cancel Reservation External Flight Database Customer Use case Actor Communication Reservation System CreditCard System Security Personnel


Download ppt "Ch5: Software Specification. 1 Finite State Machines (FSMs)  Consist of:  Use of FSMs:"

Similar presentations


Ads by Google