Slicing of Extended Finite State Machines Kelly Androutsopoulos 1 , - - PowerPoint PPT Presentation

slicing of extended finite state machines
SMART_READER_LITE
LIVE PREVIEW

Slicing of Extended Finite State Machines Kelly Androutsopoulos 1 , - - PowerPoint PPT Presentation

Slicing of Extended Finite State Machines Kelly Androutsopoulos 1 , David Clark 1 , Nicolas Gold 1 , Mark Harman 1 , Rob Hierons 2 , Zheng Li 1 and Laurence Tratt 3 Centre for Research in E Centre for Research in E volution, volution, Search


slide-1
SLIDE 1

Slicing of Extended Finite State Machines

Kelly Androutsopoulos1, David Clark1, Nicolas Gold1, Mark Harman1, Rob Hierons2, Zheng Li1 and Laurence Tratt3

Centre for Research in E volution, Search & Testing Centre for Research in E volution, Search & Testing 1CREST, King’s College London 2Brunel University 3Bournemouth University

slide-2
SLIDE 2

SLIcing state based Models SLIcing state based Models

EPSRC Project

SLIM

2008 – 2011 CREST

Dependence Analysis

Data

Dependence

Control

Dependence

Non- termination Sensitive Non- termination Insensitive Order Dependence

Types of Slicing

Dependence

Based Slicing Event Restriction Slicing

Correctness

Semantics Syntax

Applications

Compre- hension Model debugging

Dependence Based Slicing

  • Dependence Analysis
  • Marked Transitions
  • ε-elimination
  • Minimisation

Event Restriction Slicing

  • BasicSlice
  • Constant Propagation
  • R-mergeEquivalentStates
  • G-mergeEquivalentStates

Benchmarks ATM Cashier CruiseControl FuelPump PrintToken VendingMachine DoorController INRES protocol TCP TCSbin(Motorola)

slim.dcs.kcl.ac.uk Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 2 / 34

slide-3
SLIDE 3

Program Slicing

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 3 / 34

slide-4
SLIDE 4

Program Slicing

we only care about this line which other lines affect the selected line?

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 3 / 34

slide-5
SLIDE 5

Program Slicing

we only care about this line which other lines affect the selected line?

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 3 / 34

slide-6
SLIDE 6

Program Slicing

we only care about this line which other lines affect the selected line?

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 3 / 34

slide-7
SLIDE 7

Program Slicing

Program compre- hension Impact analysis Dependence cluster analysis Testing and debugging Refactoring Reverse engineering

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 4 / 34

slide-8
SLIDE 8

Program Slicing

Program compre- hension Impact analysis Dependence cluster analysis Testing and debugging Refactoring Reverse engineering

Program Slicing

Program compre- hension

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 4 / 34

slide-9
SLIDE 9

Program Slicing

Program compre- hension Impact analysis Dependence cluster analysis Testing and debugging Refactoring Reverse engineering

Program Slicing

Program compre- hension

Program Slicing

Program compre- hension Impact analysis

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 4 / 34

slide-10
SLIDE 10

Program Slicing

Program compre- hension Impact analysis Dependence cluster analysis Testing and debugging Refactoring Reverse engineering

Program Slicing

Program compre- hension

Program Slicing

Program compre- hension Impact analysis

Program Slicing

Program compre- hension Impact analysis Dependence cluster analysis

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 4 / 34

slide-11
SLIDE 11

Program Slicing

Program compre- hension Impact analysis Dependence cluster analysis Testing and debugging Refactoring Reverse engineering

Program Slicing

Program compre- hension

Program Slicing

Program compre- hension Impact analysis

Program Slicing

Program compre- hension Impact analysis Dependence cluster analysis

Program Slicing

Program compre- hension Impact analysis Dependence cluster analysis Testing and debugging

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 4 / 34

slide-12
SLIDE 12

Program Slicing

