Upload
angloza
View
112
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Presentation given at the International Workshop on Software Clones 2014 (IWSC'14)
Citation preview
Angela Lozano*, Fehmi Jaafar, Kim Mens, Yann-Gael Gueheneuc*Software Languages Lab (SOFT)
Vrije Universiteit Brussel-VUBBelgium
Clones & Macro-Co-Changes
Friday 31 January 14
MotivationWhat we didResultsDiscussion
Agenda
Friday 31 January 14
Require replication of
changes
PlowAction
ChangeAction
UnloadAction
Friday 31 January 14
Clones need consistent changesall
PlowAction ChangeAction
UnloadAction
Friday 31 January 14
Clones need consistent changesall + same way
PlowAction ChangeAction
UnloadAction
Unit selectedOne = super.getActiveUnit();Unit unit = super.getActiveUnit();
Unit unit = super.getActiveUnit();
Friday 31 January 14
PlowAction
ChangeAction
UnloadAction
PlowAction
ChangeAction
UnloadAction
PlowAction
ChangeAction
UnloadAction
PlowAction
ChangeAction
UnloadAction
Clones need consistent changesall + 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 changesall + same way + same time✗
PlowAction
ChangeAction
UnloadAction
PlowAction
ChangeAction
UnloadAction
> !=< ==
> !=< ==
> !=< ==
Friday 31 January 14
Clones need consistent changesall + same way + same time✗
PlowAction
ChangeAction
UnloadAction
PlowAction
ChangeAction
UnloadAction
> !=< ==
> !=< ==
> !=< ==
✔ ︎Friday 31 January 14
Commit transactions
file1
file2
file4
file3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Friday 31 January 14
file1
file2
file4
file3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Macro Changes(MC)
1 2 3 4 5 6
Friday 31 January 14
file1
file2
file4
file3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Macro Changes(MC)
1 2 3 4 5 6
Friday 31 January 14
file1
file2
file4
file3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Macro Co Changes(MCC)
1 2 3 4 5 6
Friday 31 January 14
file1
file2
file4
file3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Macro Co Changes(MCC)
1 2 3 4 5 6
✔ ︎✔ ︎
✔ ︎✔ ︎
✔ ︎✔ ︎
MCC
Friday 31 January 14
file1
file2
file4
file3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Macro Co Changes(MCC)
1 2 3 4 5 6
✔ ︎✔ ︎
✔ ︎✔ ︎
✔ ︎✔ ︎
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
• 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?
For all cloned files
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
1 2 3 4 965 87 10 11 12Macro CO 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
1 2 3 4 965 87 10 11 12Macro CO 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
1 2 3 4 965 87 10 11 12Macro CO 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
1 2 3 4 965 87 10 11 12Macro CO 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
1 2 3 4 965 87 10 11 12Macro CO 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
1 2 3 4 965 87 10 11 12Macro CO Changes
✔ ✔ ✔✔ ✔ ✔ ✔
✔ ✔ ✔
RESULTSCO
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
Results: changes Clones Othersboth
cloned files that were not part of any MCC or AMCC
ArgoUMLJFreeChart XercesC XalanC OpenSER FreeBSD
CC
ArgoUMLJFreeChart XercesC XalanC OpenSER FreeBSD
MCC
ArgoUMLJFreeChart XercesC XalanC OpenSER FreeBSD
AMCC
bothboth
Clones
Clones
Friday 31 January 14
Results: bugs
AMCC in bug fixes
ArgoUMLJFreeChart XercesC XalanC OpenSER FreeBSD
Changed in bug fixes
ArgoUMLJFreeChart XercesC XalanC OpenSER FreeBSD
MCC in
bug fixes
ArgoUMLJFreeChart XercesC XalanC OpenSER FreeBSD
(A)MCC with its clonesChanged in bugfixes
(A)MCC with others
Cloned files
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
PlowAction ChangeAction
UnloadAction
Does that mean that clones need consistent (A)MCC?
Unit selectedOne = null; Unit unit = Factory.getUnit();
Unit unit = super.getActiveUnit();
same way?
Friday 31 January 14
PlowAction ChangeAction
UnloadAction
Does that mean that clones need consistent (A)MCC?
Unit selectedOne = null; Unit unit = Factory.getUnit();
Unit unit = super.getActiveUnit();
Future work
same way?
Friday 31 January 14
Angela Lozano
Clones & 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.
Friday 31 January 14