uml’s statechart fsm, efsm in uml concurrent states tool support

42

Upload: fay-grant

Post on 27-Dec-2015

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support
Page 2: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

UML’s StateChart

• FSM, EFSM in UML• Concurrent states• Tool support

Page 3: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

Example• Consider the following requirements describing the life cycle

of a bank account entity. – A bank account is first created by a bank manager. The customer

owning the account has to activate the account within one month. Otherwise, this account will be automatically cancelled. Once activated, the customer can use the account to perform bank transactions. The account becomes blocked for security reasons or if it is dormant for more than six months. In either case, the customer is asked to contact the bank. After being blocked for two weeks, if the customer does not contact the bank, the account will be cancelled. The customer may cancel the account at any time while it is active.

• States: created, active, blocked and cancelled.

Page 4: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support
Page 5: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

Concurrent states in StateCharts

• Concurrent activities when superstate state ‘created’ is reached

Page 6: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

UML’s Activity diagram

• Describe dynamic behavior – sequential and concurrent flows of activities

• May involve activities spanning more than one use case

• Action states, activity states and transitions between them, and swimlanes

• Includes symbols from Petri Nets and Flowcharts

Page 7: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

Example• Given the following English description of the flow of activities within

a company that receives orders through the internet.– “Once the order is received by the Customer Service department,

the customer’s credit is checked. If the customer has a bad credit rating, the order is rejected and closed. Otherwise, an invoice is prepared and sent to the Finance department for follow up, and at the same time the order is sent to the Order Fulfillment department. The Finance department processes the payment once received and informs the Customer Service department. Also, the Order Fulfillment department checks if the ordered items are available. If available, the order is delivered to the customer, otherwise it is back ordered. In either case, the Customer Service department is informed.

Page 8: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support
Page 9: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

Process modeling: Data flow diagram (DFD)

• Process transforming input data and control into output data and control

• Bubble representing a process• Arcs carrying flow of data and control in and

out of a process• Data store as source and sink of data• External entities as source and sink of data

Page 10: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

Data flow diagram (DFD)

Page 11: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

Consistency of process refinement

• Process 2. is refined into 4 subprocesses 2.1 to 2.4

Page 12: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

Example• Consider the following informal requirements.

– ‘An online book ordering system accepts orders from buyers which could be either human users or software agents. A book order is normally made after the buyer browses a books catalog. The system checks the availability of the ordered items in the store inventory and the status of the buyer in the customer file. If all items are available and the customer has a good record, the buyer is asked to provide credit card payment and shipping information. The payment information is then passed to a payment server to verify their validity. If the payment information is valid, an online bill and payment confirmation is sent to the buyer. Otherwise, the buyer is informed of the rejection of the payment information, and consequently the order. In the meantime, the inventory file, the customer information file and the orders file are updated. In addition, customer information including name and shipping address are used to deliver the ordered items to the buyer”.

Page 13: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

Context level diagram

Page 14: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

First refinement

Page 15: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

Refinement of validate order process

Page 16: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

Structured English, Decision Table and Decision Tree

• To describe a process• Typically used for a stateless (no internal

states, no memory of previous inputs) process• Pseudocode, structured english

Page 17: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

Decision table• Rows in the table are of two types: condition rows and action rows. • A column represents a combination of condition outcomes and the

corresponding actions to take. – also referred to as a rule.

• A complete decision table specifies one rule for each combination of the condition outcomes. – For example, if we have three independent binary conditions, the number of

combinations or rules must be 23 = 8. • A decision table contains redundancy, it there exists two columns

that are equivalent. • A decision table is ambiguous or contradictory if for the same

combination of condition outcomes, the specified actions are different.

Page 18: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support
Page 19: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support
Page 20: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support
Page 21: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

Data modeling

• Chen’s entity relationship diagram (ERD)• Entities representing objects to be saved in

permanent stores– Attributes for each entity

• Relationships linking entities (binary, ternary, .. Relationships)

• Cardinality of the relationship: 1 to 1, 1 to many, and many to many

Page 22: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support
Page 23: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support
Page 24: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support
Page 25: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

Data dictionary

• Explaining the data items in a DFD or ERD• For example in level 0 (first refinement) DFD of

Figure 4.21:– reply = Msg1 or Msg2 or Msg3 in the data dictionary. – Msg1 = ‘Unable to accept your order at this moment’– Msg2 = ‘Unavailable items at this moment’ – Msg3 = ‘Thank you for your order – Please proceed