Program compre- hension Impact analysis Dependence cluster analysis Testing and debugging Refactoring Reverse engineering

Program Slicing

Program compre- hension

Program Slicing

Program compre- hension Impact analysis

Program Slicing

Program compre- hension Impact analysis Dependence cluster analysis

Program Slicing

Program compre- hension Impact analysis Dependence cluster analysis Testing and debugging

Program Slicing

Program compre- hension Impact analysis Dependence cluster analysis Testing and debugging Refactoring

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 4 / 34

slide-13
SLIDE 13

Program Slicing

Program compre- hension Impact analysis Dependence cluster analysis Testing and debugging Refactoring Reverse engineering

Program Slicing

Program compre- hension

Program Slicing

Program compre- hension Impact analysis

Program Slicing

Program compre- hension Impact analysis Dependence cluster analysis

Program Slicing

Program compre- hension Impact analysis Dependence cluster analysis Testing and debugging

Program Slicing

Program compre- hension Impact analysis Dependence cluster analysis Testing and debugging Refactoring

Program Slicing

Program compre- hension Impact analysis Dependence cluster analysis Testing and debugging Refactoring Reverse engineering

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 4 / 34

slide-14
SLIDE 14

Can slicing be applied to model level?

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 5 / 34

slide-15
SLIDE 15

Model

START wait T1 T2 closeDoor T3 T4 doorIsClosed T6

  • penDoor

T5 T7 T8 T9 doorIsOpen T10 T12 T11 Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 6 / 34

slide-16
SLIDE 16

Model

START null_0 T1 call_initiated_1 T3 call_present_6 T15

  • verlap_receiving_25

T16 T7 T8 call_delivered_4 T4

  • utgoing_call_proceeding_3

T5 bearer_estab T6

  • verlap_sending_2

T9 T34 disconnect_ind T35 initiated_clearing T36 T32 T30 T31 T33 wait_bearer_estab T41 T10 T11 T12 T13 T14 wait_bearer_disc_1 T17 wait_bearer_disc_2 T24 initiated_clearing_nobearer T60 incoming_call_proceeding_9 T54 call_received_7 T64 connect_request_8 T56 T52

  • verlap_received_call_present

T50 release_request_19 T19 T20 T21 T22 T23 T25 disconnect_request_11 T26 T27 T72 T28 T29 T71 call_active_10 T38 T37 bearer_connect wait_bearer_con T44 T48 T49 T46 T45T47 T59 T53 T63 T55 T61 T65 T57 T62 T58 T67 T66 T43 T70 T42

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 6 / 34

slide-17
SLIDE 17

Model

If the model like this?

EFSM_CallControl: Dependence Graph: (NTSCD and DATA) T4 T65 T63 T64 T34 T35 T36 T58 T62 T6 T55 T56 T57 T41 T42 T43 T70 T66 T67 T8 T28 T16 T15 T3 T17 T27 T37 T60 T61 T59 T24 T71 T29 T20 T52 T9 T10 T11 T12 T13 T14 T50 T53 T54 T30 T31 T32 T33 T72 T19 T21 T22 T23 T26 T25 T44 T48 T46 T45 T47 T49 T38 T5 T7

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 6 / 34

slide-18
SLIDE 18

Motivation

Models tend to be larger and more complex.

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 7 / 34

slide-19
SLIDE 19

Motivation

Models tend to be larger and more complex. Slicing has provided a valuable suite of maintenance techniques at the implementation level, but little at model level.

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 7 / 34

slide-20
SLIDE 20

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 S2 Event[Condition]/Action

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 8 / 34

slide-21
SLIDE 21

An EFSM example:DoorControl

Start wait closing

  • pening
  • pened

closed

T1:setTimer/timer:=5 T3:ready[timer==0] T5:buttonInterrupt/timer:=3 T6:fullyClosed T10:fullyOpened T12:timeout T8:open/timer:=10 T2:waitTimer[timer>0]/timer:=timer - 1 T 4 : c l

  • s

