Automating Model Transformationsand Refactoring for Goal-oriented Models
Antoine Cailliau June 25, 2010
1
Outline
ContextWhat motivates the work?
Illustrated approachHow is the problem addressed?
Known limitationsIs the approach viable?
2
Well-structured requirementsare required
Goal-orientation use goalsas core abstraction to answer
What?
Why?
Who?
3
KAOS is a goal-oriented method
EffectiveTransportation
RapidTransportation
SafeTransportationA goal
A refinement
Goal-model is theprimary focus
Refinementsinter-relate goals
4
Generic specificationscapture a structure
matchesP ⇒ ◊ Q
DistanceBetweenTrainEstimated⇒ ◊AccelerationCommanded
5
Refinement patterns alsocapture a structure
matches
matches
matches
P ⇒ ◊ Q
P ⇒ ◊ R
R ⇒ ◊ Q
DistanceBetweenTrainEstimated⇒ ◊AccelerationCommanded
DistanceBetweenTrainEstimated⇒ ◊AccelerationCommandSent
AccelerationCommandSent⇒ ◊AccelerationCommanded
6
Code evolutionoverlooks requirements
Because requirements evolve, we need
Techniques supporting evolution
Tools supporting techniques
7
Transformations preserveproperties on refinements
CompletenessSatisfying sub-goals is sufficient
MinimalityNo sub-goal is unnecessary
ConsistencyNo sub-goal conflicts with another
8
The approach isconstructive
PrimitiveBasic operators
Macro-operatorsHigh-level operators
9
Macro-operators supporthigh-level tasks
Construction of models
Edition of refinements
Propagation of changes
Restructuring refinements
10
Propagation of changesuse refinement patterns
P ⇒ ◊ R R ⇒ ◊ Q
P ⇒ ◊ QMeta-variables are bound
Bounds express links
Links may preserve invariants
11
Changes are propagatedaccording meta-variables
TrainsFollowing ⇒ ◊ SafeDistance
TrainsFollowing ⇒ ◊AccelerationCommanded
AccelerationCommanded ⇒ ◊SafeDistance
12
Algorithm has 3 steps
P ⇒ ◊ R R ⇒ ◊ Q
P ⇒ ◊ Q
TrainsFollowing ∧ SameTrack ⇒ ◊ SafeDistance
1. Find meta-variable
2. Update Refinement
3. Propagate
13
Algorithm has 3 steps
TrainsFollowing ∧ SameTrack ⇒ ◊ SafeDistance
TrainsFollowing ∧ SameTrack ⇒ ◊AccelerationCommanded
AccelerationCommanded ⇒ ◊SafeDistance
1. Find meta-variable
2. Update Refinement
3. Propagate
14
Algorithm has 3 steps
TrainsFollowing ∧ SameTrack ⇒ ◊ SafeDistance
TrainsFollowing ∧ SameTrack ⇒ ◊AccelerationCommanded
AccelerationCommanded ⇒ ◊SafeDistance
1. Find meta-variable
2. Update Refinement
3. Propagate
15
Restructuring operatorsdetect bad patterns
P ∧¬ C ⇒ ◊ R
P ∧ C ⇒ ◊ R
P ⇒ ◊ Q
R ⇒ ◊ Q
Require a catalogof “bad” patterns
Here, pattern is a mix oftwo known patterns
16
Restructuring operatorsrefactor refinements
P ∧¬ C ⇒ ◊ Q
P ⇒ ◊ Q
P ∧ C ⇒ ◊ Q
P ⇒ ◊ Q
P ⇒ ◊ R R ⇒ ◊ Q
Easier to
Understand
Analyze
Modify
17
Refinement patternsform the main limitations
Lack for abstractionProperties about patterns
Strict instantiationDiscover relaxed pattern
18
Assumptions limit the approach
Tool-supported matching functionSyntactic matching only
Early formalizationSome goals are hard to formalize
19
Conclusion
Requirements need to evolveto avoid disastrous consequencesNo silver bulletThere is a price to pay
Primitive operatorsBasic operatorsMacro-operatorsHigh-level operators
Automating Model Transformationsand Refactoring for Goal-oriented Models
Questions?