SlideShare uma empresa Scribd logo
1 de 70
Baixar para ler offline
Submodel
Pattern Extraction
for Simulink Models
James R. Cordy
Queen’s University
NECSIS Automotive Partnership Canada
MPE
near-miss clones

near-miss clone detection
Simone

analysis of GM models
pattern extraction

pattern evolution
MPE
near-miss clones

near-miss clone detection
Simone

analysis of GM models
pattern extraction

pattern evolution
Model Pattern Engineering
discover, catalogue and formalize
submodel patterns

emergent
domain-specific, client-specific
discovery

analysis, identification
methodology, techniques
classification

characterization, formalization
notation, tooling, catalogues
application

deployment, analysis
organization, documentation, use cases
why?
reuse in model development

standards/consistency analysis/enforcement
failure/change propagation in model maintenance

verification/test optimization
deployment variation/optimization

model product lines
MPE
near-miss clones

near-miss clone detection
Simone

analysis of GM models
pattern extraction

pattern evolution
code clones
copy-paste programming

efficient, widely used
problematic
code clones
type 1 - exact

bool ConfNextToken (char **p) {
// skip white space
while (1)
switch (**p) {
case 't' : // ignore
case ' ' :
(*p)++;
break;
case '0' :
return FALSE;
default :
return TRUE;
};
}

bool ConfNextToken (char **p) {
// skip white space
while (1)
switch (**p) {
case 't' : // ignore
case ' ' :
(*p)++;
break;
case '0' :
return FALSE;
default :
return TRUE;
};
}
[Roy, Cordy, Koschke SCP 2009]
code clones
type 1 - exact

bool ConfNextToken (char **p) {
// skip white space
while (1)
switch (**p) {
case 't' : // ignore
case ' ' :
(*p)++;
break;
case '0' :
return FALSE;
default :
return TRUE;
};
}

bool ConfNextToken (char **p)
{
while (1) switch (**p)
{
case 't': case ' ':
// just skip
(*p)++;
break;
case '0':
// eof
return FALSE;
default:
// something we want
return TRUE;
};
}
[Roy, Cordy, Koschke SCP 2009]
code clones
type 2 - renamed

bool ConfNextToken (char **p) {
// skip white space
while (1)
switch (**p) {
case 't' : // ignore
case ' ' :
(*p)++;
break;
case '0' :
return FALSE;
default :
return TRUE;
};
}

bool NextToken (char **bp)
{
while (1) // not really
switch (**bp)
{
case 't': case ' ':
// next
(*bp)++;
break;
case '0':
return 0;
default:
return 1;
};
}
[Roy, Cordy, Koschke SCP 2009]
code clones
type 3 - near miss

bool ConfNextToken (char **p) {
// skip white space
while (1)
switch (**p) {
case 't' : // ignore
case ' ' :
(*p)++;
break;
case '0' :
return FALSE;
default :
return TRUE;
};
}

bool NextToken (char **bp)
{
while (1) // not really
switch (**bp)
{
case 't':
(*bp)++
case ' ':
break;
case '0':
return 0;
default:
return 1;
}
}
[Roy, Cordy, Koschke SCP 2009]
1
Fn

2/3*R*muk

1
Tfmaxk

Torque
Conversion
mus/muk

2
Tfmaxs

Ratio of static
to kinetic

model clones
type 1 - exact
1
Fn

2/3*R*muk

1
Tfmaxk

Torque
Conversion
mus/muk

2
Tfmaxs

Ratio of static
to kinetic

[Alalfi, Cordy, Dean, Stephan, Stevenson ICSM 2012] [Störrle SSM 2013]
model clones
type 2 - renamed

[Alalfi, Cordy, Dean, Stephan, Stevenson ICSM 2012] [Störrle SSM 2013]
model clones
type 3 - near miss

[Alalfi, Cordy, Dean, Stephan, Stevenson ICSM 2012] [Störrle SSM 2013]
MPE
near-miss clones

near-miss clone detection
Simone

analysis of GM models
pattern extraction

pattern evolution
ConQAT
graph-based model
clone detection

[Deissenboeck et al. IWSC 2010]
graph flattening ignores
hierarchical structure

problems with
near-miss
graph flattening ignores
hierarchical structure

problems with
near-miss
code-based near-miss works well
NiCad, iClones, others

mature, accurate, efficient
handles unexpected differences

threshold-based, tunable
scalable
Parsing &
Potential Clone
Extraction

4

Original
Code Base

Original
Code Base

3

2

Parsing &
Potential Clone
Extraction
1

Pretty-printed
Potential Clones

Choose
(Repeat) Next
Potential Clone
as Exemplar

Choose Next
Potential Clone
as Exemplar

3

2

1

Normalized
Potential Clones

NiCad

Pretty-printed
Potential Clones

4

3

2

Renaming,
Filtering,
Normalization

4

1

Normalized
Potential Clones

3

2

1

Normalized
Potential Clones

1. Parse / Extract
2. Rename / Filter / Normalize
2. Rename / Filter / Normalize

1. Parse / Extract

4

Renaming,
4Filtering,
3
2
Normalization
1

Cluster
4
3
Comparable
2
1
Size PCs

(Repeat)

Pairwise
Cluster
Comparison
Comparable
with Exemplar
Size PCs

Comparable Size
Normalized
Potential Clone Cluster
Potential Clones

3. Clone Analysis

5.pc
12.pc
23.pc
17.pc
67.pc 15.pc
18.pc
. . . 22.pc 21.pc
63.pc
. . . 78.pc 37.pc
39.pc
. . . 97.pc
. . . 44.pc
...

5.pc
12.pc
23.pc
17.pc
67.pc 15.pc
18.pc
. . . 22.pc 21.pc
63.pc
. . . 78.pc 37.pc
39.pc
. . . 97.pc
. . . 44.pc
...

Pairwise
Comparison
with Exemplar

Comparable Size
Clone
Potential Clone Cluster
Classes

Clone
Classes

3. Clone Analysis

parse - extract - normalize - diff threshold
[Roy, Cordy ICPC 2008]
crazy idea:
can we use near-miss text code methods
on graphical models?

“Models are source code too”
Mark Harman, keynote at SCAM 2010

[Harman SCAM 2010]
MPE
near-miss clones

near-miss clone detection
Simone

analysis of GM models
pattern extraction

pattern evolution
Simone

Simulink near-miss clone detection
experiment

adapt NiCad near-miss code clone
detector to graphical models
validate vs. ConQAT

for types 1 & 2
hand validate type 3 (near-miss)
[Alalfi, Cordy,Dean, Stephan, Stevenson ICSM 2012]
Simulink

hybrid hardware/software models
widespread in industry
- automotive, aerospace, embedded systems

mature and interesting at GM
Simulink

hierarchical models

[Alalfi, Cordy,Dean, Stephan, Stevenson ICSM 2012]
Challenge #1
code methods
require text

NiCad requires
a parser

...!
System {!
Name
"onoff"!
Location
[168, 385, 668, 686]!
Open
on!
ModelBrowserVisibility off!
ModelBrowserWidth
200!
ScreenColor
"automatic"!
PaperOrientationi
"landscape"!
PaperPositionMode
"auto"!
PaperType
"usletter"!
PaperUnits
"inches"!
ZoomFactor
"100"!
AutoZoom
on!
ReportName
"simulink-default.rpt"!
Block {!
BlockType
DiscretePulseGenerator!
Name
"Discrete PulsenGenerator"!
Position
[45, 25, 75, 55]!
Amplitude
"1"!
Period
"2"!
PulseWidth
"1"!
PhaseDelay
"0"!
SampleTime
"1"!
}!
Block {!
BlockType
Product!
Name
"Product"!
Ports
[2, 1, 0, 0, 0]!
Position
[145, 67, 175, 98]!
Inputs
"2"!
SaturateOnIntegerOverflow on!
}!
...!
}!
...!