i n g T9:opening T11:openTimer[timer>0]/timer:=timer-1 T7:closeTimer Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 9 / 34

slide-22
SLIDE 22

Slicing EFSM

Definition (Slicing Criterion)

A slicing criterion for an EFSM is a pair (t, V) where transition t ∈ T and variable set V ⊆ Var. It designates the point in the exaluation immediately after the execution of the action contain in transition t.

Definition (Slice)

An EFSM slice M′ is a reduced machine, where for all inputs i it contains at least one execution where the value of v ∈ V at t is equal to the value of

v at t in the original EFSM M.

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 10 / 34

slide-23
SLIDE 23

The CREST EFSM slicing tool

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 11 / 34

slide-24
SLIDE 24

The CREST EFSM slicing tool

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 11 / 34

slide-25
SLIDE 25

EFSM VS CFG

Start wait closing

  • pening
  • pened

closed

T1:setTimer/timer:=5 T3:ready[timer==0] T5:buttonInterrupt/timer:=3 T6:fullyClosed T10:fullyOpened T12:timeout T8:open/timer:=10 T2:waitTimer[timer>0]/timer:=timer - 1 T4:closing T9:opening T11:openTimer[timer>0]/timer:=timer-1 T7:closeTimer

Start READ(x) x>0 y:=-x y:=x WRITE(y) Exit yes no

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 12 / 34

slide-26
SLIDE 26

EFSM VS CFG

Start wait closing

  • pening
  • pened

closed

T1:setTimer/timer:=5 T3:ready[timer==0] T5:buttonInterrupt/timer:=3 T6:fullyClosed T10:fullyOpened T12:timeout T8:open/timer:=10 T2:waitTimer[timer>0]/timer:=timer - 1 T4:closing T9:opening T11:openTimer[timer>0]/timer:=timer-1 T7:closeTimer

Start READ(x) x>0 y:=-x y:=x WRITE(y) Exit yes no

Difference

1

Transition in EFSM VS Node in CFG

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 12 / 34

slide-27
SLIDE 27

EFSM VS CFG

Start wait closing

  • pening
  • pened

closed

T1:setTimer/timer:=5 T3:ready[timer==0] T5:buttonInterrupt/timer:=3 T6:fullyClosed T10:fullyOpened T12:timeout T8:open/timer:=10 T2:waitTimer[timer>0]/timer:=timer - 1 T4:closing T9:opening T11:openTimer[timer>0]/timer:=timer-1 T7:closeTimer

Start READ(x) x>0 y:=-x y:=x WRITE(y) Exit yes no

Difference

1

Transition in EFSM VS Node in CFG

2

Self-looping edge and multi-edges between two nodes

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 12 / 34

slide-28
SLIDE 28

EFSM VS CFG

Start wait closing

  • pening
  • pened

closed

T1:setTimer/timer:=5 T3:ready[timer==0] T5:buttonInterrupt/timer:=3 T6:fullyClosed T10:fullyOpened T12:timeout T8:open/timer:=10 T2:waitTimer[timer>0]/timer:=timer - 1 T4:closing T9:opening T11:openTimer[timer>0]/timer:=timer-1 T7:closeTimer

Start READ(x) x>0 y:=-x y:=x WRITE(y) Exit yes no

Difference

1

Transition in EFSM VS Node in CFG

2

Self-looping edge and multi-edges between two nodes

3

Non-termination (Exit node)

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 12 / 34

slide-29
SLIDE 29

Dependence Analysis of EFSM

Data Dependence Control Dependence

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 13 / 34

slide-30
SLIDE 30

Dependence Analysis of EFSM

Data Dependence Control Dependence

Traditional Control Dependence [Korel et al, ICSM 2003]

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 13 / 34

slide-31
SLIDE 31

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]

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 13 / 34

