The document discusses inconsistent changes to code clones at the release level by analyzing two subject systems over multiple releases to detect clones, track clone groups between releases, and identify inconsistent changes in clone groups. It aims to observe the effects of inconsistent changes to clones at the release level since previous work has mainly analyzed inconsistent changes at the revision level.
Measuring Program Comprehension: A Large-Scale Field Study with Professionals
Inconsistent Changes to Code Clones Often Half of Changes
1. Inconsistent Changes to Code Clones
Nicolas Bettenburg
An Empirical Study on
at Release Level
Weyi Shang Walid Ibrahim Bram Adams Ying Zou Ahmed E. Hassan
1
3. 3
Code Clones: Inconsistent Changes
“During the evolution of a system, code clones
should be changed consistently to prevent bugs.”
3
4. 3
Code Clones: Inconsistent Changes
“During the evolution of a system, code clones
should be changed consistently to prevent bugs.”
Demonstrated to be
true at a micro-level!
Juergens et al. ICSE’09, Krinke et al. WCRE’07
3
16. 6
Motivation
How does this look like, if we step back and
observe the effects of inconsistent changes
at release level?
6
17. 7
Study Design: Subject Systems
22 Releases over 1 year
51 Days / release
15k Lines of code
50 Releases over 4 years
36 Days / release
90k Lines of code
7
23. 10
Research Questions
Q1
What are the characteristics of long-lived clone
genealogies at release level?
Q2
What is the effect of inconsistent changes to code clones
when measured at release level?
Q3
What type of cloning patterns do we observe at release
level?
10
25. 12
Research Question Q1
125102050
Lifetime of Clone Groups
Number of Releases
Apache Mina
jEdit
Number of Genealogies
125102050100200
Size of Clone Groups
Number of Clones
Apache Mina
jEdit
Number of Genealogies
12
26. 12
Research Question Q1
125102050
Lifetime of Clone Groups
Number of Releases
Apache Mina
jEdit
Number of Genealogies
125102050100200
Size of Clone Groups
Number of Clones
Apache Mina
jEdit
Number of Genealogies
12
27. 12
Research Question Q1
125102050
Lifetime of Clone Groups
Number of Releases
Apache Mina
jEdit
Number of Genealogies
125102050100200
Size of Clone Groups
Number of Clones
Apache Mina
jEdit
Number of Genealogies
12
28. 12
Research Question Q1
125102050
Lifetime of Clone Groups
Number of Releases
Apache Mina
jEdit
Number of Genealogies
125102050100200
Size of Clone Groups
Number of Clones
Apache Mina
jEdit
Number of Genealogies
Small, rather long lived
clone-genealogies.
12
30. 14
Research Question Q2
org.gjt.sp.jedit.jEdit.newView(View Buffer)
{
...
// show tip of the day
if(newView == viewsFirst)
{
// Don't show the welcome message if jEdit was started
// with the -nosettings switch
if(settingsDirectory != null getBooleanProperty(firstTime))
new HelpViewer(jeditresource:/doc/welcome.html);
else if(jEdit.getBooleanProperty(tip.show))
new TipOfTheDay(newView);
}
...
org.gjt.sp.jedit.jEdit.newView(View String)
{
...
// show tip of the day
if(newView == viewsFirst)
{
// Don't show the welcome message if jEdit was started
// with the -nosettings switch
if(settingsDirectory != null getBooleanProperty(firstTime))
new HelpViewer(jeditresource:/doc/welcome.html);
else if(jEdit.getBooleanProperty(tip.show))
new TipOfTheDay(newView);
}
...
4.0.1 4.0.2
jEdit
14
31. 15
Research Question Q2
org.gjt.sp.jedit.jEdit.newView(View Buffer)
{
...
// show tip of the day
if(newView == viewsFirst)
{
// Don't show the welcome message if jEdit was started
// with the -nosettings switch
if(settingsDirectory != null getBooleanProperty(firstTime))
new HelpViewer(jeditresource:/doc/welcome.html);
else if(jEdit.getBooleanProperty(tip.show))
new TipOfTheDay(newView);
}
...
org.gjt.sp.jedit.jEdit.newView(View String)
{
...
// show tip of the day
if(newView == viewsFirst)
{
// Don't show the welcome message if jEdit was started
// with the -nosettings switch
if(settingsDirectory != null getBooleanProperty(firstTime))
new HelpViewer(jeditresource:/doc/welcome.html);
else if(jEdit.getBooleanProperty(tip.show))
new TipOfTheDay(newView);
}
...
4.0.2 4.0.3
jEdit
15
32. 16
Research Question Q2
org.gjt.sp.jedit.jEdit.newView(View Buffer)
{
...
// show tip of the day
if(newView == viewsFirst)
{
// Don't show the welcome message if jEdit was started
// with the -nosettings switch
if(settingsDirectory != null getBooleanProperty(firstTime))
new HelpViewer();
else if(jEdit.getBooleanProperty(tip.show))
new TipOfTheDay(newView);
}
...
org.gjt.sp.jedit.jEdit.newView(View String)
{
...
// show tip of the day
if(newView == viewsFirst)
{
// Don't show the welcome message if jEdit was started
// with the -nosettings switch
if(settingsDirectory != null getBooleanProperty(firstTime))
new HelpViewer(jeditresource:/doc/welcome.html);
else if(jEdit.getBooleanProperty(tip.show))
new TipOfTheDay(newView);
}
...
4.0.3 4.0.4
jEdit
16
33. 17
Research Question Q2
• 748 inconsistent changes flagged by our tool
• Manual inspection of the source code
• 7 inconsistent changes related to bugs
• For 41% - 65% of genealogies: inconsistent
changes carried out on purpose.
17
34. 17
Research Question Q2
• 748 inconsistent changes flagged by our tool
• Manual inspection of the source code
• 7 inconsistent changes related to bugs
• For 41% - 65% of genealogies: inconsistent
changes carried out on purpose.
Independent evolution of
clones observed at
release level.
17