24
Model transformation co-evolution: a semi- automatic approach Jokin García, Oscar Díaz and Maider Azanza Onekin Research Group Department of Computer Languages and Systems University of the Basque Country Dresden - September 27 th , 2012

SLE 2012 Model to model transformation co-evolution

Embed Size (px)

Citation preview

Model transformation co-evolution: a semi-

automatic approach

Jokin García, Oscar Díaz and Maider Azanza

Onekin Research Group

Department of Computer Languages and Systems University of the Basque Country

Dresden - September 27th, 2012

J. García, O. Díaz, M. Azanza 2

Index

Background, related workProblem statementProcess

• Detection• Co-evolution

Motivating scenariosConclusions, future work

J. García, O. Díaz, M. Azanza 3

Background, related work Metamodel evolution Model co-evolution to metamodel changes

J. García, O. Díaz, M. Azanza 4

Problem statement Metamodel evolution impacts on transformations. Manual migration of these transformations is cumbersome and error-

prone. We propose a semi-automatic migration process of transformations

to metamodel changes.

J. García, O. Díaz, M. Azanza 5

Process

Metamodel and evolved metamodel

1) Detection:Simple changes

Simplechanges

2) Detection:complex changes

changes

3) Similarityanalysis

Similaritymodel

4) CNF conversion

Transformation

Normalizedtransformation

5) Co-evolution

Co-evolvedtransformation

J. García, O. Díaz, M. Azanza 6

Detection stage1) Retrieve simple changes using a comparison tool

2) Convert simple changes to complex if they are semantically related

AddModelElement

UpdateAttribute

RemoveModelElement

! SplitClass

J. García, O. Díaz, M. Azanza 7

Co-evolution stage Define correspondences that map the original transformation into an

evolved transformation. Taxonomy of changes based on the impact:

• Non Breaking Changes (NBC)• Breaking and Resolvable Changes (BRC)• Breaking and Unresolvable Changes (BUC)

“Everything is a model” philosophy: implemented as HOTs.

J. García, O. Díaz, M. Azanza 8

Co-evolution stage Auxiliary steps

• Conjunctive Normal Form conversion: – not ((A and B) or C) -> (not A or not B) and not C

• Similarity analysis

Source 1Target 1

Target 2

Similarity = 1

Similarity = 0

J. García, O. Díaz, M. Azanza 9

Motivating scenario

J. García, O. Díaz, M. Azanza 10

Motivating scenario

J. García, O. Díaz, M. Azanza 11

Scenario 1: Extract superclass Scenario 1: The AssistantMVC's Multiple class is introduced in the

target metamodel. • Extract superclass is a NBC case. No action is needed.

J. García, O. Díaz, M. Azanza 12

Scenario 2: delete metaproperty The metaproperty optional is deleted from ExamElement.

• minimum deletion is applied.

J. García, O. Díaz, M. Azanza 13

Minimum deletion Delete only the strictly necessary rule fragments String concatenation: s3 <- s1 + s2. If s1 is removed: s3 <- s2. Collections: Set{A, B, C}. If A is removed: Set{B, C} Boolean expressions: not ErasmusGrant or (speakEnglish and

enrolledLastYear). If speakEnglish is removed: not ErasmusGrant or enrolledLastYear

J. García, O. Díaz, M. Azanza 14

Scenario 2 Opposite filters in two rules:

• (value>5 and optional) or long. – Evolved filter: (value > 5 or long)

• not ((value>5 and optional) or long). – CNF: (not value>5 or not optional) and not long. – Evolved filter: (not value>5 and not long).

J. García, O. Díaz, M. Azanza 15

Scenario 3: type change Scenario 3: The AssistantMVC's fontName metaproperty is changed

from string to integer. • BUC in most of the cases. Only few cases are NBC.

J. García, O. Díaz, M. Azanza 16

Scenario 4: split class Scenario 4. The AssistantMVC's OpenElement class is splitted into

OpenElement_1 and OpenElement_2.

J. García, O. Díaz, M. Azanza 17

Scenario 4 One rule will become two, and bindings will be moved to the

corresponding rule depending on the used metaproperty.

J. García, O. Díaz, M. Azanza 18

Scenario 5: Add metaclass and metaproperty

New subclass ExerciseElement and metaproperty style are added

J. García, O. Díaz, M. Azanza 19

Conclusions Semi-automatic process to adapt transformations to metamodel

evolution• Derive complex changes from simple changes• Minimum deletion• Map the original transformation into an evolved transformation

that tackles metamodel changes• The approach is realized for EMOF/Ecore-based metamodels• ATL transformations

J. García, O. Díaz, M. Azanza 20

Future work Empirical assessment:

• Complete implementation• Test is real scenarios.

J. García, O. Díaz, M. Azanza 21

Questions?

[email protected] http://www.onekin.org

Thank you!

J. García, O. Díaz, M. Azanza 22

(Questions) V+V Syntactic correctness: ok Verification [1]

• When a new class in created in the target with a relation with min cardinality > 0, check that it has a mapping.

• When a metaclass is removed from the source, check that metaclasses it is mapped to, do not have relationships with cardinality > 0.

Validation: ?

[1] “Using ATL for checking models” Bezivin et. al.

J. García, O. Díaz, M. Azanza 23

(Questions)Minimum deletion Boolean expressions: not ErasmusGrant or (speakEnglish and

enrolledLastYear). If speakEnglish is removed: not ErasmusGrant or enrolledLastYear

Rt and Rf policies

J. García, O. Díaz, M. Azanza 24

(Questions)