Solution:
grammar inference

on Simulink’s
internal form
Challenge #2
what granularity?

NiCad requires
candidates for
comparison

...!
System {!
Name
"onoff"!
Location
[168, 385, 668, 686]!
Open
on!
ModelBrowserVisibility off!
ModelBrowserWidth
200!
ScreenColor
"automatic"!
PaperOrientationi
"landscape"!
PaperPositionMode
"auto"!
PaperType
"usletter"!
PaperUnits
"inches"!
ZoomFactor
"100"!
AutoZoom
on!
ReportName
"simulink-default.rpt"!
Block {!
BlockType
DiscretePulseGenerator!
Name
"Discrete PulsenGenerator"!
Position
[45, 25, 75, 55]!
Amplitude
"1"!
Period
"2"!
PulseWidth
"1"!
PhaseDelay
"0"!
SampleTime
"1"!
}!
Block {!
BlockType
Product!
Name
"Product"!
Ports
[2, 1, 0, 0, 0]!
Position
[145, 67, 175, 98]!
Inputs
"2"!
SaturateOnIntegerOverflow on!
}!
...!
}!
...!

Simulink:
model (too big)
block (too small)
system (just right!)
powerwindow03/power_window_control_system/validate_driver

neutral

1
neutral

2
up

powerwindow03/power_window_control_system/validate_driver

action
checked_action

up

validated_up

reset

[reset]
From2

3
down

1
neutral_up_down

action
down

validated_down

reset

[reset]
From1

2
up
[reset]

3
down

checked_action

From1

[reset]
Goto1

validated_up

1
neutral_up_down

check_up
action
checked_action

down

validated_down

check_down

mutually_exclusive
4
reset

up

reset

reset

[reset]
check_down

validated_neutral

action

From2

check_up

checked_action

neutral

1
neutral

validated_neutral

mutually_exclusive
4
reset

[reset]
Goto1

even with raw text, find some subsystem clones

/Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl
printed 13 Apr 2012 14:56

/Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl

page 1/1 13 Apr 2012 14:56
printed

but:
90% irrelevant Simulink internal “formatting” systems

some identical systems only 70% same
entirely missed exact copies displayed differently

page 1/1
Challenge #3
problems with
“noise”

solution:
“agile parsing” to
filter out irrelevant
elements

...!
System {!
Name
"onoff"!
Location
[168, 385, 668, 686]!
Open
on!
ModelBrowserVisibility off!
ModelBrowserWidth
200!
ScreenColor
"automatic"!
PaperOrientationi
"landscape"!
PaperPositionMode
"auto"!
PaperType
"usletter"!
PaperUnits
"inches"!
ZoomFactor
"100"!
AutoZoom
on!
ReportName
"simulink-default.rpt"!
Block {!
BlockType
DiscretePulseGenerator!
Name
"Discrete PulsenGenerator"!
Position
[45, 25, 75, 55]!
Amplitude
"1"!
Period
"2"!
PulseWidth
"1"!
PhaseDelay
"0"!
SampleTime
"1"!
}!
Block {!
BlockType
Product!
Name
"Product"!
Ports
[2, 1, 0, 0, 0]!
Position
[145, 67, 175, 98]!
Inputs
"2"!
SaturateOnIntegerOverflow on!
}!
...!
}!
...!
[Dean, Cordy, Malton, Schneider JASE 2003]
filtering

...!
System {!
Name
Block {!
BlockType
Name
Amplitude
Period
PulseWidth
PhaseDelay
SampleTime
}!
Block {!
BlockType
Name
Ports
Inputs
}!
...!
}!
...!

removes more
than 300 kinds
of irrelevant
elements and blocks

increases
signal-to-noise
ratio in text

"onoff”!
DiscretePulseGenerator!
"Discrete PulsenGenerator”!
"1"!
"2"!
"1"!
"0"!
"1"!
Product!
"Product"!
[2, 1, 0, 0, 0]!
"2”!
filtering significantly improved performance
precision - 10x fewer false positives
hand validation of results

recall - many fewer false negatives
fewer missed clones
much larger clones

but:
some clones we could clearly see by hand
still not detected - why?
Challenge #4
no linear order of model elements
Challenge #4
solution: topological sort by block, line, port, branch
sorting
increases recall, to find many more clones
powerwindow03/power_window_control_system/validate_driver

neutral

1
neutral

2
up

powerwindow03/power_window_control_system/validate_driver

[reset]

action
checked_action

3
down

2
up
[reset]

validated_neutral

validated_up

1
neutral_up_down

check_up
action
checked_action

down

validated_down

reset

[reset]
neutral

up

reset

From2

1
neutral

validated_neutral

From1

check_down
mutually_exclusive

4
reset

action
checked_action

up

validated_up

reset

From2

[reset]
Goto1

1
neutral_up_down

check_up
/Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl

3
down

action
checked_action

down

printed 13 Apr 2012 14:56

validated_down

reset

[reset]
From1

check_down
mutually_exclusive

4
reset

[reset]
Goto1

/Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl
printed 13 Apr 2012 14:56

page 1/1

page 1/1
sorting
increases recall, to find many more clones
powerwindow03/power_window_control_system/validate_driver

neutral

1
neutral

2
up

powerwindow03/power_window_control_system/validate_driver

[reset]

3
down

action

validated_neutral

up

checked_action

From2

action
down

checked_action

From1

mutually_exclusive

[reset]

up

checked_action

validated_up

reset

From2

down

checked_action

From1

printed 13 Apr 2012 14:56

validated_down

check_down

neutral

1
neutral

validated_down

/Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl

check_down

mutually_exclusive
printed 13 Apr 2012 14:56

page 1/1

mutually_exclusive
4
reset

down

checked_action

From1

action
reset

[reset]

Goto1

reset

[reset]

check_up
/Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl

3
down

[reset]

4
reset

check_up

[reset]

4
reset

page 1/1
powerwindow03/power_window_control_system/validate_driver

Goto1

validated_neutral

[reset]
powerwindow03/power_window_control_system/validate_driver

Goto1

powerwindow03/power_window_control_system/validate_driver
checked_action

From2

page 1/1
neutral

1
neutral

1
printed 13 Apr 2012 14:56
neutral_up_down

validated_up

page 1/1

checked_action

neutral

1
validated_down

down

validated_neutral

2
up

neutral

reset

check_down

checked_action

up

validated_up

reset

From2

[reset]

4
reset

1
neutral_up_down

Goto1

checked_action

From1

down

validated_down

check_down

down

page 1/1

Goto1
action

page 1/1
action
down

checked_action

validated_neutral

2
up
[reset]

check_down

checked_action

From2
2
up

3
down

checked_action

up

validated_up

reset

1
neutral_up_down

check_up

validated_up

[reset]

4
reset

1
neutral_up_down

From1

down

2
up
checked_action

down

validated_down

reset

neutral

1
neutral

validated_neutral

printed 13 Apr

check_down

[reset]
Goto1

[reset]

3
/Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl down
[reset]
printed 13 Apr 2012 14:56
From1

3
down

action

2
up

checked_action

up

validated_up

reset

[reset]
From2

Goto1

action
checked_action

up

validated_up

reset
/Users/manaralalfi/Desktop/NiCad [reset]
3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl
From2
check_up
2012 14:56

1
neutral_up_down

page 1/1

check_down

validated_down

4
reset

validated_neutral

check_up

mutually_exclusive
checked_action

neutral

1
neutral

Goto1

action

action

mutually_exclusive
4
reset

3
down
[reset]

reset

From1

up

action

From2

[reset]

mutually_exclusive

action
reset

validated_down

reset

[reset]
powerwindow03/power_window_control_system/validate_driver

neutral

page 1/1

1
neutral_up_down

powerwindow03/power_window_control_system/validate_driver
check_up

3
down

validated_neutral

printed 13 Apr 2012 14:56
up
validated_up

checked_action
reset

From1
1
neutral

Goto1

validated_neutral

/Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl

printed 13 Apr 2012 14:56
neutral

[reset]

4
reset
neutral

1
neutral

From2
/Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl

1
neutral

validated_down

check_down

validated_down

page 1/1

2
up

printed 13 Apr 2012 14:56

down

checked_action
reset

mutually_exclusive

[reset]
powerwindow03/power_window_control_system/validate_driver
/Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl

action

[reset]

4
reset

powerwindow03/power_window_control_system/validate_driver

3
down
From1

mutually_exclusive

[reset]
Goto1

1
neutral_up_down
powerwindow03/power_window_control_system/validate_driver

[reset]

mutually_exclusive
4
reset

validated_up

check_up

action
3
down
/Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl
checked_action
reset
[reset]
printed 13 Apr 2012 14:56
From1
check_down

reset

[reset]

up

checked_action
reset

[reset]
From2

action

3
down

1
neutral_up_down

validated_up

check_up

action

2
up

check_up

up

checked_action

From2

mutually_exclusive
action

action
reset

[reset]

From1

[reset]

validated_neutral

action

[reset]

2
up

neutral

1
neutral

check_up

3
down

validated_neutral

up

reset

/Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl
printed 13 Apr 2012 14:56

/Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl

action

2
up
[reset]

[reset]

validated_down

mutually_exclusive

action

3
down

powerwindow03/power_window_control_system/validate_driver

check_down
1
neutral_up_down

validated_up

reset

Goto1

1
neutral_up_down

up

down

checked_action
reset

From1
checked_action

From2

[reset]

4
reset

action

action

3
down
[reset]
action

2
up

1
neutral_up_down

validated_up

check_up

validated_neutral

validated_down

check_down

[reset]

2
up

neutral

1
neutral

up

checked_action
reset

[reset]

check_up

validated_neutral

action

2
up

1
neutral_up_down

validated_up

reset

neutral

1
neutral

reset

[reset]
neutral

validated_neutral

powerwindow03/power_window_control_system/validate_driver

From2

1
neutral

powerwindow03/power_window_control_system/validate_driver

1
neutral_up_down

action
checked_action

From1

validated_down

check_down
mutually_exclusive

check_up
4
reset

action
checked_action

down

reset

[reset]

down

validated_down

[reset]
Goto1

reset

page 1/1
check_down
mutually_exclusive

/Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl
printed 13 Apr 2012 14:56

/Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl
page 1/1

4
reset

[reset]
printed 13 Apr 2012 14:56

Goto1

/Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl
printed 13 Apr 2012 14:56

page 1/1

page 1/1
Challenge #5
finding type 2
(renamed) requires
anonymization

...!
System {!
Name
Block {!
BlockType
Name
Amplitude
Period
PulseWidth
PhaseDelay
SampleTime
}!
Block {!
BlockType
Name
Ports
Inputs
}!
...!
}!
...!

names in Simulink
not like other
languages

solution:
context-dependent
anonymizer

"onoff”!
DiscretePulseGenerator!
"Discrete PulsenGenerator”!
"1"!
"2"!
"1"!
"0"!
"1"!
Product!
"Product"!
[2, 1, 0, 0, 0]!
"2”!
validation - Simone vs. ConQAT
on Matlab Central public model systems

finds all type1(exact) and type 2 (renamed)
clones found by ConQAT

finds many new type 3 (near-miss)
clones not found by ConQAT

finds larger clones and larger clone classes
[Alalfi, Cordy,Dean, Stephan, Stevenson ICSM 2012]
Simone vs. ConQAT
Simone near-miss clones
in Simulink public automotive model variants
Total nontrivial
subsystems
357

Extractor only

Filtered

Filtered & Sorted

Filtered, Sorted &
Renamed

Clone Type

Type 1

Type 3-1
@30%

Type 1

Type 3-1
@30%

Type 1

Type 3-1
@30%

Type 2

Type 3-2
@30%

Clone Pairs

116 / 10*

364 / 164*

204

204

303

181

279

1938

Clone Classes

8 / 4*

57 / 56*

44

55

45

52

48

24

Clone Coverage

8% / 3%

52% / 46%

37%

48%

42%

45%

49%

75%

[Alalfi, Cordy,Dean, Stephan, Stevenson ICSM 2012]
Simone near-miss pattern mining
in Simulink models
!"#$%&%'()(*+&$%'(

