evolution of nearmiss clones - ieee-scam.org · argouml ant jabref httpd nautilus filezilla...
TRANSCRIPT
Evolution of NearMiss Clones
Saman Bazrafshan
12th IEEE International Working Conferenceon Source Code Analysis and Manipulation
September 23th 2012
String nameParts[] = author[1].split(“ “ );int i = 0;for (i = 0; i < nameParts.length; i++) { c = nameParts[i].chartAt(0); sb.append(c + “ .” );}
String nameParts[] = author[1].split(“ “ );int y = 10;for (i = 0; i < nameParts.length; i++) { c = nameParts[i].chartAt(0); sb.append(c + “ .” );}
Near-Miss Clone
String nameParts[] = author[1].split(“ “ );String s = in.readLine();for (i = 0; i < nameParts.length; i++) { c = nameParts[i].chartAt(0); sb.append(c + “ .” );}
Göde's study“Evolution of Type-1 Clones” (SCAM 2009)
“Irregularities in clone evolution can help to differentiate
the potentially harmful from the less interesting clones.”
Göde's study“Evolution of Type-1 Clones” (SCAM 2009)
“Irregularities in clone evolution can help to differentiate
the potentially harmful from the less interesting clones.”
What aboutnear-miss clones?
● Analyzed 7 subject systems● 3 programming languages● 4 year period (daily snapshots)
1. Which clone type has more impact onthe clone ratio?
Mea
n C
lon
e R
atio
[%
]
ArgoUML Ant JabRef httpd Nautilus FileZilla Umbrello
0.0
2.0
4.0
6.0
8.0
10.0
12.0
14.0
16.0
18.0
Identical Cloned CodeNear-Miss Cloned Code
2. Which clone type is more persistent?
ArgoUML Ant JabRef httpd Nautilus FileZilla Umbrello
0.0
100.0
200.0
300.0
400.0
500.0
600.0
Identical FragmentNear-Miss Fragments
Mea
n L
ifet
ime
[#V
ersi
on
s]
1212 12221181 986 936 1401660Total Number Versions:
3. How frequent do identical clones changeinto near-miss clones and vice-versa?
ArgoUML Ant JabRef httpd Nautilus FileZilla Umbrello
Near-Miss to
Identical44 3 8 18 2 5 8
Identical to
Near-Miss19 8 13 29 4 10 8
3. How frequent do identical clones changeinto near-miss clones and vice-versa?
if (nameParts.length > 0) nameParts[i] = sb + “ .” ;
if (nameParts.length > 0) { nameParts[i] = sb + “ .” ;}
if (nameParts.length > 0) { nameParts[i] = sb + “ .” ;}
if (nameParts.length > 0) { nameParts[i] = sb + “ .” ;}
ArgoUML Ant JabRef httpd Nautilus FileZilla Umbrello
Near-Miss to
Identical44 3 8 18 2 5 8
Identical to
Near-Miss19 8 13 29 4 10 8
4. Which clone type is changed morefrequently (consistently / inconsistently)?
Mea
n #
of
Ch
ang
ed F
rag
men
t /
Ver
sio
n
ArgoUML Ant JabRef httpd Nautilus FileZilla Umbrello
0.0
1.0
2.0
3.0
4.0
5.0
6.0
7.0
Consistent IdenticalConsistent Near-MissInconsistent IdenticalInconsistent Near-Miss