with payment’.

Page 26: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

Formal specification techniques

• Mostly implementation oriented or very abstract and theoretical (not desirable!)

• Desirable properties of specification techniques– General, generic, expressive– Formal with well defined semantics– Readable, modular– Abstract to a certain degree– Traceable, testable– Executable

Page 27: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

Object oriented analysis (OOA)

• Based on the identification of problem-domain objects, their attributes and operations

• Identification of relationships among objects• Object states and transitions among them• Description of the interactions among objects

• Textual analysis of requirements: nouns and verbs

Page 28: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

What can be an problem domain Object?

• Entities that have more than one attribute • Entities that need to be retained in permanent storage for future use • External entities that produce information to be used or consumed

by the system, or that consume information generated or produced by the system

• Events or actions that occur during the system’s operations • Roles played by people interacting with the system • Organizational units and places that are important in the problem

domain such as flight crew team or airport • Logical items such as flight reports and documents • Composite physical items such as an airplane or a personal computer

Page 29: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

Three types of solution domain objects

• Entity objects: to remain in permanent store for future use and reference

• Interface objects: forms, GUI components that are used but are not saved (transient objects)

• Control objects: encoding the business procedure or control flow (one per use case?)

Page 30: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

Example• Let us analyze the following English text providing a partial

description of the requirements for a Proposal Evaluation System (PES).

“PES allows different types of users to perform their functions. The three types of users are Evaluators, Administrators and Proposal Submitters. Users must first logon successfully to the system to be able to work. Submitters will submit their proposals. An Administrator will perform a basic evaluation of the proposal before assigning it to an Evaluator. The basic evaluation checks whether the Submitter has already submitted another pending proposal. If so the submission fails the check. In addition, the Submitter cannot have more than two accepted proposals to pass the basic check. If the proposal does not pass the basic check, the Submitter is informed and the refusal is logged in history.

Page 31: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

Example• An Administrator sends an email to the Evaluator once she/he

is assigned to a proposal. The Evaluator will evaluate the proposal and will send his/her evaluation to the Administrator either by email or by filling a form on the internet. The Administrator will inform the Submitter of the result of the evaluation. At this point the proposal evaluation process is considered done”.

Page 32: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support
Page 33: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

Composition relationship

(includes, made of)

Object relationships:inheritance

(generalization/specialization, is_a)

Page 34: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

Associations and roles

Page 35: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

Dynamic object behavior

• Object interactions – interaction diagrams• Sequence diagram• Communication diagram• 1 to 1 mapping from sequence to

communication diagram

Page 36: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

Sequence diagram

Page 37: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

Communication diagram

Page 38: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

Specification validation• Completeness– Review meetings, walkthroughs, checklists– Check NFRs– All external interfaces are identified

• Correctness– Absence of deadlocks, livelocks, liveloops– Checking needed invariants– Optimal interactions– Check all relationships, cardinalities, associations,…– Execute model or review in meetings

Page 39: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

Section 3 of the SRS

Page 40: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

External interfaces specification

• Input to the system– Using forms, dialogs– Records from saved files (from data model)– Format of inputs from other external systems

• Output from the system– Confirmation, help, error, and warning messages– Music files– Reports to be saved or printed– Format of output to other external systems

Page 41: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

Example• Given the following English specification for a Web-based

order processing system for a computer store. “A new user can connect to the company’s web page and create a new customer profile by providing personal information. This information will be validated and saved in a customer information file at the company’ s server. The user is then provided with a user id and password via an email sent by the system. Using the provided password, the user can then logon to the system and place an order. The user can also delete or update an order within a certain time after placing the order. In all cases, the system will verify the transaction and act accordingly. If the transaction is not allowed (e.g., deleting after the deadline) the user is informed.

Page 42: UML’s StateChart FSM, EFSM in UML Concurrent states Tool support

Example• Before accepting the transaction, the system checks the

customer information file for credit check and the inventory file for availability. If the ordered item is not available, the system will ask the user whether to keep the order in a back order file, otherwise the order is discarded. If the product is available, the inventory and customer information files are updated accordingly. The ordered product is delivered along with a bill, and the accounting file is updated. Once the payment is received, the accounting file and the customer information files are updated accordingly. From time to time, the system administrator send emails to customers informing them about special deals …”.

• Draw Data Flow Diagrams at all levels. Produce an object-oriented analysis model.