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
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]
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?
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]
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
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