slide-32
SLIDE 32

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]

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 13 / 34

slide-33
SLIDE 33

Data Dependence

Definition

Ti

DD

− → 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)

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 14 / 34

slide-34
SLIDE 34

Data Dependence

Definition

Ti

DD

− → 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;

Ti:def(v) Tj:use(v)

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 14 / 34

slide-35
SLIDE 35

Data Dependence

Definition

Ti

DD

− → 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) Tj:use(v) NO def(v) Tj:use(v)

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 14 / 34

slide-36
SLIDE 36

Types of Control Dependence and Paths in EFSM

Name Path type NTSCD

− →

Maximal Path NTICD

− →

Sink-bounded Path UNTICD

− →

Unfair Sink-bounded Path

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 15 / 34

slide-37
SLIDE 37

Definition (Maximal Path)

A maximal path is any path that terminates in a final transition, or is infinite.

Start wait closing

  • pening
  • pened

closed

T1:setTimer/timer:=5 T3:ready[timer==0] T5:buttonInterrupt/timer:=3 T6:fullyClosed T10:fullyOpened T12:timeout T8:open/timer:=10 T2:waitTimer[timer>0]/timer:=timer - 1 T 4 : c l

  • s

i n g T9:opening T11:openTimer[timer>0]/timer:=timer-1 T7:closeTimer Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 16 / 34

slide-38
SLIDE 38

Definition (Maximal Path)

A maximal path is any path that terminates in a final transition, or is infinite.

Start wait closing

  • pening
  • pened

closed

T1:setTimer/timer:=5 T3:ready[timer==0] T5:buttonInterrupt/timer:=3 T6:fullyClosed T10:fullyOpened T12:timeout T8:open/timer:=10 T2:waitTimer[timer>0]/timer:=timer - 1 T 4 : c l

  • s

i n g T9:opening T11:openTimer[timer>0]/timer:=timer-1 T7:closeTimer T2:waitTimer[timer>0]/timer:=timer - 1 Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 16 / 34

slide-39
SLIDE 39

Definition (Maximal Path)

A maximal path is any path that terminates in a final transition, or is infinite.

Start wait closing

  • pening
  • pened

closed

T1:setTimer/timer:=5 T3:ready[timer==0] T5:buttonInterrupt/timer:=3 T6:fullyClosed T10:fullyOpened T12:timeout T8:open/timer:=10 T2:waitTimer[timer>0]/timer:=timer - 1 T 4 : c l

  • s

i n g T9:opening T11:openTimer[timer>0]/timer:=timer-1 T7:closeTimer T9:opening Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 16 / 34

slide-40
SLIDE 40

Definition (Maximal Path)

A maximal path is any path that terminates in a final transition, or is infinite.

Start wait closing

  • pening
  • pened

closed

T1:setTimer/timer:=5 T3:ready[timer==0] T5:buttonInterrupt/timer:=3 T6:fullyClosed T10:fullyOpened T12:timeout T8:open/timer:=10 T2:waitTimer[timer>0]/timer:=timer - 1 T 4 : c l

  • s

i n g T9:opening T11:openTimer[timer>0]/timer:=timer-1 T7:closeTimer Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 16 / 34

slide-41
SLIDE 41

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.

Start wait closing

  • pening
  • pened

closed

T1:setTimer/timer:=5 T3:ready[timer==0] T5:buttonInterrupt/timer:=3 T6:fullyClosed T10:fullyOpened T12:timeout T8:open/timer:=10 T2:waitTimer[timer>0]/timer:=timer - 1 T4:closing T9:opening T11:openTimer[timer>0]/timer:=timer-1 T7:closeTimer Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 17 / 34

slide-42
SLIDE 42

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.

Start wait closing

  • pening
  • pened

closed