,+-.".$%-$(/%-01"-2(

3#"-'(/%-01"-2(

*4.$%1.(
56$&07$%'(

,#+-%.(

,#0..%.(

,#+-%.(

,#0..%.(

,#+-%.(

,#0..%.(

!"#$"%&'()#*"$&

+,-&

,,.&

,+&

,/+&

,.&

-0,&

,1&

2345$3)6&7(48&

1/9:&

;0-&

.,&

,11&

.,&

1.;0&

--&

'8)<"#&=>"4?$(@&

--0&

1+.&

-0&

;;;&

-0&

-,.&

-,&

89('+$)::(

099&

;11&

;.&

;90&

;0&

/::&

;:&

89('+$):;(

099&

;11&

;/&

;.-&

;.&

/1.&

;1&

89('+$):<(

0./&

;1;&

;+&

;.-&

;/&

/;-&

;,&

89('+$):=(

1:01&

;/-&

,+&

,9;&

-1&

11-9&

,:&
MPE
near-miss clones

near-miss clone detection
Simone

analysis of GM models
pattern extraction

pattern evolution
Case study
GM fuel system models

SimGraph visualization
understanding Simulink model subsystem
similarity
GM Fuel System Models
Subsystem similarity overview
X models
(blue)

Small
subsystems

Y models
(green)

Large
subsystems
Z models
(red)

Midsize
subsystems
GM Fuel System Models
Subsystem similarity overview

Many subsystems unique not similar to any others in
these models
GM Fuel System Models
Remove unique subsystems

Similar subsystems
“near-miss clones”
both within and
between models

Connecting lines represent subsystem similarity thick lines, 90-100% similar
thin lines, 70-80% similar
GM Fuel System Models
Rearrange to cluster similar subsystems

Clusters reveal groups of
similar subsystems “clone classes”
GM Fuel System Models
Infer common subsystem patterns

Patterns characterize
common repeated similar
subsystem paradigms

Small groups of
relatively large
similar subsystems
both within and
across models

Large groups of small
to mid-sized similar
subsystems across
models
MPE
near-miss clones

near-miss clone detection
Simone

analysis of GM models
pattern extraction

pattern evolution
using patterns
SimNav
exemplar sets as patterns

SimPat
modeling variance
SimNav
presenting and integrating results in Simulink

exemplar sets as patterns
SimNav

&'()*'+,

&'(-/@
!"#$"%

&=!>-?
-'./0

&'()*'+,78*9+170131839:7
;(901*6<
#12345/61078*9+170131839:7
;69):8178901<
SimPat
characterizing and representing subsystem
patterns

modeling variance
SimPat
!901*7.*9+17.*/66A7
B76)56C631(78*9+16

!901*7D/E1:+6

!901*7D/E1:+7FA

!1:G17#H:9E*177/+07
D:166):17?6I(/I9+
!901*7.*9+17.*/66A7
B76)56C631(78*9+16

!901*7D/E1:+6

!901*7D/E1:+7JA
777!1:G17/**73H:117
77777776)56C631(6
7
!901*7.*9+17.*/66A7
B76)56C631(78*9+16

!901*7D/E1:+6

!901*7D/E1:+7BA

.9((9+71*1(1+36
77777777777779+*C
%&$

near-miss clones

&($

%"$

MPE

&'$

&'$

!"#$

&($

&)$

&*$

%!$

&'$

!"#$

&($

&)$

&*$

near-miss clone detection
Simone

analysis of GM models
pattern extraction

pattern evolution

&)$

&*$
model pattern evolution
SimCCT

evolution of patterns
across versions

pattern variance in two dimensions
instance, time

[Stephan, Alalfi, Cordy, Stevenson ME 2013]
model pattern
MCC - model clone class

elements of a model pattern
MCI - model clone instance

evolution of patterns
migration of MCIs between MCCs across
versions of the system
evolution of patterns
1-1

pattern is stable across versions

1-1*

pattern exists, but loses or gains MCIs

1-many

pattern splits into multiple patterns

1-many*

pattern splits, losing or gaining MCIs

1-0

pattern unifies or disappears
SimCCT
SimCCT - Power Window MCC 3
*'"

!"

#"

*)"

!"

$"

%"

&"

'("

'!"

'#"

*+"

!"

$"

%"

&"

'("

'!"

'#"

*,"-"*!"

)("

./01"2/3"405/26"3/"728"9::"
45"$6%78,
-!,9,

!"#"$#%&'()#*+,
-!,.,

!"#"$#%/0)#1$2",
-!,3,
SimCCT - Power Window MCC 2
!"#

$#

%#

&#

!$#

%#

&#

!%#

%#

&#

!&#

%#

&#

!'# ()*+#,)-#.*/),0#-)#1,2#344#
SimCCT - AVS MCC 7
%&$

&'$

&($

%"$

&'$

!"#$

&($

&)$

&*$

%!$

&'$

!"#$

&($

&)$

&*$

&)$

&*$
MPE
near-miss clones

near-miss clone detection
Simone

analysis of GM models
pattern extraction

pattern evolution
current work
Stateflow models

deployment at GM
analysis of more systems
Thank you!
Joseph d’Ambrosio
Cheryl Williams

Manar H. Alalfi
Thomas R. Dean
Matthew Stephan
Andrew Stevenson
Submodel
Pattern Extraction
for Simulink Models
James R. Cordy
Queen’s University
NECSIS Automotive Partnership Canada

Mais conteúdo relacionado

Semelhante a 131010 jim cordy - submodel pattern extraction for simulink models

Jogging While Driving, and Other Software Engineering Research Problems (invi...
Jogging While Driving, and Other Software Engineering Research Problems (invi...Jogging While Driving, and Other Software Engineering Research Problems (invi...
Jogging While Driving, and Other Software Engineering Research Problems (invi...David Rosenblum
 
"Test Design Techniques"
"Test Design Techniques" "Test Design Techniques"
"Test Design Techniques" HYS Enterprise
 
SiriusCon 2015 - Breathe Life into Your Designer!
SiriusCon 2015 - Breathe Life into Your Designer!SiriusCon 2015 - Breathe Life into Your Designer!
SiriusCon 2015 - Breathe Life into Your Designer!melbats
 
20080501 software verification_sharygina_lecture01
20080501 software verification_sharygina_lecture0120080501 software verification_sharygina_lecture01
20080501 software verification_sharygina_lecture01Computer Science Club
 
Analyzing the Dolphin-emu project
Analyzing the Dolphin-emu projectAnalyzing the Dolphin-emu project
Analyzing the Dolphin-emu projectPVS-Studio
 
COSMOS-ASME-IDETC-2014
COSMOS-ASME-IDETC-2014COSMOS-ASME-IDETC-2014
COSMOS-ASME-IDETC-2014OptiModel
 
Judge: Identifying, Understanding, and Evaluating Sources of Unsoundness in C...
Judge: Identifying, Understanding, and Evaluating Sources of Unsoundness in C...Judge: Identifying, Understanding, and Evaluating Sources of Unsoundness in C...
Judge: Identifying, Understanding, and Evaluating Sources of Unsoundness in C...Michael Reif
 
designpatterns_blair_upe.ppt
designpatterns_blair_upe.pptdesignpatterns_blair_upe.ppt
designpatterns_blair_upe.pptbanti43
 
Generatingcharacterizationtestsforlegacycode
GeneratingcharacterizationtestsforlegacycodeGeneratingcharacterizationtestsforlegacycode
GeneratingcharacterizationtestsforlegacycodeCarl Schrammel
 
Close encounters in MDD: when Models meet Code
Close encounters in MDD: when Models meet CodeClose encounters in MDD: when Models meet Code
Close encounters in MDD: when Models meet Codelbergmans
 
Close Encounters in MDD: when models meet code
Close Encounters in MDD: when models meet codeClose Encounters in MDD: when models meet code
Close Encounters in MDD: when models meet codelbergmans
 
Doubt Truth to be a Liar: Non Triviality of Type Safety for Machine Learning ...
Doubt Truth to be a Liar: Non Triviality of Type Safety for Machine Learning ...Doubt Truth to be a Liar: Non Triviality of Type Safety for Machine Learning ...
Doubt Truth to be a Liar: Non Triviality of Type Safety for Machine Learning ...Matthew Tovbin
 
Polymer Brush Data Processor
Polymer Brush Data ProcessorPolymer Brush Data Processor
Polymer Brush Data ProcessorCory Bethrant
 
Bioinfo ngs data format visualization v2
Bioinfo ngs data format visualization v2Bioinfo ngs data format visualization v2
Bioinfo ngs data format visualization v2Li Shen
 
Reverse-Engineering Reusable Language Modules from Legacy DSLs
Reverse-Engineering Reusable Language Modules from Legacy DSLsReverse-Engineering Reusable Language Modules from Legacy DSLs
Reverse-Engineering Reusable Language Modules from Legacy DSLsDavid Méndez-Acuña
 
Reproducible Emulation of Analog Behavioral Models
Reproducible Emulation of Analog Behavioral ModelsReproducible Emulation of Analog Behavioral Models
Reproducible Emulation of Analog Behavioral Modelsfnothaft
 
Declarative Multilingual Information Extraction with SystemT
Declarative Multilingual Information Extraction with SystemTDeclarative Multilingual Information Extraction with SystemT
Declarative Multilingual Information Extraction with SystemTLaura Chiticariu
 
Optimising code using Span<T>
Optimising code using Span<T>Optimising code using Span<T>
Optimising code using Span<T>Mirco Vanini
 
Valerii Vasylkov Erlang. measurements and benefits.
Valerii Vasylkov Erlang. measurements and benefits.Valerii Vasylkov Erlang. measurements and benefits.
Valerii Vasylkov Erlang. measurements and benefits.Аліна Шепшелей
 

Semelhante a 131010 jim cordy - submodel pattern extraction for simulink models (20)

Jogging While Driving, and Other Software Engineering Research Problems (invi...
Jogging While Driving, and Other Software Engineering Research Problems (invi...Jogging While Driving, and Other Software Engineering Research Problems (invi...
Jogging While Driving, and Other Software Engineering Research Problems (invi...
 
"Test Design Techniques"
"Test Design Techniques" "Test Design Techniques"
"Test Design Techniques"
 
SiriusCon 2015 - Breathe Life into Your Designer!
SiriusCon 2015 - Breathe Life into Your Designer!SiriusCon 2015 - Breathe Life into Your Designer!
SiriusCon 2015 - Breathe Life into Your Designer!
 
20080501 software verification_sharygina_lecture01
20080501 software verification_sharygina_lecture0120080501 software verification_sharygina_lecture01
20080501 software verification_sharygina_lecture01
 
Analyzing the Dolphin-emu project
Analyzing the Dolphin-emu projectAnalyzing the Dolphin-emu project
Analyzing the Dolphin-emu project
 
COSMOS-ASME-IDETC-2014
COSMOS-ASME-IDETC-2014COSMOS-ASME-IDETC-2014
COSMOS-ASME-IDETC-2014
 
Judge: Identifying, Understanding, and Evaluating Sources of Unsoundness in C...
Judge: Identifying, Understanding, and Evaluating Sources of Unsoundness in C...Judge: Identifying, Understanding, and Evaluating Sources of Unsoundness in C...
Judge: Identifying, Understanding, and Evaluating Sources of Unsoundness in C...
 
designpatterns_blair_upe.ppt
designpatterns_blair_upe.pptdesignpatterns_blair_upe.ppt
designpatterns_blair_upe.ppt
 
Generatingcharacterizationtestsforlegacycode
GeneratingcharacterizationtestsforlegacycodeGeneratingcharacterizationtestsforlegacycode
Generatingcharacterizationtestsforlegacycode
 
Close encounters in MDD: when Models meet Code
Close encounters in MDD: when Models meet CodeClose encounters in MDD: when Models meet Code
Close encounters in MDD: when Models meet Code
 
Close Encounters in MDD: when models meet code
Close Encounters in MDD: when models meet codeClose Encounters in MDD: when models meet code
Close Encounters in MDD: when models meet code
 
Doubt Truth to be a Liar: Non Triviality of Type Safety for Machine Learning ...
Doubt Truth to be a Liar: Non Triviality of Type Safety for Machine Learning ...Doubt Truth to be a Liar: Non Triviality of Type Safety for Machine Learning ...
Doubt Truth to be a Liar: Non Triviality of Type Safety for Machine Learning ...
 
Polymer Brush Data Processor
Polymer Brush Data ProcessorPolymer Brush Data Processor
Polymer Brush Data Processor
 
Bioinfo ngs data format visualization v2
Bioinfo ngs data format visualization v2Bioinfo ngs data format visualization v2
Bioinfo ngs data format visualization v2
 
Reverse-Engineering Reusable Language Modules from Legacy DSLs
Reverse-Engineering Reusable Language Modules from Legacy DSLsReverse-Engineering Reusable Language Modules from Legacy DSLs
Reverse-Engineering Reusable Language Modules from Legacy DSLs
 
Reproducible Emulation of Analog Behavioral Models
Reproducible Emulation of Analog Behavioral ModelsReproducible Emulation of Analog Behavioral Models
Reproducible Emulation of Analog Behavioral Models
 
Serial-War
Serial-WarSerial-War
Serial-War
 
Declarative Multilingual Information Extraction with SystemT
Declarative Multilingual Information Extraction with SystemTDeclarative Multilingual Information Extraction with SystemT
Declarative Multilingual Information Extraction with SystemT
 
Optimising code using Span<T>
Optimising code using Span<T>Optimising code using Span<T>
Optimising code using Span<T>
 
Valerii Vasylkov Erlang. measurements and benefits.
Valerii Vasylkov Erlang. measurements and benefits.Valerii Vasylkov Erlang. measurements and benefits.
Valerii Vasylkov Erlang. measurements and benefits.
 

Mais de Ptidej Team

From IoT to Software Miniaturisation
From IoT to Software MiniaturisationFrom IoT to Software Miniaturisation
From IoT to Software MiniaturisationPtidej Team
 
Presentation by Lionel Briand
Presentation by Lionel BriandPresentation by Lionel Briand
Presentation by Lionel BriandPtidej Team
 
Manel Abdellatif
Manel AbdellatifManel Abdellatif
Manel AbdellatifPtidej Team
 
Azadeh Kermansaravi
Azadeh KermansaraviAzadeh Kermansaravi
Azadeh KermansaraviPtidej Team
 
CSED - Manel Grichi
CSED - Manel GrichiCSED - Manel Grichi
CSED - Manel GrichiPtidej Team
 
Cristiano Politowski
Cristiano PolitowskiCristiano Politowski
Cristiano PolitowskiPtidej Team
 
Will io t trigger the next software crisis
Will io t trigger the next software crisisWill io t trigger the next software crisis
Will io t trigger the next software crisisPtidej Team
 
Thesis+of+laleh+eshkevari.ppt
Thesis+of+laleh+eshkevari.pptThesis+of+laleh+eshkevari.ppt
Thesis+of+laleh+eshkevari.pptPtidej Team
 
Thesis+of+nesrine+abdelkafi.ppt
Thesis+of+nesrine+abdelkafi.pptThesis+of+nesrine+abdelkafi.ppt
Thesis+of+nesrine+abdelkafi.pptPtidej Team
 

Mais de Ptidej Team (20)

From IoT to Software Miniaturisation
From IoT to Software MiniaturisationFrom IoT to Software Miniaturisation
From IoT to Software Miniaturisation
 
Presentation
PresentationPresentation
Presentation
 
Presentation
PresentationPresentation
Presentation
 
Presentation
PresentationPresentation
Presentation
 
Presentation by Lionel Briand
Presentation by Lionel BriandPresentation by Lionel Briand
Presentation by Lionel Briand
 
Manel Abdellatif
Manel AbdellatifManel Abdellatif
Manel Abdellatif
 
Azadeh Kermansaravi
Azadeh KermansaraviAzadeh Kermansaravi
Azadeh Kermansaravi
 
Mouna Abidi
Mouna AbidiMouna Abidi
Mouna Abidi
 
CSED - Manel Grichi
CSED - Manel GrichiCSED - Manel Grichi
CSED - Manel Grichi
 
Cristiano Politowski
Cristiano PolitowskiCristiano Politowski
Cristiano Politowski
 
Will io t trigger the next software crisis
Will io t trigger the next software crisisWill io t trigger the next software crisis
Will io t trigger the next software crisis
 
MIPA
MIPAMIPA
MIPA
 
Thesis+of+laleh+eshkevari.ppt
Thesis+of+laleh+eshkevari.pptThesis+of+laleh+eshkevari.ppt
Thesis+of+laleh+eshkevari.ppt
 
Thesis+of+nesrine+abdelkafi.ppt
Thesis+of+nesrine+abdelkafi.pptThesis+of+nesrine+abdelkafi.ppt
Thesis+of+nesrine+abdelkafi.ppt
 
Medicine15.ppt
Medicine15.pptMedicine15.ppt
Medicine15.ppt
 
Qrs17b.ppt
Qrs17b.pptQrs17b.ppt
Qrs17b.ppt
 
Icpc11c.ppt
Icpc11c.pptIcpc11c.ppt
Icpc11c.ppt
 
Icsme16.ppt
Icsme16.pptIcsme16.ppt
Icsme16.ppt
 
Msr17a.ppt
Msr17a.pptMsr17a.ppt
Msr17a.ppt
 
Icsoc15.ppt
Icsoc15.pptIcsoc15.ppt
Icsoc15.ppt
 

Último

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 

Último (20)

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

131010 jim cordy - submodel pattern extraction for simulink models

  • 1. Submodel Pattern Extraction for Simulink Models James R. Cordy Queen’s University NECSIS Automotive Partnership Canada
  • 2. MPE near-miss clones near-miss clone detection Simone analysis of GM models pattern extraction pattern evolution
  • 3. MPE near-miss clones near-miss clone detection Simone analysis of GM models pattern extraction pattern evolution
  • 4. Model Pattern Engineering discover, catalogue and formalize submodel patterns emergent domain-specific, client-specific
  • 5. discovery analysis, identification methodology, techniques classification characterization, formalization notation, tooling, catalogues application deployment, analysis organization, documentation, use cases
  • 6. why? reuse in model development standards/consistency analysis/enforcement failure/change propagation in model maintenance verification/test optimization deployment variation/optimization model product lines
  • 7. MPE near-miss clones near-miss clone detection Simone analysis of GM models pattern extraction pattern evolution
  • 9. code clones type 1 - exact bool ConfNextToken (char **p) { // skip white space while (1) switch (**p) { case 't' : // ignore case ' ' : (*p)++; break; case '0' : return FALSE; default : return TRUE; }; } bool ConfNextToken (char **p) { // skip white space while (1) switch (**p) { case 't' : // ignore case ' ' : (*p)++; break; case '0' : return FALSE; default : return TRUE; }; } [Roy, Cordy, Koschke SCP 2009]
  • 10. code clones type 1 - exact bool ConfNextToken (char **p) { // skip white space while (1) switch (**p) { case 't' : // ignore case ' ' : (*p)++; break; case '0' : return FALSE; default : return TRUE; }; } bool ConfNextToken (char **p) { while (1) switch (**p) { case 't': case ' ': // just skip (*p)++; break; case '0': // eof return FALSE; default: // something we want return TRUE; }; } [Roy, Cordy, Koschke SCP 2009]
  • 11. code clones type 2 - renamed bool ConfNextToken (char **p) { // skip white space while (1) switch (**p) { case 't' : // ignore case ' ' : (*p)++; break; case '0' : return FALSE; default : return TRUE; }; } bool NextToken (char **bp) { while (1) // not really switch (**bp) { case 't': case ' ': // next (*bp)++; break; case '0': return 0; default: return 1; }; } [Roy, Cordy, Koschke SCP 2009]
  • 12. code clones type 3 - near miss bool ConfNextToken (char **p) { // skip white space while (1) switch (**p) { case 't' : // ignore case ' ' : (*p)++; break; case '0' : return FALSE; default : return TRUE; }; } bool NextToken (char **bp) { while (1) // not really switch (**bp) { case 't': (*bp)++ case ' ': break; case '0': return 0; default: return 1; } } [Roy, Cordy, Koschke SCP 2009]
  • 13. 1 Fn 2/3*R*muk 1 Tfmaxk Torque Conversion mus/muk 2 Tfmaxs Ratio of static to kinetic model clones type 1 - exact 1 Fn 2/3*R*muk 1 Tfmaxk Torque Conversion mus/muk 2 Tfmaxs Ratio of static to kinetic [Alalfi, Cordy, Dean, Stephan, Stevenson ICSM 2012] [Störrle SSM 2013]
  • 14. model clones type 2 - renamed [Alalfi, Cordy, Dean, Stephan, Stevenson ICSM 2012] [Störrle SSM 2013]
  • 15. model clones type 3 - near miss [Alalfi, Cordy, Dean, Stephan, Stevenson ICSM 2012] [Störrle SSM 2013]
  • 16. MPE near-miss clones near-miss clone detection Simone analysis of GM models pattern extraction pattern evolution
  • 18. graph flattening ignores hierarchical structure problems with near-miss
  • 19. graph flattening ignores hierarchical structure problems with near-miss
  • 20. code-based near-miss works well NiCad, iClones, others mature, accurate, efficient handles unexpected differences threshold-based, tunable scalable
  • 21. Parsing & Potential Clone Extraction 4 Original Code Base Original Code Base 3 2 Parsing & Potential Clone Extraction 1 Pretty-printed Potential Clones Choose (Repeat) Next Potential Clone as Exemplar Choose Next Potential Clone as Exemplar 3 2 1 Normalized Potential Clones NiCad Pretty-printed Potential Clones 4 3 2 Renaming, Filtering, Normalization 4 1 Normalized Potential Clones 3 2 1 Normalized Potential Clones 1. Parse / Extract 2. Rename / Filter / Normalize 2. Rename / Filter / Normalize 1. Parse / Extract 4 Renaming, 4Filtering, 3 2 Normalization 1 Cluster 4 3 Comparable 2 1 Size PCs (Repeat) Pairwise Cluster Comparison Comparable with Exemplar Size PCs Comparable Size Normalized Potential Clone Cluster Potential Clones 3. Clone Analysis 5.pc 12.pc 23.pc 17.pc 67.pc 15.pc 18.pc . . . 22.pc 21.pc 63.pc . . . 78.pc 37.pc 39.pc . . . 97.pc . . . 44.pc ... 5.pc 12.pc 23.pc 17.pc 67.pc 15.pc 18.pc . . . 22.pc 21.pc 63.pc . . . 78.pc 37.pc 39.pc . . . 97.pc . . . 44.pc ... Pairwise Comparison with Exemplar Comparable Size Clone Potential Clone Cluster Classes Clone Classes 3. Clone Analysis parse - extract - normalize - diff threshold [Roy, Cordy ICPC 2008]
  • 22. crazy idea: can we use near-miss text code methods on graphical models? “Models are source code too” Mark Harman, keynote at SCAM 2010 [Harman SCAM 2010]
  • 23. MPE near-miss clones near-miss clone detection Simone analysis of GM models pattern extraction pattern evolution
  • 24. Simone Simulink near-miss clone detection experiment adapt NiCad near-miss code clone detector to graphical models validate vs. ConQAT for types 1 & 2 hand validate type 3 (near-miss) [Alalfi, Cordy,Dean, Stephan, Stevenson ICSM 2012]
  • 25. Simulink hybrid hardware/software models widespread in industry - automotive, aerospace, embedded systems mature and interesting at GM
  • 26. Simulink hierarchical models [Alalfi, Cordy,Dean, Stephan, Stevenson ICSM 2012]
  • 27. Challenge #1 code methods require text NiCad requires a parser ...! System {! Name "onoff"! Location [168, 385, 668, 686]! Open on! ModelBrowserVisibility off! ModelBrowserWidth 200! ScreenColor "automatic"! PaperOrientationi "landscape"! PaperPositionMode "auto"! PaperType "usletter"! PaperUnits "inches"! ZoomFactor "100"! AutoZoom on! ReportName "simulink-default.rpt"! Block {! BlockType DiscretePulseGenerator! Name "Discrete PulsenGenerator"! Position [45, 25, 75, 55]! Amplitude "1"! Period "2"! PulseWidth "1"! PhaseDelay "0"! SampleTime "1"! }! Block {! BlockType Product! Name "Product"! Ports [2, 1, 0, 0, 0]! Position [145, 67, 175, 98]! Inputs "2"! SaturateOnIntegerOverflow on! }! ...! }! ...! Solution: grammar inference on Simulink’s internal form
  • 28. Challenge #2 what granularity? NiCad requires candidates for comparison ...! System {! Name "onoff"! Location [168, 385, 668, 686]! Open on! ModelBrowserVisibility off! ModelBrowserWidth 200! ScreenColor "automatic"! PaperOrientationi "landscape"! PaperPositionMode "auto"! PaperType "usletter"! PaperUnits "inches"! ZoomFactor "100"! AutoZoom on! ReportName "simulink-default.rpt"! Block {! BlockType DiscretePulseGenerator! Name "Discrete PulsenGenerator"! Position [45, 25, 75, 55]! Amplitude "1"! Period "2"! PulseWidth "1"! PhaseDelay "0"! SampleTime "1"! }! Block {! BlockType Product! Name "Product"! Ports [2, 1, 0, 0, 0]! Position [145, 67, 175, 98]! Inputs "2"! SaturateOnIntegerOverflow on! }! ...! }! ...! Simulink: model (too big) block (too small) system (just right!)
  • 29. powerwindow03/power_window_control_system/validate_driver neutral 1 neutral 2 up powerwindow03/power_window_control_system/validate_driver action checked_action up validated_up reset [reset] From2 3 down 1 neutral_up_down action down validated_down reset [reset] From1 2 up [reset] 3 down checked_action From1 [reset] Goto1 validated_up 1 neutral_up_down check_up action checked_action down validated_down check_down mutually_exclusive 4 reset up reset reset [reset] check_down validated_neutral action From2 check_up checked_action neutral 1 neutral validated_neutral mutually_exclusive 4 reset [reset] Goto1 even with raw text, find some subsystem clones /Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl printed 13 Apr 2012 14:56 /Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl page 1/1 13 Apr 2012 14:56 printed but: 90% irrelevant Simulink internal “formatting” systems some identical systems only 70% same entirely missed exact copies displayed differently page 1/1
  • 30. Challenge #3 problems with “noise” solution: “agile parsing” to filter out irrelevant elements ...! System {! Name "onoff"! Location [168, 385, 668, 686]! Open on! ModelBrowserVisibility off! ModelBrowserWidth 200! ScreenColor "automatic"! PaperOrientationi "landscape"! PaperPositionMode "auto"! PaperType "usletter"! PaperUnits "inches"! ZoomFactor "100"! AutoZoom on! ReportName "simulink-default.rpt"! Block {! BlockType DiscretePulseGenerator! Name "Discrete PulsenGenerator"! Position [45, 25, 75, 55]! Amplitude "1"! Period "2"! PulseWidth "1"! PhaseDelay "0"! SampleTime "1"! }! Block {! BlockType Product! Name "Product"! Ports [2, 1, 0, 0, 0]! Position [145, 67, 175, 98]! Inputs "2"! SaturateOnIntegerOverflow on! }! ...! }! ...! [Dean, Cordy, Malton, Schneider JASE 2003]
  • 31. filtering ...! System {! Name Block {! BlockType Name Amplitude Period PulseWidth PhaseDelay SampleTime }! Block {! BlockType Name Ports Inputs }! ...! }! ...! removes more than 300 kinds of irrelevant elements and blocks increases signal-to-noise ratio in text "onoff”! DiscretePulseGenerator! "Discrete PulsenGenerator”! "1"! "2"! "1"! "0"! "1"! Product! "Product"! [2, 1, 0, 0, 0]! "2”!
  • 32. filtering significantly improved performance precision - 10x fewer false positives hand validation of results recall - many fewer false negatives fewer missed clones much larger clones but: some clones we could clearly see by hand still not detected - why?
  • 33. Challenge #4 no linear order of model elements
  • 34. Challenge #4 solution: topological sort by block, line, port, branch
  • 35. sorting increases recall, to find many more clones powerwindow03/power_window_control_system/validate_driver neutral 1 neutral 2 up powerwindow03/power_window_control_system/validate_driver [reset] action checked_action 3 down 2 up [reset] validated_neutral validated_up 1 neutral_up_down check_up action checked_action down validated_down reset [reset] neutral up reset From2 1 neutral validated_neutral From1 check_down mutually_exclusive 4 reset action checked_action up validated_up reset From2 [reset] Goto1 1 neutral_up_down check_up /Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl 3 down action checked_action down printed 13 Apr 2012 14:56 validated_down reset [reset] From1 check_down mutually_exclusive 4 reset [reset] Goto1 /Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl printed 13 Apr 2012 14:56 page 1/1 page 1/1
  • 36. sorting increases recall, to find many more clones powerwindow03/power_window_control_system/validate_driver neutral 1 neutral 2 up powerwindow03/power_window_control_system/validate_driver [reset] 3 down action validated_neutral up checked_action From2 action down checked_action From1 mutually_exclusive [reset] up checked_action validated_up reset From2 down checked_action From1 printed 13 Apr 2012 14:56 validated_down check_down neutral 1 neutral validated_down /Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl check_down mutually_exclusive printed 13 Apr 2012 14:56 page 1/1 mutually_exclusive 4 reset down checked_action From1 action reset [reset] Goto1 reset [reset] check_up /Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl 3 down [reset] 4 reset check_up [reset] 4 reset page 1/1 powerwindow03/power_window_control_system/validate_driver Goto1 validated_neutral [reset] powerwindow03/power_window_control_system/validate_driver Goto1 powerwindow03/power_window_control_system/validate_driver checked_action From2 page 1/1 neutral 1 neutral 1 printed 13 Apr 2012 14:56 neutral_up_down validated_up page 1/1 checked_action neutral 1 validated_down down validated_neutral 2 up neutral reset check_down checked_action up validated_up reset From2 [reset] 4 reset 1 neutral_up_down Goto1 checked_action From1 down validated_down check_down down page 1/1 Goto1 action page 1/1 action down checked_action validated_neutral 2 up [reset] check_down checked_action From2 2 up 3 down checked_action up validated_up reset 1 neutral_up_down check_up validated_up [reset] 4 reset 1 neutral_up_down From1 down 2 up checked_action down validated_down reset neutral 1 neutral validated_neutral printed 13 Apr check_down [reset] Goto1 [reset] 3 /Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl down [reset] printed 13 Apr 2012 14:56 From1 3 down action 2 up checked_action up validated_up reset [reset] From2 Goto1 action checked_action up validated_up reset /Users/manaralalfi/Desktop/NiCad [reset] 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl From2 check_up 2012 14:56 1 neutral_up_down page 1/1 check_down validated_down 4 reset validated_neutral check_up mutually_exclusive checked_action neutral 1 neutral Goto1 action action mutually_exclusive 4 reset 3 down [reset] reset From1 up action From2 [reset] mutually_exclusive action reset validated_down reset [reset] powerwindow03/power_window_control_system/validate_driver neutral page 1/1 1 neutral_up_down powerwindow03/power_window_control_system/validate_driver check_up 3 down validated_neutral printed 13 Apr 2012 14:56 up validated_up checked_action reset From1 1 neutral Goto1 validated_neutral /Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl printed 13 Apr 2012 14:56 neutral [reset] 4 reset neutral 1 neutral From2 /Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl 1 neutral validated_down check_down validated_down page 1/1 2 up printed 13 Apr 2012 14:56 down checked_action reset mutually_exclusive [reset] powerwindow03/power_window_control_system/validate_driver /Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl action [reset] 4 reset powerwindow03/power_window_control_system/validate_driver 3 down From1 mutually_exclusive [reset] Goto1 1 neutral_up_down powerwindow03/power_window_control_system/validate_driver [reset] mutually_exclusive 4 reset validated_up check_up action 3 down /Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl checked_action reset [reset] printed 13 Apr 2012 14:56 From1 check_down reset [reset] up checked_action reset [reset] From2 action 3 down 1 neutral_up_down validated_up check_up action 2 up check_up up checked_action From2 mutually_exclusive action action reset [reset] From1 [reset] validated_neutral action [reset] 2 up neutral 1 neutral check_up 3 down validated_neutral up reset /Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl printed 13 Apr 2012 14:56 /Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl action 2 up [reset] [reset] validated_down mutually_exclusive action 3 down powerwindow03/power_window_control_system/validate_driver check_down 1 neutral_up_down validated_up reset Goto1 1 neutral_up_down up down checked_action reset From1 checked_action From2 [reset] 4 reset action action 3 down [reset] action 2 up 1 neutral_up_down validated_up check_up validated_neutral validated_down check_down [reset] 2 up neutral 1 neutral up checked_action reset [reset] check_up validated_neutral action 2 up 1 neutral_up_down validated_up reset neutral 1 neutral reset [reset] neutral validated_neutral powerwindow03/power_window_control_system/validate_driver From2 1 neutral powerwindow03/power_window_control_system/validate_driver 1 neutral_up_down action checked_action From1 validated_down check_down mutually_exclusive check_up 4 reset action checked_action down reset [reset] down validated_down [reset] Goto1 reset page 1/1 check_down mutually_exclusive /Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl printed 13 Apr 2012 14:56 /Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl page 1/1 4 reset [reset] printed 13 Apr 2012 14:56 Goto1 /Users/manaralalfi/Desktop/NiCad 3.2 Simulink/Simulink/Publicmodel/automotive/powerwindow03.mdl printed 13 Apr 2012 14:56 page 1/1 page 1/1
  • 37. Challenge #5 finding type 2 (renamed) requires anonymization ...! System {! Name Block {! BlockType Name Amplitude Period PulseWidth PhaseDelay SampleTime }! Block {! BlockType Name Ports Inputs }! ...! }! ...! names in Simulink not like other languages solution: context-dependent anonymizer "onoff”! DiscretePulseGenerator! "Discrete PulsenGenerator”! "1"! "2"! "1"! "0"! "1"! Product! "Product"! [2, 1, 0, 0, 0]! "2”!
  • 38. validation - Simone vs. ConQAT on Matlab Central public model systems finds all type1(exact) and type 2 (renamed) clones found by ConQAT finds many new type 3 (near-miss) clones not found by ConQAT finds larger clones and larger clone classes [Alalfi, Cordy,Dean, Stephan, Stevenson ICSM 2012]
  • 40. Simone near-miss clones in Simulink public automotive model variants Total nontrivial subsystems 357 Extractor only Filtered Filtered & Sorted Filtered, Sorted & Renamed Clone Type Type 1 Type 3-1 @30% Type 1 Type 3-1 @30% Type 1 Type 3-1 @30% Type 2 Type 3-2 @30% Clone Pairs 116 / 10* 364 / 164* 204 204 303 181 279 1938 Clone Classes 8 / 4* 57 / 56* 44 55 45 52 48 24 Clone Coverage 8% / 3% 52% / 46% 37% 48% 42% 45% 49% 75% [Alalfi, Cordy,Dean, Stephan, Stevenson ICSM 2012]
  • 41. Simone near-miss pattern mining in Simulink models !"#$%&%'()(*+&$%'( ,+-.".$%-$(/%-01"-2( 3#"-'(/%-01"-2( *4.$%1.( 56$&07$%'( ,#+-%.( ,#0..%.( ,#+-%.( ,#0..%.( ,#+-%.( ,#0..%.( !"#$"%&'()#*"$& +,-& ,,.& ,+& ,/+& ,.& -0,& ,1& 2345$3)6&7(48& 1/9:& ;0-& .,& ,11& .,& 1.;0& --& '8)<"#&=>"4?$(@& --0& 1+.& -0& ;;;& -0& -,.& -,& 89('+$)::( 099& ;11& ;.& ;90& ;0& /::& ;:& 89('+$):;( 099& ;11& ;/& ;.-& ;.& /1.& ;1& 89('+$):<( 0./& ;1;& ;+& ;.-& ;/& /;-& ;,& 89('+$):=( 1:01& ;/-& ,+& ,9;& -1& 11-9& ,:&
  • 42. MPE near-miss clones near-miss clone detection Simone analysis of GM models pattern extraction pattern evolution
  • 43. Case study GM fuel system models SimGraph visualization understanding Simulink model subsystem similarity
  • 44. GM Fuel System Models Subsystem similarity overview X models (blue) Small subsystems Y models (green) Large subsystems Z models (red) Midsize subsystems
  • 45. GM Fuel System Models Subsystem similarity overview Many subsystems unique not similar to any others in these models
  • 46. GM Fuel System Models Remove unique subsystems Similar subsystems “near-miss clones” both within and between models Connecting lines represent subsystem similarity thick lines, 90-100% similar thin lines, 70-80% similar
  • 47. GM Fuel System Models Rearrange to cluster similar subsystems Clusters reveal groups of similar subsystems “clone classes”
  • 48. GM Fuel System Models Infer common subsystem patterns Patterns characterize common repeated similar subsystem paradigms Small groups of relatively large similar subsystems both within and across models Large groups of small to mid-sized similar subsystems across models
  • 49. MPE near-miss clones near-miss clone detection Simone analysis of GM models pattern extraction pattern evolution
  • 50. using patterns SimNav exemplar sets as patterns SimPat modeling variance
  • 51. SimNav presenting and integrating results in Simulink exemplar sets as patterns
  • 53.
  • 54. SimPat characterizing and representing subsystem patterns modeling variance
  • 59. %&$ near-miss clones &($ %"$ MPE &'$ &'$ !"#$ &($ &)$ &*$ %!$ &'$ !"#$ &($ &)$ &*$ near-miss clone detection Simone analysis of GM models pattern extraction pattern evolution &)$ &*$
  • 60. model pattern evolution SimCCT evolution of patterns across versions pattern variance in two dimensions instance, time [Stephan, Alalfi, Cordy, Stevenson ME 2013]
  • 61. model pattern MCC - model clone class elements of a model pattern MCI - model clone instance evolution of patterns migration of MCIs between MCCs across versions of the system
  • 62. evolution of patterns 1-1 pattern is stable across versions 1-1* pattern exists, but loses or gains MCIs 1-many pattern splits into multiple patterns 1-many* pattern splits, losing or gaining MCIs 1-0 pattern unifies or disappears
  • 64. SimCCT - Power Window MCC 3 *'" !" #" *)" !" $" %" &" '(" '!" '#" *+" !" $" %" &" '(" '!" '#" *,"-"*!" )(" ./01"2/3"405/26"3/"728"9::" 45"$6%78, -!,9, !"#"$#%&'()#*+, -!,., !"#"$#%/0)#1$2", -!,3,
  • 65. SimCCT - Power Window MCC 2 !"# $# %# &# !$# %# &# !%# %# &# !&# %# &# !'# ()*+#,)-#.*/),0#-)#1,2#344#
  • 66. SimCCT - AVS MCC 7 %&$ &'$ &($ %"$ &'$ !"#$ &($ &)$ &*$ %!$ &'$ !"#$ &($ &)$ &*$ &)$ &*$
  • 67. MPE near-miss clones near-miss clone detection Simone analysis of GM models pattern extraction pattern evolution
  • 68. current work Stateflow models deployment at GM analysis of more systems
  • 69. Thank you! Joseph d’Ambrosio Cheryl Williams Manar H. Alalfi Thomas R. Dean Matthew Stephan Andrew Stevenson
  • 70. Submodel Pattern Extraction for Simulink Models James R. Cordy Queen’s University NECSIS Automotive Partnership Canada