18
Beyond Scenarios: Generating State Models from Beyond Scenarios: Generating State Models from Use Cases Use Cases An approach for the synthesis of State An approach for the synthesis of State transition graphs from Use Cases transition graphs from Use Cases Supporting Use Cases Based Requirements Supporting Use Cases Based Requirements Simulation Simulation Presented by Chin-Yi Tsai Presented by Chin-Yi Tsai UCEd

Beyond Scenarios: Generating State Models from Use Cases An approach for the synthesis of State transition…

Embed Size (px)

DESCRIPTION

3 Introduction Use Cases describe possible interactions involving a system and its environment. Use Cases describe possible interactions involving a system and its environment. Represent user’s requirement Represent user’s requirement State models generation from Use Cases. State models generation from Use Cases. A formalization of use cases A formalization of use cases A natural language based syntax for use cases description (condition) A natural language based syntax for use cases description (condition) An algorithm that incrementally compose a set of use cases as finite state transition machine An algorithm that incrementally compose a set of use cases as finite state transition machine Simulation/Validation Restricted form

Citation preview

Page 1: Beyond Scenarios: Generating State Models from Use Cases An approach for the synthesis of State transition…

Beyond Scenarios: Generating State Models from Use Beyond Scenarios: Generating State Models from Use CasesCases

An approach for the synthesis of State transition graphs An approach for the synthesis of State transition graphs from Use Casesfrom Use Cases

Supporting Use Cases Based Requirements SimulationSupporting Use Cases Based Requirements Simulation

Presented by Chin-Yi TsaiPresented by Chin-Yi Tsai

UCEd

Page 2: Beyond Scenarios: Generating State Models from Use Cases An approach for the synthesis of State transition…

2

OutlineOutline IntroductionIntroduction

Use CasesUse Cases

Requirements Engineering ProcessesRequirements Engineering Processes

From Use Cases to State ModelsFrom Use Cases to State Models

Use Cases SimulationUse Cases Simulation

ConclusionConclusion

Page 3: Beyond Scenarios: Generating State Models from Use Cases An approach for the synthesis of State transition…

3

IntroductionIntroduction Use Cases describe possible interactions involving Use Cases describe possible interactions involving

a system and its environment.a system and its environment. Represent user’s requirementRepresent user’s requirement

State models generation from Use Cases.State models generation from Use Cases.

A formalization of use casesA formalization of use cases A natural language based syntax for use cases A natural language based syntax for use cases

description (description (conditioncondition)) An algorithm that incrementally compose a set of use An algorithm that incrementally compose a set of use

cases as cases as finite state transition machinefinite state transition machine

Simulation/Validation

Restricted form

Page 4: Beyond Scenarios: Generating State Models from Use Cases An approach for the synthesis of State transition…

4

Use CasesUse Cases A use case consists of intertwined A use case consists of intertwined

scenarios, each scenario being a scenarios, each scenario being a possible sequence of interactions.possible sequence of interactions. Primary scenario (Primary scenario (normalnormal)) Secondary scenario (Secondary scenario (alternative, erroralternative, error))

A use case can be seen as a tupleA use case can be seen as a tuple [Title, Precondition, Steps, Postcondition][Title, Precondition, Steps, Postcondition]

Each step in Steps is a tupleEach step in Steps is a tuple [SCond, Oper, Ext][SCond, Oper, Ext]

Page 5: Beyond Scenarios: Generating State Models from Use Cases An approach for the synthesis of State transition…

5

Domain ModelDomain Model A domain model is an integral part of requirements A domain model is an integral part of requirements

in approaches such as the in approaches such as the Unified Software Unified Software Development Process.Development Process.

Use a domain model as a complementary part of Use a domain model as a complementary part of use case descriptionuse case description

A domain model is a A domain model is a high level class modelhigh level class model that that captures the most important types of object in the captures the most important types of object in the context of system.context of system. relationshiprelationship

Use case diagram Domain/conceptual model Sequence diagram

Page 6: Beyond Scenarios: Generating State Models from Use Cases An approach for the synthesis of State transition…

6

OperationOperation Added-conditionsAdded-conditions Withdrawn-conditionsWithdrawn-conditions

Domain model

Page 7: Beyond Scenarios: Generating State Models from Use Cases An approach for the synthesis of State transition…

7

Natural Language Representation of Use CasesNatural Language Representation of Use Cases

Use a form of natural language for conditions and Use a form of natural language for conditions and operationsoperations

Conditions describe Conditions describe situationssituations prevailing within a prevailing within a system and environment.system and environment. A condition is written as predicative phrase, seeking a A condition is written as predicative phrase, seeking a

certain quality on an entity of the domain modelcertain quality on an entity of the domain model