T1:setTimer/timer:=5 T3:ready[timer==0] T5:buttonInterrupt/timer:=3 T6:fullyClosed T10:fullyOpened T12:timeout T8:open/timer:=10 T2:waitTimer[timer>0]/timer:=timer - 1 T4:closing T9:opening T11:openTimer[timer>0]/timer:=timer-1 T7:closeTimer T4:closing T9:opening T11:openTimer[timer>0]/timer:=timer-1 T7:closeTimer Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 17 / 34

slide-43
SLIDE 43

Definition (Sink-bounded Paths)

A maximal path π is sink-bounded iff there exists a control sink K such that: π contains a transition from K if π is infinite, then all transitions in K occur infinitely often.

Start wait closing

  • pening
  • pened

closed

T1:setTimer/timer:=5 T3:ready[timer==0] T5:buttonInterrupt/timer:=3 T6:fullyClosed T10:fullyOpened T12:timeout T8:open/timer:=10 T2:waitTimer[timer>0]/timer:=timer - 1 T4:closing T9:opening T11:openTimer[timer>0]/timer:=timer-1 T7:closeTimer Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 18 / 34

slide-44
SLIDE 44

Definition (Sink-bounded Paths)

A maximal path π is sink-bounded iff there exists a control sink K such that: π contains a transition from K if π is infinite, then all transitions in K occur infinitely often.

Start wait closing

  • pening
  • pened

closed

T1:setTimer/timer:=5 T3:ready[timer==0] T5:buttonInterrupt/timer:=3 T6:fullyClosed T10:fullyOpened T12:timeout T8:open/timer:=10 T2:waitTimer[timer>0]/timer:=timer - 1 T4:closing T9:opening T11:openTimer[timer>0]/timer:=timer-1 T7:closeTimer T4:closing T9:opening T11:openTimer[timer>0]/timer:=timer-1 T7:closeTimer Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 18 / 34

slide-45
SLIDE 45

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 if π is infinite, then all transitions in K occur infinitely often.

Start wait closing

  • pening
  • pened

closed

T1:setTimer/timer:=5 T3:ready[timer==0] T5:buttonInterrupt/timer:=3 T6:fullyClosed T10:fullyOpened T12:timeout T8:open/timer:=10 T2:waitTimer[timer>0]/timer:=timer - 1 T9:opening T11:openTimer[timer>0]/timer:=timer-1 T7:closeTimer T4:closing Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 19 / 34

slide-46
SLIDE 46

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 if π is infinite, then all transitions in K occur infinitely often.

Start wait closing

  • pening
  • pened

closed

T1:setTimer/timer:=5 T3:ready[timer==0] T5:buttonInterrupt/timer:=3 T6:fullyClosed T10:fullyOpened T12:timeout T8:open/timer:=10 T2:waitTimer[timer>0]/timer:=timer - 1 T9:opening T11:openTimer[timer>0]/timer:=timer-1 T7:closeTimer T4:closing T4:closing Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 19 / 34

slide-47
SLIDE 47

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 if π is infinite, then all transitions in K occur infinitely often.

Start wait closing

  • pening
  • pened

closed

T1:setTimer/timer:=5 T3:ready[timer==0] T5:buttonInterrupt/timer:=3 T6:fullyClosed T10:fullyOpened T12:timeout T8:open/timer:=10 T2:waitTimer[timer>0]/timer:=timer - 1 T9:opening T11:openTimer[timer>0]/timer:=timer-1 T7:closeTimer T4:closing Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 19 / 34

slide-48
SLIDE 48

Definition (Control Dependence)

Ti

CD

− → Tj means that a transition Tj is control dependent on a transition Ti iff Ti has at least one sibling Tk such that:

1

for all paths π ∈ PATHs(target(Ti)), the source(Tj) belongs to π;

2

there exists a path π ∈ PATHs(source(Tk)) such that the source(Tj) does not belong to π.

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 20 / 34

slide-49
SLIDE 49

Definition (Control Dependence)

Ti

CD

