Fault-Proneness of Clone Mutation and Clone Migration Shuai Xie, - - PowerPoint PPT Presentation
Fault-Proneness of Clone Mutation and Clone Migration Shuai Xie, - - PowerPoint PPT Presentation
An Empirical Study of the Fault-Proneness of Clone Mutation and Clone Migration Shuai Xie, Foutse Khomh, Ying Zou Department of Electrical and Computing Engineering Clone Genealogies Revision i Revision i+1 Revision i+2 Type-1 Clone Clone
Clone Genealogies
Revision i Revision i+2 Revision i+1 Type-1 Clone Clone Group
Clone Mutation
Revision i Revision i+1 Type-1 Clone Group Type-2 Clone Group
Clone A, Revision 270153 catch( NullPointerException npe ){ throw new BuildException ( "Could not load the version information." ); } Clone A, Revision 270159 catch( NullPointerException npe ){ throw new TaskException ( "Could not load the version information." ); }
A A
Clone Mutation Categories
G<1> G<2> G<3> G<1,2> G<2,3> G<1,3> G<1,2,3>
Revision i Revision i+1
Type-1 Clone Clone Group Type-2 Clone Type-3 Clone
Revision i+2
Clone Migration
Type-1 Clone Directory Revision i Revision i+1 B
File A, Revision: 268748 Path: /ant/core/trunk/src/
main/org/apache/tools/ant/ ProjectHelper.java
File A, Revision: 270158 Path: /ant/core/trunk/ proposal/myrmidon/src/ main/org/apache/tools/ ant/ProjectHelper.java
D1 D1
D2 D2 D3
A A
Evolution Trends Evolution of Median Distance Among Clones in Clone Group Evolution of Size of Clone Group Constant Increase Decrease Wave Increase Wave Decrease
Clone Migration Patterns
We also define other 8 clone migration patterns
Clone Migration Patterns
Patterns Clone Migration? Evolution of Median Distance Among Clones in Clone Group Evolution of Size of Clone Group Constant No High Density Strong Up Yes
Research Questions
- RQ1: Do clone mutation and clone migration
- ccur frequently in software systems?
- RQ2: Are some clone mutations more fault-
prone than others?
- RQ3: Are some clone migrations more fault-
prone than others?
Subject Systems
Systems # LOC # Revisions # Genealogies
1.6M 109K 1.7K 2.3M 1.0M 23K ArgoUML 3.1M 18k 15.6k
Approach Overview
Mine the SVN
- Mine the SVN using J-Rex
– Identify fault fixing changes – Snapshots for all changed files
- Remove the test files
Clone Detection
- Perform clone detection once on all files
- Use NiCad to detect clone
- NiCad parameters:
Clone Type Similarity Blind-rename Type-1 100% No Type-2 100% Yes Type-3 80% Yes
Build Clone Genealogies
- Build clone genealogies by existing clone groups
- Use diff to track changes to each clone
- Connect clone groups that share clones
10 20 30 40 50 60 G<1> G<2> G<3> G<1,2> G<1, 3> G<2, 3> G<1, 2, 3> Total Mutation Percentage %
Proportion of Different Clone Mutation Categories
JBoss Apache-Ant ArgoUML
RQ1: Do clone mutation and clone migration occur frequently in software systems?
No Clone Mutation Clone Mutation Categories
Clone mutation affects an important number of clones.
10 20 30 40 50 60 70 Constant Wave Stable High Density Strong Up Low Density Strong Up High Density Wave Up Low Density Wave Up High Density Strong Down Low Density Strong Down High Density Wave Down Low Density Wave Down Total Migration Percentage %
Proportion of Different Clone Migration Patterns
Jboss Apache-Ant ArgoUML
Clone migration affects an important number of clones.
RQ1: Do clone mutation and clone migration occur frequently in software systems?
No Clone Migration
Clone Migration Patterns
RQ2: Are some clone mutations more fault- prone than others?
1 2 3 4 5 6 7 8 9 10
Type-1 Type-2 Type-3 Type-1 Type-2 Type- 1, Type-2 Type-1 Type-3 Type- 1, Type-3 Type-2 Type-3 Type- 2, Type-3 Type-1 Type-2 Type-3 Type- 1, Type- 2, Type-3 G<1> G<2> G<3> G<1,2> G<1, 3> G<2, 3> G<1,2,3>
Odds Ratio
Odds Ratio for Different Categories of Clone Genealogies
Jboss Apache-Ant ArgoUML
Clone Mutation with Type-1 to Type-2 and Type-1 to Type-3 increase the fault- proneness.
No Mutation
Clone Mutation Categories
40 12
RQ3: Are some clone migrations more fault- prone than others?
1 2 3 4 5 6 7 8 9 10 Constant Wave Stable High Density Strong Up Low Density Strong Up High Density Wave Up Low Density Wave Up High Density Strong Down Low Density Strong Down High Density Wave Down Low Density Wave Down
Odds Ratio
Odds Ratio of Different Migration Patterns
JBoss ORs Apache-Ant ORs ArgoUML ORs
Increasing the distances among cloned code segments are more fault-prone.
No Clone Migration
Clone Migration Patterns
52
Clone Mutation and Clone Migration
RQ1
- RQ1: Do clone mutation and clone migration
- ccur frequently in software systems?
- Main Findings:
Both clone mutation and clone migration affect a important number of clones in clone genealogies.
RQ2
- RQ2: Are some clone mutations more fault-
prone than others?
- Main Findings:
Clone Mutation with Type-1 to Type-2 and Type-1 to Type-3 in clone genealogies increase the fault-proneness.
RQ3
- RQ3: Are some clone migrations more fault-
prone than others?
- Main Findings: