Angela Lozano*, Fehmi Jaafar, Kim Mens, Yann-Gael Gueheneuc 
*Software Languages Lab (SOFT) 
Vrije Universiteit Brussel-VUB 
Belgium 
Clones & 
Macro-Co-Changes 
Friday 31 January 14
Motivation 
What we did 
Results 
Discussion 
Agenda 
Friday 31 January 14
PlowAction 
Require 
replication of 
changes 
ChangeAction 
UnloadAction 
Friday 31 January 14
Clones need consistent changes 
all 
PlowAction ChangeAction 
UnloadAction 
Friday 31 January 14
Clones need consistent changes 
all + same way 
PlowAction ChangeAction 
UnloadAction 
Unit selectedOne = super.getActiveUnit(); 
Unit unit = super.getActiveUnit(); 
Unit unit = super.getActiveUnit(); 
Friday 31 January 14
Clones need consistent changes 
PlowAction 
ChangeAction 
UnloadAction 
PlowAction 
ChangeAction 
UnloadAction 
PlowAction 
ChangeAction 
UnloadAction 
PlowAction 
ChangeAction 
UnloadAction 
all + same way + same time 
✗ 
> != 
< == 
> != 
< == 
> != 
< == 
✔︎ 
Friday 31 January 14
Do they need consistent changes? 
• Percentage of inconsistent changes to clone groups: 
• ~50% (exact clones) [Krinke07], ~50% [Juergens09] 
• At least 30% (exact clones) [Gode09] 
• Most common type of change (ignores patterns per clone groups): 
• Consistent (~45% with a 24h delay) [Aversano07] 
• Depends on the application analyzed, either Independent Evolution or Consistent 
Changes [Thummalapenta10] 
• Consecutive consistent changes [Gode11] 
• At least 1/3 of clone groups require at least 1 consistent change [Kim05] 
• Weak correlation between files sharing a clone and co-changes [Geiger06] 
Friday 31 January 14
MAYBE the definition 
of consistent changes is 
too restrictive 
Friday 31 January 14
Clones need consistent changes 
all + same way + sam✗e time 
PlowAction 
ChangeAction 
UnloadAction 
PlowAction 
ChangeAction 
UnloadAction 
> != 
< == 
> != 
< == 
> != 
< == 
Friday 31 January 14
Clones need consistent changes 
all + same way + sam✗e time 
PlowAction 
ChangeAction 
UnloadAction 
PlowAction 
ChangeAction 
UnloadAction 
> != 
< == 
> != 
< == 
> != 
< == 
✔︎ 
Friday 31 January 14
Commit transactions 
file1 
file2 
file3 
file4 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 
Friday 31 January 14
file1 
file2 
file3 
file4 
Macro Changes(MC) 
1 2 3 4 5 6 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 
Friday 31 January 14
file1 
file2 
file3 
file4 
Macro Changes(MC) 
1 2 3 4 5 6 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 
Friday 31 January 14
Macro Co Changes(MCC) 
file1 
file2 
file3 
file4 
1 2 3 4 5 6 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 
Friday 31 January 14
Macro Co Changes(MCC) 
file1 
file2 
file3 
file4 
1 2 3 4 5 6 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 
✔︎ 
✔︎ 
✔︎ 
✔︎ 
✔︎ 
✔︎ 
MCC 
Friday 31 January 14
Macro Co Changes(MCC) 
file1 
file2 
file3 
file4 
1 2 3 4 5 6 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 
✔︎ 
✔︎ 
✔︎ 
✔︎ 
✔︎ 
✔︎ 
MCC 
✔︎✗ ✔︎✔︎ 
AMCC 
Friday 31 January 14
Are MCC at file level a 
good proxy to discard 
consistent changes? 
Friday 31 January 14
Research question 
• Null hypothesis 
• Cloned files tend to co-change equally with: 
• cloned files with which they have cloning relations 
• and with other cloned files 
• Alternative hypothesis 
• Cloned files tend to co-change more with: 
• cloned files with which they have cloning relations 
• than with other cloned files. 
Friday 31 January 14
For all cloned files 
• Did it change with files with which it shares 
clones? 
• Did it change with cloned files with which 
it does not share clones? 
• Did it change with both? 
Friday 31 January 14
Example 
file2 
file3 
file4 
file5 
file6 
file7 
file8 
file9 
file10 
1 
✔ 
✔ 
✔ 
✔ 
2 
✔ 
✔ 
✔ 
3 
✔ 
✔ 
4 
✔ 
9 
✔ 
✔ 
✔ 
✔ 
6 
✔ 
✔ 
✔ 
5 
✔ 
✔ 
8 
✔ 
7 
✔ 
✔ 
✔ 
10 
✔ 
✔ 
11 
✔ 
✔ 
12 
✔ 
✔ 
✔ 
✔ 
Macro Changes 
file1 
Friday 31 January 14
Example 
file2 
file3 
file4 
file5 
file6 
file7 
file8 
file9 
file10 
1 
✔ 
✔ 
✔ 
✔ 
2 
✔ 
✔ 
✔ 
3 
✔ 
✔ 
4 
✔ 
9 
✔ 
✔ 
✔ 
✔ 
6 
✔ 
✔ 
✔ 
5 
✔ 
✔ 
8 
✔ 
7 
✔ 
✔ 
✔ 
10 
✔ 
✔ 
11 
✔ 
✔ 
12 
✔ 
✔ 
✔ 
✔ 
Macro Changes 
Macro CO Changes 
1 2 3 4 5 6 7 8 9 10 11 12 
file1 
Friday 31 January 14
Example 
file2 
file3 
file4 
file5 
file6 
file7 
file8 
file9 
file10 
1 
✔ 
✔ 
✔ 
✔ 
2 
✔ 
✔ 
✔ 
3 
✔ 
✔ 
4 
✔ 
9 
✔ 
✔ 
✔ 
✔ 
6 
✔ 
✔ 
✔ 
5 
✔ 
✔ 
8 
✔ 
7 
✔ 
✔ 
✔ 
10 
✔ 
✔ 
11 
✔ 
✔ 
12 
✔ 
✔ 
✔ 
✔ 
Macro Changes 
Macro CO Changes 
1 2 3 4 5 6 7 8 9 10 11 12 
✔ ✔ ✔ 
file1 
Friday 31 January 14
Example 
file2 
file3 
file4 
file5 
file6 
file7 
file8 
file9 
file10 
1 
✔ 
✔ 
✔ 
✔ 
2 
✔ 
✔ 
✔ 
3 
✔ 
✔ 
4 
✔ 
9 
✔ 
✔ 
✔ 
✔ 
6 
✔ 
✔ 
✔ 
5 
✔ 
✔ 
8 
✔ 
7 
✔ 
✔ 
✔ 
10 
✔ 
✔ 
11 
✔ 
✔ 
12 
✔ 
✔ 
✔ 
✔ 
Macro Changes 
Macro CO Changes 
1 2 3 4 5 6 7 8 9 10 11 12 
✔ ✔ ✔ 
✔ ✔ ✔ ✔ 
file1 
Friday 31 January 14
Example 
file2 
file3 
file4 
file5 
file6 
file7 
file8 
file9 
file10 
1 
✔ 
✔ 
✔ 
✔ 
2 
✔ 
✔ 
✔ 
3 
✔ 
✔ 
4 
✔ 
9 
✔ 
✔ 
✔ 
✔ 
6 
✔ 
✔ 
✔ 
5 
✔ 
✔ 
8 
✔ 
7 
✔ 
✔ 
✔ 
10 
✔ 
✔ 
11 
✔ 
✔ 
12 
✔ 
✔ 
✔ 
✔ 
Macro Changes 
Macro CO Changes 
1 2 3 4 5 6 7 8 9 10 11 12 
✔ ✔ ✔ 
✔ ✔ ✔ ✔ 
✔ ✔ ✔ 
file1 
Friday 31 January 14
Example 
file2 
file3 
file4 
file5 
file6 
file7 
file8 
file9 
file10 
1 
✔ 
✔ 
✔ 
✔ 
2 
✔ 
✔ 
✔ 
3 
✔ 
✔ 
4 
✔ 
9 
✔ 
✔ 
✔ 
✔ 
6 
✔ 
✔ 
✔ 
5 
✔ 
✔ 
8 
✔ 
7 
✔ 
✔ 
✔ 
10 
✔ 
✔ 
11 
✔ 
✔ 
12 
✔ 
✔ 
✔ 
✔ 
Macro Changes 
Macro CO Changes 
1 2 3 4 5 6 7 8 9 10 11 12 
✔ ✔ ✔ 
✔ ✔ ✔ ✔ 
✔ ✔ ✔ 
file1 
Friday 31 January 14
Example 
file2 
file3 
file4 
file5 
file6 
file7 
file8 
file9 
file10 
1 
✔ 
✔ 
✔ 
✔ 
2 
✔ 
✔ 
✔ 
3 
✔ 
✔ 
4 
✔ 
9 
✔ 
✔ 
✔ 
✔ 
6 
✔ 
✔ 
✔ 
5 
✔ 
✔ 
8 
✔ 
7 
✔ 
✔ 
✔ 
10 
✔ 
✔ 
11 
✔ 
✔ 
12 
✔ 
✔ 
✔ 
✔ 
Macro Changes 
Macro CO Changes 
1 2 3 4 5 6 7 8 9 10 11 12 
✔ ✔ ✔ 
✔ ✔ ✔ ✔ 
✔ ✔ ✔ 
RESULTS 
CO 
CO 
CO 
CO 
O 
C 
C 
C 
O 
- 
file1 
Friday 31 January 14
Experimental Method 
• Selection of applications to analyze: 
• OSS, SVN 
• Detection of cloning relations: 
• CCFinderX default settings 
Friday 31 January 14
Data collected 
Language Commits MCCs Files Cloned 
ArgoUML Java 2285 190 847 
JFreeChart Java 1534 130 692 
XercesC C++ 1809 203 79 
XalanC C++ 2244 218 38 
OpenSER C 2303 246 170 
FreeBSD C 23907 84 4 
Friday 31 January 14
cloned files that were not part of any MCC or AMCC 
Results: changes Clones both Others 
ArgoUML 
JFreeChart 
XercesC 
XalanC 
OpenSER 
FreeBSD 
CC 
ArgoUML 
JFreeChart 
XercesC 
XalanC 
OpenSER 
FreeBSD 
MCC 
ArgoUML 
JFreeChart 
XercesC 
XalanC 
OpenSER 
FreeBSD 
AMCC 
both 
Clones 
Clones 
Friday 31 January 14
Results: bugs 
AMCC 
in bug 
fixes 
ArgoUML 
JFreeChart 
XercesC 
XalanC 
OpenSER 
FreeBSD 
Changed 
in bug 
fixes 
ArgoUML 
JFreeChart 
XercesC 
XalanC 
OpenSER 
FreeBSD 
MCC 
in 
bug 
fixes 
ArgoUML 
JFreeChart 
XercesC 
XalanC 
OpenSER 
FreeBSD 
Cloned files 
Changed in bugfixes 
(A)MCC with its clones 
(A)MCC with others 
Friday 31 January 14
Does that mean that clones 
need consistent (A)MCC? 
all? 
PlowAction ChangeAction 
UnloadAction 
Friday 31 January 14
Does that mean that clones 
need consistent (A)MCC? 
all? 
PlowAction ChangeAction 
UnloadAction 
Future work 
Friday 31 January 14
Does that mean that clones 
need consistent (A)MCC? 
same way? 
PlowAction ChangeAction 
UnloadAction 
Unit selectedOne = null; 
Unit unit = Factory.getUnit(); 
Unit unit = super.getActiveUnit(); 
Friday 31 January 14
Does that mean that clones 
need consistent (A)MCC? 
PlowAction ChangeAction 
UnloadAction 
Unit selectedOne = null; 
Unit unit = Factory.getUnit(); 
Unit unit = super.getActiveUnit(); 
Future work 
same way? 
Friday 31 January 14
Macro-Co-Changes 
MCC analysis did not discard the assumption of consistent changes 
Cloned files tend to co-change more with cloned files with which 
they have cloning relations. 
The files that (A)MCC with others are not modified in bug-fixes, few 
files that (A)MCC with their clones are modified in bug-fixes. 
Angela Lozano 
Clones & 
alozano@soft.vub.ac.be 
Friday 31 January 14

Clones & Macro-Co-Changes

  • 1.
    Angela Lozano*, FehmiJaafar, Kim Mens, Yann-Gael Gueheneuc *Software Languages Lab (SOFT) Vrije Universiteit Brussel-VUB Belgium Clones & Macro-Co-Changes Friday 31 January 14
  • 2.
    Motivation What wedid Results Discussion Agenda Friday 31 January 14
  • 3.
    PlowAction Require replicationof changes ChangeAction UnloadAction Friday 31 January 14
  • 4.
    Clones need consistentchanges all PlowAction ChangeAction UnloadAction Friday 31 January 14
  • 5.
    Clones need consistentchanges all + same way PlowAction ChangeAction UnloadAction Unit selectedOne = super.getActiveUnit(); Unit unit = super.getActiveUnit(); Unit unit = super.getActiveUnit(); Friday 31 January 14
  • 6.
    Clones need consistentchanges PlowAction ChangeAction UnloadAction PlowAction ChangeAction UnloadAction PlowAction ChangeAction UnloadAction PlowAction ChangeAction UnloadAction all + same way + same time ✗ > != < == > != < == > != < == ✔︎ Friday 31 January 14
  • 7.
    Do they needconsistent changes? • Percentage of inconsistent changes to clone groups: • ~50% (exact clones) [Krinke07], ~50% [Juergens09] • At least 30% (exact clones) [Gode09] • Most common type of change (ignores patterns per clone groups): • Consistent (~45% with a 24h delay) [Aversano07] • Depends on the application analyzed, either Independent Evolution or Consistent Changes [Thummalapenta10] • Consecutive consistent changes [Gode11] • At least 1/3 of clone groups require at least 1 consistent change [Kim05] • Weak correlation between files sharing a clone and co-changes [Geiger06] Friday 31 January 14
  • 8.
    MAYBE the definition of consistent changes is too restrictive Friday 31 January 14
  • 9.
    Clones need consistentchanges all + same way + sam✗e time PlowAction ChangeAction UnloadAction PlowAction ChangeAction UnloadAction > != < == > != < == > != < == Friday 31 January 14
  • 10.
    Clones need consistentchanges all + same way + sam✗e time PlowAction ChangeAction UnloadAction PlowAction ChangeAction UnloadAction > != < == > != < == > != < == ✔︎ Friday 31 January 14
  • 11.
    Commit transactions file1 file2 file3 file4 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Friday 31 January 14
  • 12.
    file1 file2 file3 file4 Macro Changes(MC) 1 2 3 4 5 6 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Friday 31 January 14
  • 13.
    file1 file2 file3 file4 Macro Changes(MC) 1 2 3 4 5 6 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Friday 31 January 14
  • 14.
    Macro Co Changes(MCC) file1 file2 file3 file4 1 2 3 4 5 6 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Friday 31 January 14
  • 15.
    Macro Co Changes(MCC) file1 file2 file3 file4 1 2 3 4 5 6 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ MCC Friday 31 January 14
  • 16.
    Macro Co Changes(MCC) file1 file2 file3 file4 1 2 3 4 5 6 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ MCC ✔︎✗ ✔︎✔︎ AMCC Friday 31 January 14
  • 17.
    Are MCC atfile level a good proxy to discard consistent changes? Friday 31 January 14
  • 18.
    Research question •Null hypothesis • Cloned files tend to co-change equally with: • cloned files with which they have cloning relations • and with other cloned files • Alternative hypothesis • Cloned files tend to co-change more with: • cloned files with which they have cloning relations • than with other cloned files. Friday 31 January 14
  • 19.
    For all clonedfiles • Did it change with files with which it shares clones? • Did it change with cloned files with which it does not share clones? • Did it change with both? Friday 31 January 14
  • 20.
    Example file2 file3 file4 file5 file6 file7 file8 file9 file10 1 ✔ ✔ ✔ ✔ 2 ✔ ✔ ✔ 3 ✔ ✔ 4 ✔ 9 ✔ ✔ ✔ ✔ 6 ✔ ✔ ✔ 5 ✔ ✔ 8 ✔ 7 ✔ ✔ ✔ 10 ✔ ✔ 11 ✔ ✔ 12 ✔ ✔ ✔ ✔ Macro Changes file1 Friday 31 January 14
  • 21.
    Example file2 file3 file4 file5 file6 file7 file8 file9 file10 1 ✔ ✔ ✔ ✔ 2 ✔ ✔ ✔ 3 ✔ ✔ 4 ✔ 9 ✔ ✔ ✔ ✔ 6 ✔ ✔ ✔ 5 ✔ ✔ 8 ✔ 7 ✔ ✔ ✔ 10 ✔ ✔ 11 ✔ ✔ 12 ✔ ✔ ✔ ✔ Macro Changes Macro CO Changes 1 2 3 4 5 6 7 8 9 10 11 12 file1 Friday 31 January 14
  • 22.
    Example file2 file3 file4 file5 file6 file7 file8 file9 file10 1 ✔ ✔ ✔ ✔ 2 ✔ ✔ ✔ 3 ✔ ✔ 4 ✔ 9 ✔ ✔ ✔ ✔ 6 ✔ ✔ ✔ 5 ✔ ✔ 8 ✔ 7 ✔ ✔ ✔ 10 ✔ ✔ 11 ✔ ✔ 12 ✔ ✔ ✔ ✔ Macro Changes Macro CO Changes 1 2 3 4 5 6 7 8 9 10 11 12 ✔ ✔ ✔ file1 Friday 31 January 14
  • 23.
    Example file2 file3 file4 file5 file6 file7 file8 file9 file10 1 ✔ ✔ ✔ ✔ 2 ✔ ✔ ✔ 3 ✔ ✔ 4 ✔ 9 ✔ ✔ ✔ ✔ 6 ✔ ✔ ✔ 5 ✔ ✔ 8 ✔ 7 ✔ ✔ ✔ 10 ✔ ✔ 11 ✔ ✔ 12 ✔ ✔ ✔ ✔ Macro Changes Macro CO Changes 1 2 3 4 5 6 7 8 9 10 11 12 ✔ ✔ ✔ ✔ ✔ ✔ ✔ file1 Friday 31 January 14
  • 24.
    Example file2 file3 file4 file5 file6 file7 file8 file9 file10 1 ✔ ✔ ✔ ✔ 2 ✔ ✔ ✔ 3 ✔ ✔ 4 ✔ 9 ✔ ✔ ✔ ✔ 6 ✔ ✔ ✔ 5 ✔ ✔ 8 ✔ 7 ✔ ✔ ✔ 10 ✔ ✔ 11 ✔ ✔ 12 ✔ ✔ ✔ ✔ Macro Changes Macro CO Changes 1 2 3 4 5 6 7 8 9 10 11 12 ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ file1 Friday 31 January 14
  • 25.
    Example file2 file3 file4 file5 file6 file7 file8 file9 file10 1 ✔ ✔ ✔ ✔ 2 ✔ ✔ ✔ 3 ✔ ✔ 4 ✔ 9 ✔ ✔ ✔ ✔ 6 ✔ ✔ ✔ 5 ✔ ✔ 8 ✔ 7 ✔ ✔ ✔ 10 ✔ ✔ 11 ✔ ✔ 12 ✔ ✔ ✔ ✔ Macro Changes Macro CO Changes 1 2 3 4 5 6 7 8 9 10 11 12 ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ file1 Friday 31 January 14
  • 26.
    Example file2 file3 file4 file5 file6 file7 file8 file9 file10 1 ✔ ✔ ✔ ✔ 2 ✔ ✔ ✔ 3 ✔ ✔ 4 ✔ 9 ✔ ✔ ✔ ✔ 6 ✔ ✔ ✔ 5 ✔ ✔ 8 ✔ 7 ✔ ✔ ✔ 10 ✔ ✔ 11 ✔ ✔ 12 ✔ ✔ ✔ ✔ Macro Changes Macro CO Changes 1 2 3 4 5 6 7 8 9 10 11 12 ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ RESULTS CO CO CO CO O C C C O - file1 Friday 31 January 14
  • 27.
    Experimental Method •Selection of applications to analyze: • OSS, SVN • Detection of cloning relations: • CCFinderX default settings Friday 31 January 14
  • 28.
    Data collected LanguageCommits MCCs Files Cloned ArgoUML Java 2285 190 847 JFreeChart Java 1534 130 692 XercesC C++ 1809 203 79 XalanC C++ 2244 218 38 OpenSER C 2303 246 170 FreeBSD C 23907 84 4 Friday 31 January 14
  • 29.
    cloned files thatwere not part of any MCC or AMCC Results: changes Clones both Others ArgoUML JFreeChart XercesC XalanC OpenSER FreeBSD CC ArgoUML JFreeChart XercesC XalanC OpenSER FreeBSD MCC ArgoUML JFreeChart XercesC XalanC OpenSER FreeBSD AMCC both Clones Clones Friday 31 January 14
  • 30.
    Results: bugs AMCC in bug fixes ArgoUML JFreeChart XercesC XalanC OpenSER FreeBSD Changed in bug fixes ArgoUML JFreeChart XercesC XalanC OpenSER FreeBSD MCC in bug fixes ArgoUML JFreeChart XercesC XalanC OpenSER FreeBSD Cloned files Changed in bugfixes (A)MCC with its clones (A)MCC with others Friday 31 January 14
  • 31.
    Does that meanthat clones need consistent (A)MCC? all? PlowAction ChangeAction UnloadAction Friday 31 January 14
  • 32.
    Does that meanthat clones need consistent (A)MCC? all? PlowAction ChangeAction UnloadAction Future work Friday 31 January 14
  • 33.
    Does that meanthat clones need consistent (A)MCC? same way? PlowAction ChangeAction UnloadAction Unit selectedOne = null; Unit unit = Factory.getUnit(); Unit unit = super.getActiveUnit(); Friday 31 January 14
  • 34.
    Does that meanthat clones need consistent (A)MCC? PlowAction ChangeAction UnloadAction Unit selectedOne = null; Unit unit = Factory.getUnit(); Unit unit = super.getActiveUnit(); Future work same way? Friday 31 January 14
  • 35.
    Macro-Co-Changes MCC analysisdid not discard the assumption of consistent changes Cloned files tend to co-change more with cloned files with which they have cloning relations. The files that (A)MCC with others are not modified in bug-fixes, few files that (A)MCC with their clones are modified in bug-fixes. Angela Lozano Clones & alozano@soft.vub.ac.be Friday 31 January 14