− → Tj means that a transition Tj is control dependent on a transition Ti iff Ti has at least one sibling Tk such that:

1

for all paths π ∈ PATHs(target(Ti)), the source(Tj) belongs to π;

2

there exists a path π ∈ PATHs(source(Tk)) such that the source(Tj) does not belong to π. CD PATH type NTSCD

− →

Maximal Path NTICD

− →

Sink-bounded Path UNTICD

− →

Unfair Sink-bounded Path

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 20 / 34

slide-50
SLIDE 50

Example (NTSCD)

T3

NTSCD

− − − → T4, T5, T6 T5

NTSCD

− − − → T9, T10

Start wait closing

  • pening
  • pened

closed

T1:setTimer/timer:=5 T3:ready[timer==0] T5:buttonInterrupt/timer:=3 T6:fullyClosed T10:fullyOpened T12:timeout T8:open/timer:=10 T2:waitTimer[timer>0]/timer:=timer - 1 T4:closing T9:opening T11:openTimer[timer>0]/timer:=timer-1 T7:closeTimer Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 21 / 34

slide-51
SLIDE 51

Example (NTSCD)

T3

NTSCD

− − − → T4, T5, T6 T5

NTSCD

− − − → T9, T10

Start wait closing

  • pening
  • pened

closed

T1:setTimer/timer:=5 T3:ready[timer==0] T5:buttonInterrupt/timer:=3 T6:fullyClosed T10:fullyOpened T12:timeout T8:open/timer:=10 T2:waitTimer[timer>0]/timer:=timer - 1 T4:closing T9:opening T11:openTimer[timer>0]/timer:=timer-1 T7:closeTimer Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 21 / 34

slide-52
SLIDE 52

Example (NTICD)

NO NTICD in this example

Start wait closing

  • pening
  • pened

closed

T1:setTimer/timer:=5 T3:ready[timer==0] T5:buttonInterrupt/timer:=3 T6:fullyClosed T10:fullyOpened T12:timeout T8:open/timer:=10 T2:waitTimer[timer>0]/timer:=timer - 1 T4:closing T9:opening T11:openTimer[timer>0]/timer:=timer-1 T7:closeTimer Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 22 / 34

slide-53
SLIDE 53

Example (UNTICD)

T3

UNTICD

− − − → T5

UNTICD

− − − → T9, T10

Start wait closing

  • pening
  • pened

closed

T1:setTimer/timer:=5 T3:ready[timer==0] T5:buttonInterrupt/timer:=3 T6:fullyClosed T10:fullyOpened T12:timeout T8:open/timer:=10 T2:waitTimer[timer>0]/timer:=timer - 1 T4:closing T9:opening T11:openTimer[timer>0]/timer:=timer-1 T7:closeTimer Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 23 / 34

slide-54
SLIDE 54

Example (UNTICD)

T3

UNTICD

− − − → T5

UNTICD

− − − → T9, T10

Start wait closing

  • pening
  • pened

closed

T1:setTimer/timer:=5 T3:ready[timer==0] T5:buttonInterrupt/timer:=3 T6:fullyClosed T10:fullyOpened T12:timeout T8:open/timer:=10 T2:waitTimer[timer>0]/timer:=timer - 1 T4:closing T9:opening T11:openTimer[timer>0]/timer:=timer-1 T7:closeTimer Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 23 / 34

slide-55
SLIDE 55

Metrics

Definition (Slice Size)

For a model M, t′ is a transition dependent on t (i.e., t′ ∈ T ∧ t −

→ t′), the

size of slice with respect to t is:

|S(M, t)| = t′ |M|

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 24 / 34

slide-56
SLIDE 56

Metrics

Definition (Slice Size)

For a model M, t′ is a transition dependent on t (i.e., t′ ∈ T ∧ t −

→ t′), the

size of slice with respect to t is:

|S(M, t)| = 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:

Avg(M) =

  • t∈NT

