Comparing State Machines
Udo Kelter, Maik Schmidt Software Engineering Group University of Siegen, Germany
{kelter, mschmidt}@informatik.uni-siegen.de
17.05.2008
Comparing State Machines Udo Kelter , Maik Schmidt Software - - PowerPoint PPT Presentation
Comparing State Machines Udo Kelter , Maik Schmidt Software Engineering Group University of Siegen, Germany { kelter, mschmidt } @informatik.uni-siegen.de 17.05.2008 Introduction / Difference / Merge Tools for Models 2 1 Introduction 1.1
Udo Kelter, Maik Schmidt Software Engineering Group University of Siegen, Germany
{kelter, mschmidt}@informatik.uni-siegen.de
17.05.2008
Introduction / Difference / Merge Tools for Models 2
Main tasks and related issues:
→ should consider document-type-specific semantics → ideally: consider user-defined preferences
→ chose external representation of a difference
→ detect conflicts
Introduction / State Models 3
significant overlap with UML activity diagrams Reference in this talk: UML2 State Machines
Introduction / Intricacies With Differencing State Models 4
→ sub-optimal design of the standard meta-models → Part 3 of this talk
→ finding a good (an “optimal”) difference between two state models is a more significant problem → Part 4 of this talk
Background / Displaying Differences 5
Basic approaches of how to display a difference between two graph-structured diagrams:
Background / Informal Definitions of a Difference 6
how two documents differ i.e. why and how they are not identical
(such as UNIX diff), considered on a conceptual level
Formal Definitions of a Difference / Set-oriented Approach 7
2.3.1 Set-oriented Approach
identifiable model elements.
A symmetric difference consists of
(for the common parts)
(for the specific parts)
Formal Definitions of a Difference / Set-oriented Approach 8
correspondence: a pair of model elements, one from each mo- del, which are considered as corresponding (“the same”) “common parts” of the diagrams: model elements involved in a correspondence “specific parts”: the remaining model elements inserting transformation: sequence of edit steps which crea- te the specific parts of a diagram on the basis of the common parts edit data type: an abstract data type (or interface) which defines the operations used in inserting transformations
Formal Definitions of a Difference / Transformational Approach 9
2.3.2 Transformational Approach An asymmetric difference is a transformation from D1 to D2, in which abritrary edit operations are admitted. can make use of complex edit operations, notably moving of (groups of) diagram elements; pros and cons:
symmetric difference
(1 editing step = 1 local difference)
Background / Edit Operations and the Representations of Models 10
Assumption: models / diagrams considered as a typed abstract syntax graph, based on a metamodel (defined by the UML, ...., MDD frame- works, ..), which consists of:
and edges of the ASG
Background / Edit Operations and the Representations of Models 11
typical approach: the edit data type = elementary graph ope- rations in the abstract syntax graph works fine in 95% of the cases, however ...
rect states
Metamodel-Related Issues / Pseudo States 12
UML pseudo state types: initial, deep / shallow history, join, fork, junction, choice, entry point, exit point, terminate, and final are modelled as:
enumeration attribute kind specifies actual kind of the pseudo state type
Metamodel-Related Issues / Pseudo States 13
Metamodel-Related Issues / Pseudo States 14
a difference computation can find
Problems:
any model would break some of the constraints, either before
→ edit data type must assume a very reduced level of cor- rectness of the models
Metamodel-Related Issues / Pseudo States 15
Metamodel-Related Issues / Pseudo States 16
Transitions are modeled by one object type (Transition) with enumeration attribute kind (external, internal, local) how to “interpret” modifications of these attributes? (= con- versions of transitions)
with complex triggers (same state → other state, or vice versa)
→ complex edit operations (1 user command) = several elemen- tary changes
Optimization of Differences / Non-Uniqeness of Differences 17
Problems:
Conclusions:
transitions
two transitions with different values in the attribute kind
Optimization of Differences / Non-Uniqeness of Differences 18
at the risk of boring you to death: (similarity-based) differences between models / diagrams are not unique easiest example: duplicated model elements → alternatives for forming correspondences further alternatives for forming inserting transformations choose the best difference → optimization problem
Optimization of Differences / Block Moves Between Regions 19
Optimization of Differences / Block Moves Between Regions 20
similar cases in all diagram types with nested block structures block moves are a much better understandable than deletions and insertions, however:
→ asymmetric difference → restricted choice of display formats (local differences)
should be considered as explicitly deleted / inserted
Optimization of Differences / Modifications Of The Flow Structure 21
Alternative differences:
create t3;
from choice state to s1; delete t1, and choice state;
from choice state to s2; delete t2, and choice state;
Optimization of Differences / Modifications Of The Flow Structure 22
... more complex examples with transition paths Which difference is the best one? depends on:
more relevant for a node) Anyway: users should have the choice, tool should offer alter- natives
Optimization of Differences / Assessing and Optimizing Differences 23
A more theoretical approach:
dences are better ...)
tes”), compute the quality of each, choose the best one Deficiencies:
ferences
Optimization of Differences / Assessing and Optimizing Differences 24
A pragmatic approach:
use “biased similarity specifications” to improve quality
specify presettings: – negative: wrong correspondences – positive: desired correspondences this feature is a must for merge tools!
Summary and Conclusion 25
Subject of this paper: difference and merge tools for state ma- chines etc.; computation and display of differences The messages:
support of user preferences are a problem
Summary and Conclusion 26