A Theoretical and Empirical Study of EFSM Dependence Kelly Androutsopoulos1 , Nicolas Gold1 , Mark Harman1 , Zheng Li1 and Laurence Tratt2
Centre for Research in Evolution, Search & Testing
1 CREST,
King’s College London University
2 Bournemouth
Reverse engineering
Refactoring
Program comprehension
Dependence Analysis
Testing and debugging
Dependence cluster analysis
A Theoretical and Empirical Study of EFSM Dependence
Impact analysis
Zheng Li
CREST, KING’S COLLEGE LONDON
2 / 30
Reverse engineering
Refactoring
Program comprehension
Dependence Analysis
Testing and debugging
Dependence cluster analysis
A Theoretical and Empirical Study of EFSM Dependence
Impact analysis
Zheng Li
CREST, KING’S COLLEGE LONDON
2 / 30
Reverse engineering
Refactoring
Program comprehension
Dependence Analysis
Testing and debugging
Dependence cluster analysis
A Theoretical and Empirical Study of EFSM Dependence
Impact analysis
Zheng Li
CREST, KING’S COLLEGE LONDON
2 / 30
Reverse engineering
Refactoring
Program comprehension
Dependence Analysis
Testing and debugging
Dependence cluster analysis
A Theoretical and Empirical Study of EFSM Dependence
Impact analysis
Zheng Li
CREST, KING’S COLLEGE LONDON
2 / 30
Reverse engineering
Refactoring
Program comprehension
Dependence Analysis
Testing and debugging
Dependence cluster analysis
A Theoretical and Empirical Study of EFSM Dependence
Impact analysis
Zheng Li
CREST, KING’S COLLEGE LONDON
2 / 30
Reverse engineering
Refactoring
Program comprehension
Dependence Analysis
Testing and debugging
Dependence cluster analysis
A Theoretical and Empirical Study of EFSM Dependence
Impact analysis
Zheng Li
CREST, KING’S COLLEGE LONDON
2 / 30
Reverse engineering
Refactoring
Program comprehension
Dependence Analysis
Testing and debugging
Dependence cluster analysis
A Theoretical and Empirical Study of EFSM Dependence
Impact analysis
Zheng Li
CREST, KING’S COLLEGE LONDON
2 / 30
Model
START
T1 wait
T2
T3 closeDoor
T4
T6 doorIsClosed
T7
T5
T8
T12
openDoor
T9 T10 doorIsOpen
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
T11
CREST, KING’S COLLEGE LONDON
3 / 30
Model START
T1 null_0 T16 T7
T8
T3
overlap_receiving_25
T15
T50 call_initiated_1
overlap_received_call_present
T9 T5
overlap_sending_2
T63
T11
T4
outgoing_call_proceeding_3
T6
T32
incoming_call_proceeding_9
T57
T59
T34
T28
T36
T66
T44
wait_bearer_estab T42
T46 T70
wait_bearer_con T43
disconnect_ind
T61 T62
T21
T22
T23
T67 T45T47
T48 T49
call_active_10 T38
T60
bearer_connect
T41
T35
T52
connect_request_8
bearer_estab
T33
T56
call_received_7 T58
T30
T14
T64
T65
T12
T13
T54
T55
T10
call_delivered_4
T31
call_present_6
T53
initiated_clearing_nobearer
T37
initiated_clearing T24 T17
T72
wait_bearer_disc_2
T25
T26
T27
wait_bearer_disc_1
disconnect_request_11 T20
T19
T71 T29 release_request_19
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
3 / 30
Model
If the model like this? EFSM_CallControl: Dependence Graph: (NTSCD and DATA)
T4
T65
T58
T66
T44
T45
T46
T47
T48
T49
T28
T17
T24
T25
T19
T20
T37
T59
T3
T9
T5
T36
T14
T33
T34
T6
T12
T8
T11
T32
T7
T10
T31
T30
T35
T41
T26
T42
T43
T27
T13
T70
T38
T16
T50
T55
T63
T56
T52
T15
T53
T54
T64
T57
T67
T62
T61
T60
T29
T72
T22
T71
T21
A Theoretical and Empirical Study of EFSM Dependence
T23
Zheng Li
CREST, KING’S COLLEGE LONDON
3 / 30
Motivation Models tend to be larger and more complex.
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
4 / 30
Motivation Models tend to be larger and more complex. Dependence analysis has provided a valuable suite of maintenance techniques at the implementation level, but little at model level.
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
4 / 30
Extended Finite State Machine(EFSM)
Definition An Extended Finite State Machine (EFSM) M is a tuple (S, T, E, V) where S is a set of states, T is a set of transitions, E is a set of events, and V is a store represented by a set of variables. Transitions have a source state source(t) ∈ S, a target state target(t) ∈ S and a label lbl(t). Transition labels are of the form e1 [c]/a where e1 ∈ E, c is a condition and a a sequence of actions.
S1
Event[Condition]/Action
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
S2
CREST, KING’S COLLEGE LONDON
5 / 30
An EFSM example:DoorControl
T11:openTimer[timer>0]/timer:=timer-1
T2:waitTimer[timer>0]/timer:=timer - 1
sing T4:clo
opened
T9:op T1
0:f
ut
im
2:t
T3:ready[timer==0]
Start
wait
yO pe
ne
T1 T1:setTimer/timer:=5
ening
ull
eo
d
T5:buttonInterrupt/timer:=3
closing
0
T6
:fu lly C
los ed
T8
:op
e
=1 er: im t / n
opening
closed
T7:closeTimer
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
6 / 30
EFSM VS CFG Start
READ(x) T11:openTimer[timer>0]/timer:=timer-1
T2:waitTimer[timer>0]/timer:=timer - 1
sing T4:clo
opened
T9:ope ning
T1
0:f
ut
wait
pe
T6
yes
ne
d
T5:buttonInterrupt/timer:=3
closing
x>0
yO
T1 T3:ready[timer==0]
T1:setTimer/timer:=5
Start
no
ull
eo im 2:t
10
:fu lly C
los
ed
en
:op
opening
y:=-x
y:=x
r:= me /ti
T8
closed
WRITE(y) T7:closeTimer
Exit
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
7 / 30
EFSM VS CFG Start
READ(x) T11:openTimer[timer>0]/timer:=timer-1
T2:waitTimer[timer>0]/timer:=timer - 1
sing T4:clo
opened
T9:ope ning
T1
0:f
ut
wait
pe
T6
yes
ne
d
T5:buttonInterrupt/timer:=3
closing
x>0
yO
T1 T3:ready[timer==0]
T1:setTimer/timer:=5
Start
no
ull
eo im 2:t
10
:fu lly C
los
ed
en
:op
opening
y:=-x
y:=x
r:= me /ti
T8
closed
WRITE(y) T7:closeTimer
Exit
Difference 1
Transition in EFSM VS Node in CFG
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
7 / 30
EFSM VS CFG Start
READ(x) T11:openTimer[timer>0]/timer:=timer-1
T2:waitTimer[timer>0]/timer:=timer - 1
sing T4:clo
opened
T9:ope ning
T1
0:f
ut
wait
pe
T6
yes
ne
d
T5:buttonInterrupt/timer:=3
closing
x>0
yO
T1 T3:ready[timer==0]
T1:setTimer/timer:=5
Start
no
ull
eo im 2:t
10
:fu lly C
los
ed
en
:op
opening
y:=-x
y:=x
r:= me /ti
T8
closed
WRITE(y) T7:closeTimer
Exit
Difference 1
Transition in EFSM VS Node in CFG
2
Self-looping edge and multi-edges between two nodes
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
7 / 30
EFSM VS CFG Start
READ(x) T11:openTimer[timer>0]/timer:=timer-1
T2:waitTimer[timer>0]/timer:=timer - 1
sing T4:clo
opened
T9:ope ning
T1
0:f
ut
wait
pe
T6
yes
ne
d
T5:buttonInterrupt/timer:=3
closing
x>0
yO
T1 T3:ready[timer==0]
T1:setTimer/timer:=5
Start
no
ull
eo im 2:t
10
:fu lly C
los
ed
en
:op
opening
y:=-x
y:=x
r:= me /ti
T8
closed
WRITE(y) T7:closeTimer
Exit
Difference 1
Transition in EFSM VS Node in CFG
2
Self-looping edge and multi-edges between two nodes
3
Exit node
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
7 / 30
Dependence Analysis of EFSM
Data Dependence Control Dependence
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
8 / 30
Dependence Analysis of EFSM
Data Dependence Control Dependence Traditional Control Dependence [Korel et al, ICSM 2003]
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
8 / 30
Dependence Analysis of EFSM
Data Dependence Control Dependence Traditional Control Dependence [Korel et al, ICSM 2003] Non-Termination Insensitive Control Dependence (NTICD) [Ranganath et al. ESOP 2005] Non-Termination Sensitive Control Dependence (NTSCD) [Ranganath et al. ESOP 2005]
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
8 / 30
Dependence Analysis of EFSM
Data Dependence Control Dependence Traditional Control Dependence [Korel et al, ICSM 2003] Non-Termination Insensitive Control Dependence (NTICD) [Ranganath et al. ESOP 2005] Non-Termination Sensitive Control Dependence (NTSCD) [Ranganath et al. ESOP 2005] Unfair Non-Termination Insensitive Control Dependence (UNTICD) [Androutsopoulos et al. FASE 2009]
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
8 / 30
Data Dependence
Definition DD
Ti −→ Tj means that transitions Ti and Tj are data dependent with respect to a variable v if: 1
v ∈ D(Ti ), where D(Ti ) is a set of variables defined by transition Ti , i.e. variables defined by actions and by the event of Ti ;
Ti :def(v)
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
9 / 30
Data Dependence
Definition DD
Ti −→ Tj means that transitions Ti and Tj are data dependent with respect to a variable v if: 1
v ∈ D(Ti ), where D(Ti ) is a set of variables defined by transition Ti , i.e. variables defined by actions and by the event of Ti ;
2
v ∈ U(Tj ), where U(Tj ) is a set of variables used in a condition and actions of transition Tj ;
Tj :use(v)
Ti :def(v)
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
9 / 30
Data Dependence
Definition DD
Ti −→ Tj means that transitions Ti and Tj are data dependent with respect to a variable v if: 1
v ∈ D(Ti ), where D(Ti ) is a set of variables defined by transition Ti , i.e. variables defined by actions and by the event of Ti ;
2
v ∈ U(Tj ), where U(Tj ) is a set of variables used in a condition and actions of transition Tj ;
3
there exists a path in an EFSM from the source(Ti ) to the target(Tj ) whereby v is not modified by any of the intermediate transitions.
Ti :def(v)
A Theoretical and Empirical Study of EFSM Dependence
NO def(v)
Zheng Li
Tj :use(v)
CREST, KING’S COLLEGE LONDON
9 / 30
Types of Control Dependence and Paths in EFSM
Name
Path type
NTSCD
−→
Maximal Path
NTICD
−→
Sink-bounded Path
UNTICD
−→
Unfair Sink-bounded Path
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
10 / 30
Definition (Maximal Path) A maximal path is any path that terminates in a final transition, or is infinite.
T11:openTimer[timer>0]/timer:=timer-1
T2:waitTimer[timer>0]/timer:=timer - 1
sing T4:clo
opened ut
T9:op T1
0:f
im
2:t
yO
pe
ne
T1 T3:ready[timer==0]
T1:setTimer/timer:=5
Start
wait
ening
ull
eo
d
T5:buttonInterrupt/timer:=3
closing
opening
T6
:fu
lly
Cl os
T8
ed
:o
n pe
closed
T7:closeTimer
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
11 / 30
Definition (Maximal Path) A maximal path is any path that terminates in a final transition, or is infinite.
T11:openTimer[timer>0]/timer:=timer-1
T2:waitTimer[timer>0]/timer:=timer - 1
sing T4:clo
opened ut
T9:op T1
0:f
im
2:t
yO
pe
ne
T1 T3:ready[timer==0]
T1:setTimer/timer:=5
Start
wait
ening
ull
eo
d
T5:buttonInterrupt/timer:=3
closing
opening
T6
:fu
lly
Cl os
T8
ed
:o
n pe
closed
T7:closeTimer
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
11 / 30
Definition (Maximal Path) A maximal path is any path that terminates in a final transition, or is infinite.
T11:openTimer[timer>0]/timer:=timer-1
T2:waitTimer[timer>0]/timer:=timer - 1
sing T4:clo
opened ut
T9:op T1
0:f
im
2:t
yO
pe
ne
T1 T3:ready[timer==0]
T1:setTimer/timer:=5
Start
wait
ening
ull
eo
d
T5:buttonInterrupt/timer:=3
closing
opening
T6
:fu
lly
Cl os
T8
ed
:o
n pe
closed
T7:closeTimer
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
11 / 30
Definition (Maximal Path) A maximal path is any path that terminates in a final transition, or is infinite.
T11:openTimer[timer>0]/timer:=timer-1
T2:waitTimer[timer>0]/timer:=timer - 1
sing T4:clo
opened ut
T9:op T1
0:f
im
2:t
yO
pe
ne
T1 T3:ready[timer==0]
T1:setTimer/timer:=5
Start
wait
ening
ull
eo
d
T5:buttonInterrupt/timer:=3
closing
opening
T6
:fu
lly
Cl os
T8
ed
:o
n pe
closed
T7:closeTimer
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
11 / 30
Definition (Control Sink) A control sink in an EFSM is a set of transitions K that form a strongly connected component (SCC) such that, for each transition t in K each successor of t is also in K. T11:openTimer[timer>0]/timer:=timer-1
T2:waitTimer[timer>0]/timer:=timer - 1
sing
T4:clo
opened t ou
T9:op
T1
ull yO pe
e
im
2:t
ne
T1 T3:ready[timer==0]
T1:setTimer/timer:=5
Start
wait
ening
0:f
d
T5:buttonInterrupt/timer:=3
closing
opening
T6
:fu
lly
Cl os ed
:o
T8
n pe
closed
T7:closeTimer A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
12 / 30
Definition (Control Sink) A control sink in an EFSM is a set of transitions K that form a strongly connected component (SCC) such that, for each transition t in K each successor of t is also in K. T11:openTimer[timer>0]/timer:=timer-1
T2:waitTimer[timer>0]/timer:=timer - 1
sing
T4:clo
opened t ou
T9:op
T1
ull yO pe
e
im
2:t
ne
T1 T3:ready[timer==0]
T1:setTimer/timer:=5
Start
wait
ening
0:f
d
T5:buttonInterrupt/timer:=3
closing
opening
T6
:fu
lly
Cl os ed
:o
T8
n pe
closed
T7:closeTimer A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
12 / 30
Definition (Sink-bounded Paths) A maximal path π is sink-bounded iff (i) there exists a control sink K such that K ∩ π 6= ∅ and, (ii) if π is infinite, then all transitions in K occur infinitely often. T11:openTimer[timer>0]/timer:=timer-1
T2:waitTimer[timer>0]/timer:=timer - 1
sing
T4:clo
opened eo
T9:op
T1
ull yO
im
2:t
pe
ne
T1 T3:ready[timer==0]
T1:setTimer/timer:=5
Start
wait
ening
0:f
ut
d
T5:buttonInterrupt/timer:=3
closing
opening
T6
:fu
lly
pe 8:o
Cl os
n
T
ed
closed
T7:closeTimer A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
13 / 30
Definition (Sink-bounded Paths) A maximal path π is sink-bounded iff (i) there exists a control sink K such that K ∩ π 6= ∅ and, (ii) if π is infinite, then all transitions in K occur infinitely often. T11:openTimer[timer>0]/timer:=timer-1
T2:waitTimer[timer>0]/timer:=timer - 1
sing
T4:clo
opened eo
T9:op
T1
ull yO
im
2:t
pe
ne
T1 T3:ready[timer==0]
T1:setTimer/timer:=5
Start
wait
ening
0:f
ut
d
T5:buttonInterrupt/timer:=3
closing
opening
T6
:fu
lly
pe 8:o
Cl os
n
T
ed
closed
T7:closeTimer A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
13 / 30
Definition (Unfair Sink-bounded Paths) A maximal path π is unfair sink-bounded iff there exists a control sink K such that: π contains a transition from K. T11:openTimer[timer>0]/timer:=timer-1
T2:waitTimer[timer>0]/timer:=timer - 1
sing
T4:clo
opened t
u eo
T9:op
T1
ull yO pe
im
2:t
ne
T1 T3:ready[timer==0]
T1:setTimer/timer:=5
Start
wait
ening
0:f
d
T5:buttonInterrupt/timer:=3
closing
opening
T6
:fu
lly
Cl os
:o
T8
ed
n pe
closed
T7:closeTimer
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
14 / 30
Definition (Unfair Sink-bounded Paths) A maximal path π is unfair sink-bounded iff there exists a control sink K such that: π contains a transition from K. T11:openTimer[timer>0]/timer:=timer-1
T2:waitTimer[timer>0]/timer:=timer - 1
sing
T4:clo
opened t
u eo
T9:op
T1
ull yO pe
im
2:t
ne
T1 T3:ready[timer==0]
T1:setTimer/timer:=5
Start
wait
ening
0:f
d
T5:buttonInterrupt/timer:=3
closing
opening
T6
:fu
lly
Cl os
:o
T8
ed
n pe
closed
T7:closeTimer
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
14 / 30
Definition (Unfair Sink-bounded Paths) A maximal path π is unfair sink-bounded iff there exists a control sink K such that: π contains a transition from K. T11:openTimer[timer>0]/timer:=timer-1
T2:waitTimer[timer>0]/timer:=timer - 1
sing
T4:clo
opened t
u eo
T9:op
T1
ull yO pe
im
2:t
ne
T1 T3:ready[timer==0]
T1:setTimer/timer:=5
Start
wait
ening
0:f
d
T5:buttonInterrupt/timer:=3
closing
opening
T6
:fu
lly
Cl os
:o
T8
ed
n pe
closed
T7:closeTimer
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
14 / 30
Definition (Control Dependence) CD
Ti −→ Tj means that a transition Tj is control dependent on a transition Ti iff Ti has at least one sibling Tk such that: 1 2
for all paths π ∈ PATHs(target(Ti )), the source(Tj ) belongs to π; there exists a path π ∈ PATHs(source(Tk )) such that the source(Tj ) does not belong to π.
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
15 / 30
Definition (Control Dependence) CD
Ti −→ Tj means that a transition Tj is control dependent on a transition Ti iff Ti has at least one sibling Tk such that: 1 2
for all paths π ∈ PATHs(target(Ti )), the source(Tj ) belongs to π; there exists a path π ∈ PATHs(source(Tk )) such that the source(Tj ) does not belong to π. CD NTSCD NTICD UNTICD
−→ −→ −→
A Theoretical and Empirical Study of EFSM Dependence
PATH type Maximal Path Sink-bounded Path Unfair Sink-bounded Path
Zheng Li
CREST, KING’S COLLEGE LONDON
15 / 30
Example (NTSCD) NTSCD
T3 −−−→ T4 , T5 , T6 NTSCD
T5 −−−→ T9 , T10 T11:openTimer[timer>0]/timer:=timer-1
T2:waitTimer[timer>0]/timer:=timer - 1
sing
T4:clo
opened
T9:op
T1
t ou
ull yO
e
im
2:t
pe ne
T1 T3:ready[timer==0]
T1:setTimer/timer:=5
Start
wait
ening
0:f
d
T5:buttonInterrupt/timer:=3
closing
opening
T6
:fu
lly
Cl os
:o
T8
ed
n pe
closed
T7:closeTimer
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
16 / 30
Example (NTSCD) NTSCD
T3 −−−→ T4 , T5 , T6 NTSCD
T5 −−−→ T9 , T10 T11:openTimer[timer>0]/timer:=timer-1
T2:waitTimer[timer>0]/timer:=timer - 1
sing
T4:clo
opened
T9:op
T1
t ou
ull yO
e
im
2:t
pe ne
T1 T3:ready[timer==0]
T1:setTimer/timer:=5
Start
wait
ening
0:f
d
T5:buttonInterrupt/timer:=3
closing
opening
T6
:fu
lly
Cl os
:o
T8
ed
n pe
closed
T7:closeTimer
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
16 / 30
Example (NTICD) NO NTICD in this example
T11:openTimer[timer>0]/timer:=timer-1
T2:waitTimer[timer>0]/timer:=timer - 1
sing
T4:clo
opened t ou
T9:op
T1
ull yO pe
e
im
2:t
T1 T3:ready[timer==0]
T1:setTimer/timer:=5
Start
wait
ening
0:f
ne
d
T5:buttonInterrupt/timer:=3
closing
opening
T6
:fu
lly
n
Cl os ed
T
pe 8:o
closed
T7:closeTimer A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
17 / 30
Example (UNTICD) UNTICD
T3 −−−−→ UNTICD
T5 −−−−→ T9 , T10 T11:openTimer[timer>0]/timer:=timer-1
T2:waitTimer[timer>0]/timer:=timer - 1
sing
T4:clo
opened
T9:op
T1
t ou
ull yO
e
im
2:t
pe ne
T1 T3:ready[timer==0]
T1:setTimer/timer:=5
Start
wait
ening
0:f
d
T5:buttonInterrupt/timer:=3
closing
opening
T6
:fu
lly
Cl os
:o
T8
ed
n pe
closed
T7:closeTimer
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
18 / 30
Example (UNTICD) UNTICD
T3 −−−−→ UNTICD
T5 −−−−→ T9 , T10 T11:openTimer[timer>0]/timer:=timer-1
T2:waitTimer[timer>0]/timer:=timer - 1
sing
T4:clo
opened
T9:op
T1
t ou
ull yO
e
im
2:t
pe ne
T1 T3:ready[timer==0]
T1:setTimer/timer:=5
Start
wait
ening
0:f
d
T5:buttonInterrupt/timer:=3
closing
opening
T6
:fu
lly
Cl os
:o
T8
ed
n pe
closed
T7:closeTimer
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
18 / 30
Slicing
Definition (Slice Criterion) A slicing criterion is a pair (t, v) where transition t ∈ T and variable set v ⊆ V.
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
19 / 30
Slicing
Definition (Slice Criterion) A slicing criterion is a pair (t, v) where transition t ∈ T and variable set v ⊆ V.
Definition (Slice) A slice of an EFSM M, is another EFSM M 0 , whose transitions will be directly or indirectly (transitive closure) data and control dependent on the slicing criterion c.
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
19 / 30
Metrics
Definition (Slice Size) For a model M, t0 is a transition dependent on t (i.e., t0 ∈ T ∧ t → − t0 ), the size of slice with respect to t is: P 0 t |S(M, t)| = |M|
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
20 / 30
Metrics
Definition (Slice Size) For a model M, t0 is a transition dependent on t (i.e., t0 ∈ T ∧ t → − t0 ), the size of slice with respect to t is: P 0 t |S(M, t)| = |M|
Definition (Average Slice Size) For a model M, NT is subset of transitions of M with non-zero slice size (i.e., NT ⊆ T and ∀t ∈ NT, |S(M, t)| > 0) .Thus, the average slice size of M is: X |S(M, t)| Avg(M) =
A Theoretical and Empirical Study of EFSM Dependence
t∈NT
|NT|
Zheng Li
CREST, KING’S COLLEGE LONDON
20 / 30
Subjects
Models ATM Cashier CruiseControl FuelPump PrinTok VendingMachine INRES TCP TCSbin Lift Total
#S 9 12 5 13 11 7 8 12 24 6 107
#T 23 21 17 25 89 28 18 57 65 12 355
A Theoretical and Empirical Study of EFSM Dependence
#V 8 10 18 12 5 7 8 31 61 1 161
EXIT Yes Yes Yes Yes Yes Yes No No No No
Zheng Li
Description Automated Teller Machine Cashier Machine Cruise Control System Fuel Pump System Print Token Vending Machine system INRES protocol TCP Standard(RFC793) Telephony Control Protocol Lift System
CREST, KING’S COLLEGE LONDON
21 / 30
Slice Size
Dependence DD+NTSCD DD+NTICD DD+UNTICD DD NTSCD NTICD UNTICD
Forward Slices #T Avg
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
Backward Slices #T Avg
CREST, KING’S COLLEGE LONDON
22 / 30
Slice Size
Dependence DD+NTSCD DD+NTICD DD+UNTICD DD NTSCD NTICD UNTICD
Forward Slices #T Avg 276 87.45% 220 61.99% 267 83.20% 161 35.67% 205 86.10% 92 78.67% 190 82.21%
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
Backward Slices #T Avg
CREST, KING’S COLLEGE LONDON
22 / 30
Slice Size
Dependence DD+NTSCD DD+NTICD DD+UNTICD DD NTSCD NTICD UNTICD
Forward Slices #T Avg 276 87.45% 220 61.99% 267 83.20% 161 35.67% 205 86.10% 92 78.67% 190 82.21%
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
Backward Slices #T Avg 345 70.46% 278 49.48% 335 66.83% 174 33.15% 336 53.63% 167 44.59% 313 51.00%
CREST, KING’S COLLEGE LONDON
22 / 30
Backward Slice size using NTICD
100%
Data-NTICD NTICD Data
Average Slice Size
80%
60%
40%
20%
0% ATM
Cashier
Cruise FuelPump PrinTok Vending INRES Control Machine
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
Lift
TCP
TCSbin
CREST, KING’S COLLEGE LONDON
23 / 30
Correlation of Slice Size Model ATM
Cashier
CruiseControl
FuelPump
PrinTok
VendingMachine
INRES
Lift
TCP
TCSbin
Dependence NTICD UNTICD NTSCD NTICD UNTICD NTSCD NTICD UNTICD NTSCD NTICD UNTICD NTSCD NTICD UNTICD NTSCD NTICD UNTICD NTSCD NTICD UNTICD NTSCD NTICD UNTICD NTSCD NTICD UNTICD NTSCD NTICD UNTICD NTSCD
NTICD 1.000 .652 1.000 .898 1.000 1.000 1.000 .786 1.000 1.000 1.000 .360 x x x x x x x x
A Theoretical and Empirical Study of EFSM Dependence
Forward UNTICD 1.000 652. 1.000 .898 1.000 1.000 1.000 .786 1.000 1.000 1.000 .360 x 1.000 x .813 x . x 1.000 Zheng Li
NTSCD .652 .652 .898 .898 1.000 1.000 .786 .786 1.000 1.000 .360 .360 x 1.000 x .813 x 1.000 x 1.000 -
NTICD 1.000 .941 1.000 1.000 1.000 1.000 1.000 -.509 1.000 1.000 1.000 .224 x x x x x x x x
Backward UNTICD 1.000 .941 1.000 1.000 1.000 1.000 1.000 -.509 1.000 1.000 1.000 .224 x 1.000 x 1.000 x 1.000 x 1.000
NTSCD .941 .941 1.000 1.000 1.000 1.000 -.509 -.509 1.000 1.000 .224 .224 x 1.000 x 1.000 x 1.000 x 1.000 -
CREST, KING’S COLLEGE LONDON
24 / 30
Correlation of Slice Size Model ATM
Cashier
CruiseControl
FuelPump
PrinTok
VendingMachine
INRES
Lift
TCP
TCSbin
Dependence NTICD UNTICD NTSCD NTICD UNTICD NTSCD NTICD UNTICD NTSCD NTICD UNTICD NTSCD NTICD UNTICD NTSCD NTICD UNTICD NTSCD NTICD UNTICD NTSCD NTICD UNTICD NTSCD NTICD UNTICD NTSCD NTICD UNTICD NTSCD
NTICD 1.000 .652 1.000 .898 1.000 1.000 1.000 .786 1.000 1.000 1.000 .360 x x x x x x x x
A Theoretical and Empirical Study of EFSM Dependence
Forward UNTICD 1.000 652. 1.000 .898 1.000 1.000 1.000 .786 1.000 1.000 1.000 .360 x 1.000 x .813 x . x 1.000 Zheng Li
NTSCD .652 .652 .898 .898 1.000 1.000 .786 .786 1.000 1.000 .360 .360 x 1.000 x .813 x 1.000 x 1.000 -
NTICD 1.000 .941 1.000 1.000 1.000 1.000 1.000 -.509 1.000 1.000 1.000 .224 x x x x x x x x
Backward UNTICD 1.000 .941 1.000 1.000 1.000 1.000 1.000 -.509 1.000 1.000 1.000 .224 x 1.000 x 1.000 x 1.000 x 1.000
NTSCD .941 .941 1.000 1.000 1.000 1.000 -.509 -.509 1.000 1.000 .224 .224 x 1.000 x 1.000 x 1.000 x 1.000 -
CREST, KING’S COLLEGE LONDON
24 / 30
Properties of Control Dependence
Proposition For an EFSM M, if Ti ∈ M is a self-looping transition, then there is no transition Tj that is control dependent (NTSCD, NTICD or UNTICD) on Ti .
Ti
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
25 / 30
Properties of Control Dependence
Proposition For an EFSM M, if two transitions Ti and Tj have the same source and target CD CD states, and Ti −→ Tl (using NTSCD, NTICD or UNTICD) then Tj −→ Tl (using NTSCD, NTICD or UNTICD respectively).
Ti
Tj
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
26 / 30
Properties of Control Dependence
Proposition CD
For an EFSM M, if Ti −→ Tj (either NTSCD, NTICD, or UNTICD), source(Tj ) must belong to the shortest path of type PATH in PATHs(target(Ti )).
This proposition has been used to reduce the cost of computation on NTSCD, NTICD, or UNTICD.
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
27 / 30
Properties of Control Dependence
Proposition For an EFSM M, if all states s ∈ M where s 6= START have a transition Ti where source(Ti ) = s and target(Ti ) = EXIT, then the set of transitions that are directly control dependent on Ti are the same for all types of control dependence, i.e. NTSCD, NTICD and UNTICD.
START
T1 S1 T2 S2 T8
T9
T10
T3 T4 T5 T6 T7
T11T12 T13 T14
T16
S3
T15 T17 EXIT
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
28 / 30
Question?
(
[email protected])
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
29 / 30
Conclusion and Future work
Conclusion We empirically studied slice size for EFSM using 10 benchmark examples and real world production EFSM models. The results reveal that current definitions of dependence lead to slice sizes that are notably larger than the existing benchmark data for program slice size. Forward slice sizes tend to be larger than backward slice size for EFSMs. Four of the novel findings arising from the empirical results are formalised and proved.
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
30 / 30
Conclusion and Future work
Conclusion We empirically studied slice size for EFSM using 10 benchmark examples and real world production EFSM models. The results reveal that current definitions of dependence lead to slice sizes that are notably larger than the existing benchmark data for program slice size. Forward slice sizes tend to be larger than backward slice size for EFSMs. Four of the novel findings arising from the empirical results are formalised and proved.
Future Work Weak Order Dependence(WOD) Slicing algorithm
A Theoretical and Empirical Study of EFSM Dependence
Zheng Li
CREST, KING’S COLLEGE LONDON
30 / 30