|S(M, t)| |NT|

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 24 / 34

slide-57
SLIDE 57

Subjects

Models #S #T #V EXIT Description ATM 9 23 8 Yes Automated Teller Machine Cashier 12 21 10 Yes Cashier Machine CruiseControl 5 17 18 Yes Cruise Control System FuelPump 13 25 12 Yes Fuel Pump System PrinTok 11 89 5 Yes Print Token VendingMachine 7 28 7 Yes Vending Machine system INRES 8 18 8 No INRES protocol TCP 12 57 31 No TCP Standard(RFC793) TCSbin 24 65 61 No Telephony Control Protocol Lift 6 12 1 No Lift System Total 107 355 161

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 25 / 34

slide-58
SLIDE 58

Slice Size

Forward Slices Backward Slices Dependence # T Avg # T Avg DD+NTSCD DD+NTICD DD+UNTICD DD NTSCD NTICD UNTICD

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 26 / 34

slide-59
SLIDE 59

Slice Size

Forward Slices Backward Slices Dependence # T Avg # T Avg DD+NTSCD 276 87.45% DD+NTICD 220 61.99% DD+UNTICD 267 83.20% DD 161 35.67% NTSCD 205 86.10% NTICD 92 78.67% UNTICD 190 82.21%

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 26 / 34

slide-60
SLIDE 60

Slice Size

Forward Slices Backward Slices Dependence # T Avg # T Avg DD+NTSCD 276 87.45% 345 70.46% DD+NTICD 220 61.99% 278 49.48% DD+UNTICD 267 83.20% 335 66.83% DD 161 35.67% 174 33.15% NTSCD 205 86.10% 336 53.63% NTICD 92 78.67% 167 44.59% UNTICD 190 82.21% 313 51.00%

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 26 / 34

slide-61
SLIDE 61

Backward Slice size using NTICD

Average Slice Size

100% 80% 60% 40% 20% 0% TCSbin TCP Lift INRES Vending Machine PrinTok FuelPump Cruise Control Cashier ATM Data NTICD Data-NTICD

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 27 / 34

slide-62
SLIDE 62

Correlation of Slice Size

Forward Backward Model Dependence NTICD UNTICD NTSCD NTICD UNTICD NTSCD NTICD

  • 1.000

.652

  • 1.000

.941 ATM UNTICD 1.000

  • .652

1.000

  • .941

NTSCD .652 652.

  • .941

.941

  • NTICD
  • 1.000

.898

  • 1.000

1.000 Cashier UNTICD 1.000

  • .898

1.000

  • 1.000

NTSCD .898 .898

  • 1.000

1.000

  • NTICD
  • 1.000

1.000

  • 1.000

1.000 CruiseControl UNTICD 1.000

  • 1.000

1.000

  • 1.000

NTSCD 1.000 1.000

  • 1.000

1.000

  • NTICD
  • 1.000

.786

  • 1.000
  • .509

FuelPump UNTICD 1.000

  • .786

1.000

  • .509

NTSCD .786 .786

  • .509
  • .509
  • NTICD
  • 1.000

1.000

  • 1.000

1.000 PrinTok UNTICD 1.000

  • 1.000

1.000

  • 1.000

NTSCD 1.000 1.000

  • 1.000

1.000

  • NTICD
  • 1.000

.360

  • 1.000

.224 VendingMachine UNTICD 1.000

  • .360

1.000

  • .224

NTSCD .360 .360

  • .224

.224

  • NTICD
  • x

x

  • x

x INRES UNTICD x

  • 1.000

x

  • 1.000

NTSCD x 1.000

  • x

1.000

  • NTICD
  • x

x

  • x

x Lift UNTICD x

  • .813

x

  • 1.000

NTSCD x .813

  • x

1.000

  • NTICD
  • x

x

  • x

x TCP UNTICD x

  • 1.000

x

  • 1.000

