Towards SCM in Unified Modelspi.informatik.uni-siegen.de/CVSM2008/slides/koegel.pdf · • Model...

15
Technische Universität München Towards SCM for Unified Models Maximilian Kögel [email protected] Technische Universität München Department for Informatics Chair for Applied Software Engineering

Transcript of Towards SCM in Unified Modelspi.informatik.uni-siegen.de/CVSM2008/slides/koegel.pdf · • Model...

Technische Universität München

Towards SCM for Unified Models

Maximilian Kögel [email protected]

Technische Universität München Department for Informatics

Chair for Applied Software Engineering

Technische Universität München

Motivation

•  Model Driven Development –  Models exist and are maintained over extended periods of time –  Models are designed collaboratively

•  Unified Modeling –  More and more tools and therefore models are integrated –  Tracking evolution of intra-and-inter model links

17.05.2008 ICSE'08, CVSM: Towards SCM for Unified Models - M. Kögel 2

Technische Universität München

17.05.2008 ICSE'08, CVSM: Towards SCM for Unified Models - M. Kögel 3

Unified Models

Technische Universität München

17.05.2008 ICSE'08, CVSM: Towards SCM for Unified Models - M. Kögel 4

Traditional SCM approaches

•  Impedance mismatch –  complex graph of interrelated artifacts

vs. files and lines –  configuration items: files vs. model elements –  change granularity: line vs. model element attributes and graph structure

•  Possible implementations –  Graph is represented in one file:

•  No meaningful change tracking (per element) •  Frequent merges •  Difficult to merge without destroying model integrity

–  One file per model element: •  Loss of semantic relationships of model elements •  Model integrity cannot be preserved by SCM

Technische Universität München

17.05.2008 ICSE'08, CVSM: Towards SCM for Unified Models - M. Kögel 5

Operation-based change tracking

•  State-based deltas –  Deltas calculated from two states –  Expensive to perform for large and complex graphs –  Difficult or impossible to recreate original changes

•  Operation-based deltas –  Deltas based on original sequence of editor operations –  Editor must support capture of operations –  Editor is coupled with SCM

Technische Universität München

17.05.2008 ICSE'08, CVSM: Towards SCM for Unified Models - M. Kögel 6

Three layers of change

Logical Layer set of changes comprising logically coherent task

Meta Model Layer operations as defined by the meta model

clarify use case … …

add actor add step set name … …

create elem add link set field … …

Model Layer operations as defined by the domain models

Technische Universität München

17.05.2008 ICSE'08, CVSM: Towards SCM for Unified Models - M. Kögel 7

Three Layers of change (cont.)

Technische Universität München

17.05.2008 ICSE'08, CVSM: Towards SCM for Unified Models - M. Kögel 8

Version model

•  Versions: v1.1, v1.2, v1.3 … •  Change Packages: c1, c2, c2

v1.2 v1.3 v1.1

v2.1 v2.2

c1

c2

c3

variant of

revision of

Technische Universität München

17.05.2008 ICSE'08, CVSM: Towards SCM for Unified Models - M. Kögel 9

Version model (class diagram)

Technische Universität München

Operation-based Diffing

•  Version Model instances are trees •  Collect ChangePackages on directed path from source to target version •  Optional: Canonize changes (optional)

–  One-pass in reverse order –  Add Elements of Delete and Modify MetaModelOperations to set A –  Remove all Modify MetaModelOperations referring to elements in set A –  Remove empty ModelOperations

17.05.2008 ICSE'08, CVSM: Towards SCM for Unified Models - M. Kögel 10

v1.2 v1.3 v1.1

v2.1 v2.2

c1

c2

c3

Technische Universität München

17.05.2008 ICSE'08, CVSM: Towards SCM for Unified Models - M. Kögel 11

Operation-based Merging

•  Merging is required if conflicts arise on update •  Merging driven by conflict detection strategy:

–  Defines transitive requires relation: A requires B –  Defines conflicts relation: A conflicts B

•  Merging algorithm: –  Two lists of operations: mine, theirs –  User must select operations to accept or reject –  Case Accept Operation o in set mine:

•  Find all required operations for o in mine (transitive closure) => set A •  Find all operations in set theirs conflicting with set A => set B •  Find all operations in theirs that require operations from B (transitive closure) => set C •  Set A must be accepted if o is accepted •  Set C must be rejected if o is accepted •  Merge result (list of operations):

–  Reversed list of all reversed operations in set C –  List of all operations in A –  Operation o

Technische Universität München

17.05.2008 ICSE'08, CVSM: Towards SCM for Unified Models - M. Kögel 12

Example: Operation-based Merging

MyOperation1

MyOperation2

MyOperation3

TheirOperation1

TheirOperation2

TheirOperation3

TheirOperation4

TheirOperation4-1

TheirOperation3-1

TheirOperation1-1

MyOperation1

MyOperation3

My List: Merged List: Their List:

Technische Universität München

Prototype Implementation in Sysiphus (http://sysiphus.org)

•  Use of prototype in project in collaboration with Airport Munich: –  40 Students –  Real client, real problem, real data

•  Change Tracking: –  54.000 changes on logical layer: change packages (and revisions) –  73.000 changes on model layer –  243.000 changes on meta model layer

17.05.2008 ICSE'08, CVSM: Towards SCM for Unified Models - M. Kögel 13

Technische Universität München

17.05.2008 ICSE'08, CVSM: Towards SCM for Unified Models - M. Kögel 14

Future research, next steps

•  Evaluation: fine-grained vs. file-based change tracking

•  Semantic operations –  Define semantics of operations not only by its meta model operations –  Result might depend on initial project state

•  Integration of current research prototype with Eclipse EMF => More information on http://unicase.org

Technische Universität München

17.05.2008 ICSE'08, CVSM: Towards SCM for Unified Models - M. Kögel 15

Questions? Discussion…