Operations are Operations are active sentencesactive sentences in which a in which a component perform an action given as verb.component perform an action given as verb.

state

Page 8: Beyond Scenarios: Generating State Models from Use Cases An approach for the synthesis of State transition…

8

DCG (Definite Clause Grammar)DCG (Definite Clause Grammar) DCGs are contextural DCGs are contextural

grammars used for natural grammars used for natural language description.language description.

The DOG references the The DOG references the domain modeldomain model through the through the predicates concept, predicates concept, concept_attribute, discrete, concept_attribute, discrete, and pobbile_value.and pobbile_value. Concept(“User”)Concept(“User”)

Condition description

Page 9: Beyond Scenarios: Generating State Models from Use Cases An approach for the synthesis of State transition…

9

concept(“User”)concept(“User”)

concept(“PM System”)concept(“PM System”)

concept_attribure(“User”, concept_attribure(“User”, “number of attempts”)“number of attempts”)

concept_attribute(“User”, concept_attribute(“User”, Card”)Card”)

discrete(“Card”)discrete(“Card”)

possible_value([“User”, possible_value([“User”, “Card”], “inserted”)“Card”], “inserted”)

possible_value([“User”, possible_value([“User”, “Card”], “regular”)“Card”], “regular”)

Page 10: Beyond Scenarios: Generating State Models from Use Cases An approach for the synthesis of State transition…

10

Requirements Engineering ProcessesRequirements Engineering Processes Use cases based requirement engineering processUse cases based requirement engineering process

Page 11: Beyond Scenarios: Generating State Models from Use Cases An approach for the synthesis of State transition…

11

Page 12: Beyond Scenarios: Generating State Models from Use Cases An approach for the synthesis of State transition…

12

From Use Cases to State ModelsFrom Use Cases to State Models Generate a hierarchical type of finite state transition Generate a hierarchical type of finite state transition

machines form use cases.machines form use cases.

Operation can have Operation can have withdrawn-conditionswithdrawn-conditions and and added-added-conditionsconditions. (expressed as predicates on the domain . (expressed as predicates on the domain entities)entities)

Each Each statestate is defined by characteristic is defined by characteristic predicatespredicates which which hold in it.hold in it.

Two state are identical if they have the same characteristics Two state are identical if they have the same characteristics predicates.predicates.

A state A state ssbb is a sub-state of a state is a sub-state of a state ssaa, if its characteristics , if its characteristics predicates include those of predicates include those of ssaa in the logical sense. in the logical sense.

Page 13: Beyond Scenarios: Generating State Models from Use Cases An approach for the synthesis of State transition…

13

From Use Cases to State ModelsFrom Use Cases to State Models Use the Use the operationsoperations withdrawn and added condition withdrawn and added condition

to determine states.to determine states.

operation

Withdrawn condition

Addedcondition

state1

state2

Page 14: Beyond Scenarios: Generating State Models from Use Cases An approach for the synthesis of State transition…

14

From Use Cases to State ModelsFrom Use Cases to State Models A finite state transition machine is a tupleA finite state transition machine is a tuple

is a finite alphabetis a finite alphabet is a finite set of statesis a finite set of states is a transition functionis a transition function is a set of initial stateis a set of initial state

Given a use case [Given a use case [Title, Pre, Steps, PostTitle, Pre, Steps, Post], the ], the algorithm enriches a algorithm enriches a state transition machinestate transition machine MM..

M is initially such that

Page 15: Beyond Scenarios: Generating State Models from Use Cases An approach for the synthesis of State transition…

15

Page 16: Beyond Scenarios: Generating State Models from Use Cases An approach for the synthesis of State transition…

16

S0: {“System is ON”, “No user is logged in”, “No card is inserted”}S1: {“System is ON”, “No user is logged in”, “Card is inserted”}S2: {“System id ON”, “No user logged in”, “Card is inserted”, “Card is not regular”}S3: {“System is ON”, “No user logged in”, “Card is inserted”, “Display is pin enter prompt”}

Page 17: Beyond Scenarios: Generating State Models from Use Cases An approach for the synthesis of State transition…

17

Use Cases SimulationUse Cases Simulation The simulator includes an “actor events panel” and The simulator includes an “actor events panel” and

a “simulation results panel”.a “simulation results panel”. UCEd generates a button corresponding to each UCEd generates a button corresponding to each

actor operation in the “actor events panel”.actor operation in the “actor events panel”. The operations are obtained from the domain The operations are obtained from the domain

model.model.

State machine

Page 18: Beyond Scenarios: Generating State Models from Use Cases An approach for the synthesis of State transition…

18

ConclusionConclusion

Use cases

Domain model

State model

simulator