NTSCD x .

  • x

1.000

  • NTICD
  • x

x

  • x

x TCSbin UNTICD x

  • 1.000

x

  • 1.000

NTSCD x 1.000

  • x

1.000

  • Slicing of EFSMs

Zheng Li CREST, KING’S COLLEGE LONDON 28 / 34

slide-63
SLIDE 63

Correlation of Slice Size

Forward Backward Model Dependence NTICD UNTICD NTSCD NTICD UNTICD NTSCD NTICD

  • 1.000

.652

  • 1.000

.941 ATM UNTICD 1.000

  • .652

1.000

  • .941

NTSCD .652 652.

  • .941

.941

  • NTICD
  • 1.000

.898

  • 1.000

1.000 Cashier UNTICD 1.000

  • .898

1.000

  • 1.000

NTSCD .898 .898

  • 1.000

1.000

  • NTICD
  • 1.000

1.000

  • 1.000

1.000 CruiseControl UNTICD 1.000

  • 1.000

1.000

  • 1.000

NTSCD 1.000 1.000

  • 1.000

1.000

  • NTICD
  • 1.000

.786

  • 1.000
  • .509

FuelPump UNTICD 1.000

  • .786

1.000

  • .509

NTSCD .786 .786

  • .509
  • .509
  • NTICD
  • 1.000

1.000

  • 1.000

1.000 PrinTok UNTICD 1.000

  • 1.000

1.000

  • 1.000

NTSCD 1.000 1.000

  • 1.000

1.000

  • NTICD
  • 1.000

.360

  • 1.000

.224 VendingMachine UNTICD 1.000

  • .360

1.000

  • .224

NTSCD .360 .360

  • .224

.224

  • NTICD
  • x

x

  • x

x INRES UNTICD x

  • 1.000

x

  • 1.000

NTSCD x 1.000

  • x

1.000

  • NTICD
  • x

x

  • x

x Lift UNTICD x

  • .813

x

  • 1.000

NTSCD x .813

  • x

1.000

  • NTICD
  • x

x

  • x

x TCP UNTICD x

  • 1.000

x

  • 1.000

NTSCD x .

  • x

1.000

  • NTICD
  • x

x

  • x

x TCSbin UNTICD x

  • 1.000

x

  • 1.000

NTSCD x 1.000

  • x

1.000

  • Slicing of EFSMs

Zheng Li CREST, KING’S COLLEGE LONDON 28 / 34

slide-64
SLIDE 64

Properties of Control Dependence

UNTICD and NTSCD dependences for all transitions within control sinks are identical. UNTICD and NTICD dependences for all transitions outside of control sinks are identical. The transitive closure for NTICD is contained in the transitive closure for UNTICD.

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 29 / 34

slide-65
SLIDE 65

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

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 30 / 34

slide-66
SLIDE 66

Properties of Control Dependence

Proposition

For an EFSM M, if two transitions Ti and Tj have the same source and target states, and Ti

CD

− → Tl (using NTSCD, NTICD or UNTICD) then Tj

CD

− → Tl (using NTSCD, NTICD or UNTICD respectively).

Ti Tj

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 31 / 34

slide-67
SLIDE 67

Properties of Control Dependence

Proposition

For an EFSM M, if all states s ∈ M where s = 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 S1 T1 S2 T2 EXIT T16 T3 T4 T5 T6 T7 S3 T8 T9 T10 T15 T11T12 T13 T14 T17

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 32 / 34

slide-68
SLIDE 68

Summary of Dependence Analysis

NTSCD, NTICD and UNTICD are defined for EFSM The properties are formally proved Empirically studies on dependence size

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 33 / 34

slide-69
SLIDE 69

Questions?

zheng.li@kcl.ac.uk http://slim.dcs.kcl.ac.uk/

Slicing of EFSMs Zheng Li CREST, KING’S COLLEGE LONDON 34 / 34