Shiva Nejati Mehrdad Sabetzadeh Marsha Chechik Steve

Transcription

Shiva Nejati Mehrdad Sabetzadeh Marsha Chechik Steve
Matching and Merging of
Statecharts Specifications
Shiva Nejati Mehrdad Sabetzadeh
Marsha Chechik Steve Easterbrook
University of Toronto
Pamela Zave
AT&T Labs
International Conference on Software
Engineering(ICSE’07)
May 23 2007
Background
➜ Collaborative model-based development
➥ Models built and manipulated by distributed teams
➣ Different versions over time
➣ Different variants across a product family
➣ Different features
➣ Different views
2
Example: AT&T Call Logger Feature
➜ Call Logger: Logs call information and makes it
available to subscribers through a web portal
s0
t0 Call logger - voicemail
t2
t1
setup [zone=target]
Call logger - basic
s1 Initialize Links
s2
setup [zone=source]/
callee = participant
Start
setup [zone=target]/
callee = subscriber
s4
Start
s3
setup [zone=source]
t3
Link
Callee
subscriber?Ack
Link
Participant
Timer
Started
participant?Accept [zone=source] OR
subscriber?Accept [zone=target]
participant?Reject [zone=source] OR
participant?TearDown [zone=source] OR
subscriber?Reject [zone=target] OR
subscriber?TearDown [zone=target]
Timer
Started
participant?TearDown OR
subscriber?TearDown
Log
Success
redirectToVoicemail
[zone=target]
s7
participant?Reject [zone=source] OR
participant?Unavail [zone=source] OR
participant?TearDown [zone=source] OR
subscriber?Reject [zone=target] OR
subscriber?Unavail [zone=target] OR
subscriber?TearDown [zone=target]
participant?TearDown OR
subscriber?TearDown
t6
s6
t4
callee?Ack
t5
s5
participant?Ack
Pending
Wait
participant?Accept [zone=source] OR
subscriber?Accept [zone=target]
Link
Subscriber
Log
Success
t7
Log
Failure
t8
Log
Voicemail
Log
Failure
3
Challenges
➜ Independently-developed models
➥ may have different vocabularies
➥ often overlap
➣ ... and overlapping concepts may be represented differently
➥ may contradict one another
➥ may be partial
4
Modelling Tasks
➜ Activities in distributed development
➥ integration
➥ consistency checking
➥ interaction analysis
➥ refactoring
➥ commonality and variability analysis
➥ verification and validation
5
Modelling Tasks
➜ Activities in distributed development
➥ integration
➥ consistency checking
➥ interaction analysis
➥ refactoring
➥ commonality and variability analysis
➥ verification and validation
Model management operators aim
to facilitate these tasks
5
Model Management
➜ Model management operators
[Bernstein CIDR’03,
Toronto merge grp GaMMa’06]
➥ Match
➣ finding relationships between models
➥ Merge
➣ combining models with respect to
known relationships between them
➥ Diff
➣ finding differences between models
➥ Slice
➣ producing a projection of a model
based on a given criterion
6
Model Management
➜ Model management operators
[Bernstein CIDR’03,
Toronto merge grp GaMMa’06]
➥ Match
➣ finding relationships between models
➥ Merge
➣ combining models with respect to
known relationships between them
➥ Diff
➣ finding differences between models
➥ Slice
➣ producing a projection of a model
based on a given criterion
6
Framework for Model Merging
s0
s1
s0
s1
I
s2
I
s2
S
S
se
s3
se
s3
L
su
L
s4
su
s4
par
s5
t3
S
t5
s7
g
t2
t4
par
s1
Match
t0
t1
sub
pen
t3
d
S
ls
t7
lf
t8
t2
su
su
lp
t5
ts
t6
(s2 , t1 )
o
Merge
C
d
tear
s7
g
il
(s3 , t3 )
o
kk
p
c
T
s6
su
su
lp
su
par
C
t1
s5
T
s6
(s0 , t0 )
par
su
par
t0
Ac
Wk
Ac
Wk
t4
par
Input Models
zon
(c,s)
c
(l,l)
[ID=v]
s
(s4 , t4 )
[ ID=b]
(w,p)
par
(s5 , t5 )
sub
pen
p
r
t
(t,t)
tear
d
(s6 , t6 )
(s7 , t7 )
(l,l)
d
(f,f)
t8
v
ts
tear
lv
kk
(s3 , t2 )
(s,
s)
set
t6
ls
t7
lf
t8
lv
Merged Model
Models &
Relationships
7
Framework for Model Merging
s0
s1
s0
s1
I
s2
I
s2
S
S
se
s3
se
s3
L
su
L
s4
su
s4
par
s5
t3
S
t5
s7
g
t2
t4
par
s1
Match
t0
t1
sub
pen
t3
d
S
ls
t7
lf
t8
t2
su
su
lp
t5
ts
t6
(s2 , t1 )
o
Merge
C
d
tear
s7
g
il
(s3 , t3 )
o
kk
p
c
T
s6
su
su
lp
su
par
C
t1
s5
T
s6
(s0 , t0 )
par
su
par
t0
Ac
Wk
Ac
Wk
t4
par
Input Models
zon
(c,s)
c
(l,l)
[ID=v]
s
(s4 , t4 )
[ ID=b]
(w,p)
par
(s5 , t5 )
sub
pen
p
r
t
(t,t)
tear
d
(s6 , t6 )
(s7 , t7 )
(l,l)
d
(f,f)
t8
v
ts
tear
lv
kk
(s3 , t2 )
(s,
s)
set
t6
ls
t7
lf
t8
lv
Merged Model
Models &
Relationships
Allows to hypothesize alternative ways of
mapping and merging different models
7
Framework for Model Merging
s0
s1
s0
s1
I
s2
I
s2
S
S
se
s3
se
s3
L
su
L
s4
su
s4
par
s5
t3
S
t5
s7
g
t2
t4
par
s1
Match
t0
t1
sub
pen
t3
d
S
ls
t7
lf
t8
t2
su
su
lp
t5
ts
t6
(s2 , t1 )
o
Merge
C
d
tear
s7
g
il
(s3 , t3 )
o
kk
p
c
T
s6
su
su
lp
su
par
C
t1
s5
T
s6
(s0 , t0 )
par
su
par
t0
Ac
Wk
Ac
Wk
t4
par
Input Models
zon
(c,s)
c
(l,l)
[ID=v]
s
(s4 , t4 )
[ ID=b]
(w,p)
par
(s5 , t5 )
sub
pen
p
r
t
(t,t)
tear
d
(s6 , t6 )
(s7 , t7 )
(l,l)
d
(f,f)
t8
v
ts
tear
t6
lv
kk
(s3 , t2 )
(s,
s)
set
ls
t7
lf
t8
lv
Merged Model
Models &
Relationships
- Heuristic
- Semi-automated
Allows to hypothesize alternative ways of
mapping and merging different models
7
Framework for Model Merging
s0
s1
s0
s1
I
s2
I
s2
S
S
se
s3
se
s3
L
su
L
s4
su
s4
par
s5
t3
S
t5
s7
g
t2
t4
par
s1
Match
t0
t1
sub
pen
t3
d
S
ls
t7
lf
t8
t2
su
su
lp
t5
ts
t6
(s2 , t1 )
o
Merge
C
d
tear
s7
g
il
(s3 , t3 )
o
kk
p
c
T
s6
su
su
lp
su
par
C
t1
s5
T
s6
(s0 , t0 )
par
su
par
t0
Ac
Wk
Ac
Wk
t4
par
Input Models
zon
(c,s)
c
(l,l)
[ID=v]
s
(s4 , t4 )
[ ID=b]
(w,p)
par
(s5 , t5 )
sub
pen
p
r
t
(t,t)
tear
d
(s6 , t6 )
(s7 , t7 )
(l,l)
d
(f,f)
t8
v
ts
tear
t6
lv
kk
(s3 , t2 )
(s,
s)
set
ls
t7
lf
t8
Merged Model
lv
Models &
Relationships
- Heuristic
- Semi-automated
- Exact
- Automated
Allows to hypothesize alternative ways of
mapping and merging different models
7
AT&T Call Logger Feature
➜ Call Logger: Logs call information and makes it
available to subscribers through a web portal
s0
t0 Call logger - voicemail
t2
t1
setup [zone=target]
Call logger - basic
s1 Initialize Links
s2
setup [zone=source]/
callee = participant
Start
setup [zone=target]/
callee = subscriber
s4
Start
s3
setup [zone=source]
t3
Link
Callee
subscriber?Ack
Link
Participant
Timer
Started
participant?Accept [zone=source] OR
subscriber?Accept [zone=target]
participant?Reject [zone=source] OR
participant?TearDown [zone=source] OR
subscriber?Reject [zone=target] OR
subscriber?TearDown [zone=target]
Timer
Started
participant?TearDown OR
subscriber?TearDown
Log
Success
redirectToVoicemail
[zone=target]
s7
participant?Reject [zone=source] OR
participant?Unavail [zone=source] OR
participant?TearDown [zone=source] OR
subscriber?Reject [zone=target] OR
subscriber?Unavail [zone=target] OR
subscriber?TearDown [zone=target]
participant?TearDown OR
subscriber?TearDown
t6
s6
t4
callee?Ack
t5
s5
participant?Ack
Pending
Wait
participant?Accept [zone=source] OR
subscriber?Accept [zone=target]
Link
Subscriber
Log
Success
t7
Log
Failure
t8
Log
Voicemail
Log
Failure
8
Our Goal
➜ Construct specific instantiations of Match and
Merge operators
➥ ... for finding overlaps between Statecharts and
combining them
➥ Issues:
➣ identify model relationships
➣ construct a merge
➣ distinguish between shared and non-shared
parts of the input models
➣ ensure that our operators are correct
9
Our Goal
➜ Construct specific instantiations of Match and
Merge operators
➥ ... for finding overlaps between Statecharts and
combining them
➥ Issues:
➣ identify model relationships
➣ construct a merge
➣ distinguish between shared and non-shared
parts of the input models
➣ ensure that our operators are correct
➥ Challenge
➣ Statecharts combine structural and behavioural information
9
Merge
Match
Related Work
Structural
Behavioural
DB: Schema matching
Formal methods:
Quantitative notions of
behavioural bisimulation
Rahm&Bernstein VLDBJ01
Melnik et al. ICDE02
SE: Support for reuse
Maiden&Sutcliffe CASM92
Ryan&Mathews RE93
Mandelin et al. ICSE06
DB: Schema merging
Melnik et al. SIGMOD02
SE: Graph-based models
Alanen&Porres UML03
Mehra et al. ASE05
Sabetzadeh&Easterbrook REJ06
de Alfaro et al. ICALP04
Sokolsky et al. TACAS06
SE: State-machines and
scenarios
Whittle&Schumann ICSE00
Uchitel&Chechik FSE04
Nejati&Chechik ASE05
10
Our Contributions
➜ A model merging framework for Statecharts
s0
s1
s0
s1
I
s2
I
s2
S
S
se
s3
se
s3
L
su
L
s4
su
s4
par
s5
s6
t3
S
t5
t2
su
su
lp
s7
g
t4
par
o
Match
t0
t1
sub
pen
t3
d
S
ls
t7
lf
t8
t2
su
su
lp
t5
ts
t6
(s2 , t1 )
o
Merge
C
d
tear
s7
g
il
(s3 , t3 )
kk
p
c
s1
par
C
t1
su
T
T
s6
(s0 , t0 )
par
s5
su
par
t0
Ac
Wk
Ac
Wk
t4
par
Input Models
zon
(c,s)
c
(l,l)
[ID=v]
s
(s4 , t4 )
[ ID=b]
(w,p)
par
(s5 , t5 )
sub
pen
p
r
t
(t,t)
tear
d
(s6 , t6 )
(s7 , t7 )
(l,l)
d
(f,f)
t8
v
ts
tear
lv
kk
(s3 , t2 )
(s,
s)
set
t6
ls
t7
lf
t8
lv
Merged Model
Models &
Relationships
11
Our Contributions
➜ A model merging framework for Statecharts
s0
s1
s0
s1
I
s2
I
s2
S
S
se
s3
se
s3
L
su
L
s4
su
s4
par
s5
s6
t3
S
t5
t2
su
su
lp
s7
g
t4
par
o
Match
t0
t1
sub
pen
t3
d
S
ls
t7
lf
t8
t2
su
su
lp
t5
ts
t6
(s2 , t1 )
o
Merge
C
d
tear
s7
g
il
(s3 , t3 )
kk
p
c
s1
par
C
t1
su
T
T
s6
(s0 , t0 )
par
s5
su
par
t0
Ac
Wk
Ac
Wk
t4
par
Input Models
zon
(c,s)
c
(l,l)
[ID=v]
s
(s4 , t4 )
[ ID=b]
(w,p)
par
(s5 , t5 )
sub
pen
p
r
t
(t,t)
tear
d
(s6 , t6 )
(s7 , t7 )
(l,l)
d
(f,f)
t8
v
ts
tear
lv
kk
(s3 , t2 )
(s,
s)
set
t6
ls
t7
lf
t8
lv
Merged Model
Models &
Relationships
-Uses two kinds of heuristics
-Syntactic (static)
-Semantic (behavioural)
11
Match Operator: Syntactic Heuristics
➜ Similarities between state names
➥ typographic similarities:
N-gram matcher
➥ linguistic similarities: WordNet similarity matcher
➜ Similarities between models hierarchy trees
➥ states at similar depths are more likely to be similar
VoiceMail:
Basic:
RedirectToVM
Wait
Accept
Reject,
TearDown
Pending
participant?Avail
subscriber?Avail
Accept
Reject,
TearDown
Unavail
/log VoiceMail
Success
Failure
Success
Failure
VoiceMail
12
Match Operator: Syntactic Heuristics
➜ Similarities between state names
➥ typographic similarities:
N-gram matcher
➥ linguistic similarities: WordNet similarity matcher
➜ Similarities between models hierarchy trees
➥ states at similar depths are more likely to be similar
VoiceMail:
Basic:
RedirectToVM
Wait
Accept
Reject,
TearDown
Pending
participant?Avail
subscriber?Avail
Accept
Reject,
TearDown
Unavail
/log VoiceMail
Success
Failure
1.0
Success
Failure
VoiceMail
✔
12
Match Operator: Syntactic Heuristics
➜ Similarities between state names
➥ typographic similarities:
N-gram matcher
➥ linguistic similarities: WordNet similarity matcher
➜ Similarities between models hierarchy trees
➥ states at similar depths are more likely to be similar
0.12
Basic:
Wait
Accept
Reject,
TearDown
✘
VoiceMail:
RedirectToVM
Pending
participant?Avail
subscriber?Avail
Accept
Reject,
TearDown
Unavail
/log VoiceMail
Success
Failure
1.0
Success
Failure
VoiceMail
✔
12
Match Operator: Behavioural Heuristics
➜ Similarities between branching behaviours of
states
➥ Behavioural bisimulation is too strong
VoiceMail:
Basic:
RedirectToVM
Wait
Accept
Reject,
TearDown
Pending
participant?Avail
subscriber?Avail
Accept
Reject,
TearDown
Unavail
/log VoiceMail
Success
Failure
Success
Failure
VoiceMail
13
Match Operator: Behavioural Heuristics
➜ Similarities between branching behaviours of
states
➥ Behavioural bisimulation is too strong
VoiceMail:
Basic:
RedirectToVM
Wait
Accept
Reject,
TearDown
Pending
participant?Avail
subscriber?Avail
Accept
Reject,
TearDown
Unavail
/log VoiceMail
Success
Failure
Success
Failure
VoiceMail
13
Match Operator: Behavioural Heuristics
➜ Similarities between branching behaviours of
states
➥ Behavioural bisimulation is too strong
VoiceMail:
Basic:
RedirectToVM
Wait
Accept
Reject,
TearDown
Pending
participant?Avail
subscriber?Avail
Accept
Reject,
TearDown
Unavail
/log VoiceMail
Success
Failure
Success
Failure
VoiceMail
Bisimilar
13
Match Operator: Behavioural Heuristics
➜ Similarities between branching behaviours of
states
➥ Behavioural bisimulation is too strong
VoiceMail:
Basic:
RedirectToVM
Wait
Accept
Reject,
TearDown
Pending
participant?Avail
subscriber?Avail
Accept
Reject,
TearDown
Unavail
/log VoiceMail
Success
Failure
Success
Failure
VoiceMail
Bisimilar
13
Match Operator: Behavioural Heuristics
➜ Similarities between branching behaviours of
states
➥ Behavioural bisimulation is too strong
VoiceMail:
Basic:
RedirectToVM
Wait
Accept
Reject,
TearDown
Pending
participant?Avail
subscriber?Avail
Accept
Reject,
TearDown
Unavail
/log VoiceMail
Success
Failure
Success
Failure
VoiceMail
Bisimilar
13
Match Operator: Behavioural Heuristics
➜ Similarities between branching behaviours of
states
➥ Behavioural bisimulation is too strong
Not Bisimilar ✘
VoiceMail:
Basic:
RedirectToVM
Wait
Accept
Reject,
TearDown
Pending
participant?Avail
subscriber?Avail
Accept
Reject,
TearDown
Unavail
/log VoiceMail
Success
Failure
Success
Failure
VoiceMail
Bisimilar
13
!
a ! max b
X = s→s
L(a, b) × B (s , t ). And the
!
t→t
Heuristics
arityMatch
degrees Operator:
between the Behavioural
forward neighbours
of
d their
matchesnotion
among
the forward
neighquantitative
of bisimulation
[Sokolsky
et al.
➜ Abest
TACAS06]
of
s
after
iteration
i
−
1
are
computed
by
!
i−1
"
"
Iteratively
aggregate
similarity
degrees
between
a ! ➥
max
b)
×
B
(s
,
t
).
We
denote
b ! L(a,
t→t
i−1
"
"
s→s
forward/backward
i neighbours of a pair of states
um of X and Y by Sum (s, t).
i all states are similar ( B 0 (s, t) = 1 )
Initially
➜
e value of B (s, t) is computed by first normalizing
i−1
i
(s, t)➜and
thent)taking
its average with B (s, t):
is
B (s,
i
B (s, t) =
`
1
2
i
Sum (s,t)
|succ(s)|+|succ(t)|
´
i−1
+ B (s, t)
algorithm
stopsand
when
it converges
or numafter a
➜ The
e above
formula,
|succ(s)|
|succ(t)|
are the
maximum
number
of
iterations
f forward neighbours of s and t, respectively. The
i
r the B (s, t), the more the behaviours of s and t are
bi
w
H
(m
ity
w
us
4.
M
la
de
ar
to
14
Behavioural Matching: Example
VoiceMail:
Basic:
RedirectToVM
Wait
Accept
Reject,
TearDown
Pending
participant?Avail
subscriber?Avail
Accept
Reject,
TearDown
Unavail
/log VoiceMail
Success
Failure
Success
Failure
VoiceMail
15
Behavioural Matching: Example
0.65
Basic:
Wait
Accept
Reject,
TearDown
✔
VoiceMail:
RedirectToVM
Pending
participant?Avail
subscriber?Avail
Accept
Reject,
TearDown
Unavail
/log VoiceMail
Success
Failure
Success
Failure
VoiceMail
15
Hybrid Match Operator
➜ Combine syntactic and behavioural similarity
measures
➥ e.g., by taking their linear average
16
Hybrid Match Operator
➜ Combine syntactic and behavioural similarity
measures
➥ e.g., by taking their linear average
➜ Example:
VoiceMail:
Basic:
RedirectToVM
Wait
Accept
Reject,
TearDown
Pending
participant?Avail
subscriber?Avail
Accept
Reject,
TearDown
Unavail
/log VoiceMail
Success
Failure
Success
Failure
VoiceMail
16
Hybrid Match Operator
➜ Combine syntactic and behavioural similarity
measures
➥ e.g., by taking their linear average
➜ Example:
VoiceMail:
Basic:
RedirectToVM
Wait
Accept
Reject,
TearDown
Pending
participant?Avail
subscriber?Avail
Accept
Reject,
TearDown
Unavail
/log VoiceMail
Success
Failure
Success
Failure
VoiceMail
➜ The resulting relationship
{(Wait, Pending), (Success, Success), (Failure, Failure)}
➜ This may need user revision
16
Our Contributions
➜ A model merging framework for Statecharts
s0
s1
s0
s1
I
s2
I
s2
S
S
se
s3
se
s3
L
su
L
s4
su
s4
par
s5
s6
t3
S
t5
t2
su
su
lp
s7
g
t4
par
o
Match
t0
t1
sub
pen
t3
d
S
ls
t7
lf
t8
t2
su
su
lp
t5
ts
t6
(s2 , t1 )
o
Merge
C
d
tear
s7
g
il
(s3 , t3 )
kk
p
c
s1
par
C
t1
su
T
T
s6
(s0 , t0 )
par
s5
su
par
t0
Ac
Wk
Ac
Wk
t4
par
Input Models
zon
(c,s)
c
(l,l)
[ID=v]
s
(s4 , t4 )
[ ID=b]
(w,p)
par
(s5 , t5 )
sub
pen
p
r
t
(t,t)
tear
d
(s6 , t6 )
(s7 , t7 )
(l,l)
d
(f,f)
t8
v
ts
tear
lv
kk
(s3 , t2 )
(s,
s)
set
t6
ls
t7
lf
t8
lv
Merged Model
Models &
Relationships
17
Our Contributions
➜ A model merging framework for Statecharts
s0
s1
s0
s1
I
s2
I
s2
S
S
se
s3
se
s3
L
su
L
s4
su
s4
par
s5
s6
t3
S
t5
t2
su
su
lp
s7
g
t4
par
o
Match
t0
t1
sub
pen
t3
d
S
ls
t7
lf
t8
t2
su
su
lp
t5
ts
t6
(s2 , t1 )
o
Merge
C
d
tear
s7
g
il
(s3 , t3 )
kk
p
c
s1
par
C
t1
su
T
T
s6
(s0 , t0 )
par
s5
su
par
t0
Ac
Wk
Ac
Wk
t4
par
Input Models
zon
(c,s)
c
(l,l)
[ID=v]
s
(s4 , t4 )
[ ID=b]
(w,p)
par
(s5 , t5 )
sub
pen
p
r
t
(t,t)
tear
d
(s6 , t6 )
(s7 , t7 )
(l,l)
d
(f,f)
t8
v
ts
tear
lv
kk
(s3 , t2 )
(s,
s)
set
t6
ls
t7
lf
t8
Merged Model
lv
Models &
Relationships
-Preserves
behavioural and
hierarchical information
-Treats behavioural
discrepancies as variabilities
17
Merging: Example
VoiceMail:
Basic:
RedirectToVM
Wait
Accept
Reject,
TearDown
Pending
participant?Avail
subscriber?Avail
Accept
Reject,
TearDown
Unavail
/log VoiceMail
Success
Failure
Success
Failure
VoiceMail
One Relationship:
{(Wait, Pending),
(Success, Success),
(Failure, Failure)}
18
Merging: Example
VoiceMail:
Basic:
RedirectToVM
Wait
Accept
Reject,
TearDown
Pending
participant?Avail
subscriber?Avail
Accept
Reject,
TearDown
Unavail
/log VoiceMail
Success
Success
Failure
Failure
VoiceMail
One Relationship:
{(Wait, Pending),
(Success, Success),
(Failure, Failure)}
Wait,
participant?Avail
Pending
subscriber?Avail
Accept
Success,
Success
Unavail
[Id = voicemail]
RedirectToVM
[Id = voicemail]
Reject,
TearDown
/log VoiceMail
Failure,
Failure
VoiceMail
18
Merging: Example
VoiceMail:
Basic:
RedirectToVM
Wait
Accept
Reject,
TearDown
Pending
participant?Avail
subscriber?Avail
Accept
Reject,
TearDown
Unavail
/log VoiceMail
Success
Success
Failure
Failure
VoiceMail
After a connection is set up, a successful
call will be logged if the subscriber or
participant sends Accept
Wait,
participant?Avail
Pending
subscriber?Avail
Accept
Success,
Success
Unavail
[Id = voicemail]
RedirectToVM
[Id = voicemail]
Reject,
TearDown
/log VoiceMail
Failure,
Failure
VoiceMail
18
Merging: Example
VoiceMail:
Basic:
RedirectToVM
Wait
Accept
Reject,
TearDown
Pending
participant?Avail
subscriber?Avail
Accept
Reject,
TearDown
Unavail
/log VoiceMail
Success
Success
Failure
Failure
VoiceMail
After a connection is set up, a successful
call will be logged if the subscriber or
participant sends Accept
Wait,
participant?Avail
Pending
subscriber?Avail
Accept
Success,
Success
Unavail
[Id = voicemail]
RedirectToVM
[Id = voicemail]
Reject,
TearDown
/log VoiceMail
Failure,
Failure
VoiceMail
18
Merging: Example
VoiceMail:
Basic:
RedirectToVM
Wait
Accept
Reject,
TearDown
Pending
participant?Avail
subscriber?Avail
Accept
Reject,
TearDown
Unavail
/log VoiceMail
Success
Success
Failure
Failure
VoiceMail
After a connection is set up, a successful
call will be logged if the subscriber or
participant sends Accept
Wait,
participant?Avail
Pending
subscriber?Avail
Accept
Success,
Success
Unavail
[Id = voicemail]
RedirectToVM
[Id = voicemail]
Reject,
TearDown
/log VoiceMail
Failure,
Failure
VoiceMail
18
Merging: Example
VoiceMail:
Basic:
RedirectToVM
Wait
Accept
Reject,
TearDown
Pending
participant?Avail
subscriber?Avail
Accept
Reject,
TearDown
Unavail
/log VoiceMail
Success
Success
Failure
Failure
VoiceMail
After a connection is set up, a voicemail will
be logged if the call is redirected to a
voicemail service
Wait,
participant?Avail
Pending
subscriber?Avail
Accept
Success,
Success
Unavail
[Id = voicemail]
RedirectToVM
[Id = voicemail]
Reject,
TearDown
/log VoiceMail
Failure,
Failure
VoiceMail
18
Merging: Example
VoiceMail:
Basic:
RedirectToVM
Wait
Accept
Reject,
TearDown
Pending
participant?Avail
subscriber?Avail
Accept
Reject,
TearDown
Unavail
/log VoiceMail
Success
Success
Failure
Failure
VoiceMail
After a connection is set up, a voicemail will
be logged if the call is redirected to a
voicemail service
Wait,
participant?Avail
Pending
subscriber?Avail
Accept
Success,
Success
Unavail
[Id = voicemail]
RedirectToVM
[Id = voicemail]
Reject,
TearDown
/log VoiceMail
Failure,
Failure
VoiceMail
18
Merging: Example
VoiceMail:
Basic:
RedirectToVM
Wait
Accept
Reject,
TearDown
Pending
participant?Avail
subscriber?Avail
Accept
Reject,
TearDown
Unavail
/log VoiceMail
Success
Success
Failure
Failure
VoiceMail
After a connection is set up, a voicemail will
be logged if the call is redirected to a
voicemail service
Wait,
participant?Avail
Pending
subscriber?Avail
Accept
Success,
Success
Unavail
[Id = voicemail]
RedirectToVM
[Id = voicemail]
Reject,
TearDown
/log VoiceMail
Failure,
Failure
VoiceMail
18
Merging: Example
VoiceMail:
Basic:
RedirectToVM
Wait
Accept
Reject,
TearDown
Pending
participant?Avail
subscriber?Avail
Accept
Reject,
TearDown
Unavail
/log VoiceMail
Success
Success
Failure
Failure
VoiceMail
Merge is always sound, but a poor match will yield
a merge with unnecessary parameterization
Wait,
participant?Avail
Pending
subscriber?Avail
Accept
Success,
Success
Unavail
[Id = voicemail]
RedirectToVM
[Id = voicemail]
Reject,
TearDown
/log VoiceMail
Failure,
Failure
VoiceMail
18
Merging: Example
VoiceMail:
Basic:
RedirectToVM
Wait
Accept
Reject,
TearDown
Pending
participant?Avail
subscriber?Avail
Accept
Reject,
TearDown
Unavail
/log VoiceMail
Success
Failure
Success
Failure
VoiceMail
Merge is always sound, but a poor match will yield
a merge with unnecessary parameterization
Accept
[Id = basic]
RedirectToVM
[Id = voicemail]
Reject,
TearDown
Wait,
participant?Avail
Pending
subscriber?Avail
Unavail
[Id = voicemail]
Success
Accept
Failure,
[Id =voicemail]
Failure
Success
/log VoiceMail
VoiceMail
18
Call Logger Feature
s0
t0 Call logger - voicemail
t2
t1
setup [zone=target]
Call logger - basic
s1 Initialize Links
s2
setup [zone=source]/
callee = participant
Start
setup [zone=target]/
callee = subscriber
s4
Start
s3
setup [zone=source]
t3
Link
Callee
subscriber?Ack
Link
Participant
Timer
Started
participant?Accept [zone=source] OR
subscriber?Accept [zone=target]
participant?Reject [zone=source] OR
participant?TearDown [zone=source] OR
subscriber?Reject [zone=target] OR
subscriber?TearDown [zone=target]
Timer
Started
participant?TearDown OR
subscriber?TearDown
Log
Success
redirectToVoicemail
[zone=target]
s7
participant?Reject [zone=source] OR
participant?Unavail [zone=source] OR
participant?TearDown [zone=source] OR
subscriber?Reject [zone=target] OR
subscriber?Unavail [zone=target] OR
subscriber?TearDown [zone=target]
participant?TearDown OR
subscriber?TearDown
t6
s6
t4
callee?Ack
t5
s5
participant?Ack
Pending
Wait
participant?Accept [zone=source] OR
subscriber?Accept [zone=target]
Link
Subscriber
Log
Success
t7
Log
Failure
t8
Log
Voicemail
Log
Failure
19
A Possible Merge
(s0 , t0 )
Call logger - (basic, voicemail)
s1 Initialize Links
(s2 , t1 ) (Start,
setup [zone =target]/
callee = subscriber
setup [zone=source] /
callee=participant
Start)
(s3 , t3 )
(Link Callee,
Link Participant)
participant?Ack
[ID=voicemail]
(s3 , t2 )
(Link Callee,
Link Subscriber)
callee?Ack
[ID=basic]
subscriber?Ack
[ID=voicemail]
(s4 , t4 )
callee?Ack
[ ID=basic]
(Waiting,
Pending)
participant?Accept [zone=source] OR
subscriber?Accept [zone=target]
redirectToVoicemail
[zone=target,
ID=voicemail]
participant?Reject [zone=source] OR
participant?Unavail [zone=source, ID=voicemail]OR
(s5 , t5 ) (Timer Started,
Timer Started)
participant?TearDown [zone=source] OR
subscriber?Reject [zone=target] OR
participant?TearDown OR
subscriber?Unavail [in target-zone, ID=voicemail] OR
subscriber?TearDown
subscriber?TearDown [zone=target]
(s6 , t6 )
(Log Success,
Log Success)
(s7 , t7 )
(Log Failure,
Log Failure)
t8
Log
Voicemail
20
Evaluation
➜ Ultimate evaluation:
➥ improves productivity and quality in model-based
development
➜ Our current evaluation
➥ Merge operator (analytically)
➣ soundness
➠ preserves branching behaviours, i.e., traces and trees
➣ scalability -- low complexity
➥ Match operator (empirically)
➣ compare its results with the assessment of a domain expert
21
Evaluation: Match
➠ high precision
➣ few false negatives
➠ high recall
➥ Results
➣ syntactic-- high precision
➠ states with similar names
were likely to correspond
➣ behavioural-- high recall
➣ combined matching
➠ precision higher than the
individual matchings
➠ recall is reasonably high
Precision
➣ few false positives
Call Logger
100%
90%
Combined
80%
70%
Behavioural
60%
Static
50%
40%
30%
20%
10%
0%
0.95 0.9 0.85 0.8 0.75 0.7 0.65 0.6 0.55 0.5
Threshold
100%
90%
80%
70%
60%
50%
40%
30%
0.95 0.9 0.85 0.8 0.75 0.7 0.65 0.6 0.55 0.5
Recall
➥ Desirable match
➥ More evaluation results in the paper
Threshold
22
Complexity
➜ Time Complexity
➥ Match and Merge
➣ O(|trans. of M| × |trans of M’|)
➜ Space Complexity
➥ Match
➣ O(|states of M| × |states of M’|
|trans. of M|
×
+
|trans. of M’|)
➥ Merge
➣ linear in the size of the input models and the correspondence
relation
➠ ... which is max(|states of M|, |states of M’|)
23
Limitations
➜ Match
➥ Need more extensive user trials for better evaluation
➣ We did not evaluate iterative use:
➠ match, merge, refine the match, merge again, etc.
➣ We assumed there is a single “correct” match
➜ Merge
➥ We do not support a number of advanced Statecharts
features
➣ history states, parallel states and transitions, etc
24
Conclusion
➜ Match operator for Statecharts
➥ heuristic
➥ uses structure and behaviour
➜ Merge operator for Statecharts
➥ automatic
➥ preserves structure and behaviour
➜ Proof-of-concept implementations
➥ Merge: www.cs.toronto.edu/~mehrdad/tremer/
➥ Match: www.cs.toronto.edu/~shiva/MatchTool/
25
Thank You!
Questions?

Similar documents