Super State Analysis for UML State Diagrams

Click here to load reader

download Super State Analysis for UML State Diagrams

of 21

Transcript of Super State Analysis for UML State Diagrams

Super State Analysis for UML State DiagramsVaibhav Survase M.E. Computer Science ACPCE

Introduction Error detection and correction in the design

phase can reduce total costs and time to market The UML specification does not enforce many

consistency requirements between the information contained in the sequence and state diagrams. The problem of relating state-based diagrams

with scenario-based diagrams has recently focused much interest among the software engineering community.

Introduction Also, current UML CASE-tools provide poor

support for maintaining consistency between UML diagrams. There are several different approaches that have

been proposed to perform consistency checking between UML diagrams.:Some approaches use transformations to convert one diagram to another. 2. Others detect the inconsistencies by comparing one diagram to another using consistency rules.1.

Introduction Almost all approaches focus on all or some of six

types of UML diagrams:1. 2. 3. 4. 5. 6.

Use case diagram Class diagram Object diagram Sequence diagram Collaboration diagram Statechart diagrams.

Introduction The researchers enforce consistency between

only two diagrams (e.g. single sequence diagram vs. single statechart diagram).

Our approach is unique in that we are proposing

a technique to check the consistency between multiple state diagrams and one or more sequence diagrams.

The Super State The super state has the form [s1, s2, , sn]

where si is the state of object i and n is the total number of objects. The SS provides the complete collaborative view

of a set of objects in the model. i.e. 1. This super state details all of the possible composite states the objects can be in. 2. The transition pairs which lead from one composite state to another.

The Super State The SS is changed after each message call : For every call we have where

SSpre is the super state before call and SSpost is the super state after the message call has been called. In SSpost, only the state of one object may change. We calculate the super state of multiple state

diagrams after each valid transition and that is used to evaluate each sequence diagram. A valid sequence diagram should be a subsequence of the set of sequences that are possible in a super state. Invalid and impossible sequences can be identified.

Super State Analysis (SSA)

Super State Analysis (SSA) The five comparisons detect inconsistency in

states, singles step transitions, and sequences. C1 and C2 detect the valid and invalid super states while C3 and C4 identify the illegal and missing transitions. C5 detects the invalid sequences. This comparison is fully automated since both T3 and S are generated automatically.

The Transition SetFigure 2. State Diagram for Customer

The Transition SetState Diagram for Account

The Transition Set Our proposed transition set technique links the

transitions of multiple state diagrams together to capture the relationship information of the paired transitions. An entry in the transition set has the form

[PreState, (transitions), PostState] Where PreState is the super state before transitions and PostState is the super state after the transitions taken. The transitions has the form (t1, t2, , tn) where

tx are the paired transitions. i.e. must happen together.

The Transition Set In the transition set of the ATM example, we have

the following entries: [GP, (x1, y1), GP],[GP, (x3, y1), GP],[GP, (x2,

y2),NV],[NV, (x5, y4), NV],[NV, (x4, y3), GP]. If we dont consider the transition set, the system

can make some illegal transitions. For example, [GP, x2, NP] or [NV, y3, NP]. Having the correct transition set provided for to the system will prevent such inconsistencies.

The Transition Matrix The transition matrix details the possible global states

of the system based on a vector of states of individual instances of classes and the possible transitions between the states in the super state (SS). The state diagrams depict how instances of X and Y

can transition between those states. Let class Y makes the transition between state D and state E whenever class X makes the transition from state A to state B. Table 1 shows possible transitions in the super state

that is the cross-product of all states with one instance of X and one instance of Y.

The Transition Matrix

Scalability The total number of super states involved in Super

State Analysis is calculated using the following equation:

Total number of states = S1^C1 * S2^C2**Sn^Cn

Where: I. Ci is the number of instances of class i that involved in SSA II. Si is the number of states in class Ci III. n is the number of classes. There are several techniques that could be applied to

Super State Analysis to reduce the state explosion.

Object Reduction Technique This technique can be applied to Super State

Analysis to reduce the number of objects. If there are some objects acting independently, they can be eliminated from the analysis. The independent objects can be identified from

the transition set. If the state of an object has always X in pre state and post state, this object is independent from other objects and it can be eliminated from the analysis to reduce the state explosion.

State Reduction Technique The number of states in each state diagram

involved in Super State Analysis could be decreased by merging some states together.

Reduction will require the developer to analyze

the transition set and decide which group of states can be merged together.

Limit the number of steps Technique

Another applicable way to reduce the state

explosion is to limit the number of steps in each sequence. We may limit the sequence computation to a smaller number to reduce the state explosion.

References :

[1] OMG Unified Modeling Language Specification,UML 2.0, Object Management Group, 2006. [2] O. Pilskalns, A. Andrews, S. Ghosh, and R. France, Rigorous Testing by Merging Structural andBehavioral UML Representations, Proc. 6th Int. Conf. on UML, San Francisco, CA, 2003, 234-248. [3] B. Litvak, S. Tyszberowics, and A.Yehudai,Behavioral Consistency Validation of UMLDiagrams, Proc. 1st Int. Conf. on SoftwareEngineering and Formal Methods, 2003, 118-125. [4] A. Egyed, Scalable Consistency Checking between Diagrams-The ViewIntegra Approach, Proc. 16thAnnual Int. Conf. on Automated Software Engineering, 2001, 387-390. [5] Y. Bontemps, P. Heymans, and P. Schobbens, From Live Sequence Charts to State Machines and Back: A Guided Tour, IEEE Trans. on Soft. Eng., 31(12),2005, 999-1014. [6] Y. Dumond, D. Girardet, and F. Oquendo, Arelationship between sequence and statechart diagram, A Workshop, Proc. Dynamic Behaviour in UML Models: Semantic Questions, York, UK, 2000. [7] W. Shen and W. Low, Consistency Checking Between Two Different Views Of a SoftwareSystem, Proc. 10th IASTED Int. Conf. on Soft. Eng.and Applications, Dallas, TX, 2006.