Fault-Proneness of Clone Mutation and Clone Migration Shuai Xie, - - PowerPoint PPT Presentation

fault proneness of clone mutation
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

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

slide-2
SLIDE 2

Clone Genealogies

Revision i Revision i+2 Revision i+1 Type-1 Clone Clone Group

slide-3
SLIDE 3

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

slide-4
SLIDE 4

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

slide-5
SLIDE 5

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

slide-6
SLIDE 6

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

slide-7
SLIDE 7

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

slide-8
SLIDE 8

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?

slide-9
SLIDE 9

Subject Systems

Systems # LOC # Revisions # Genealogies

1.6M 109K 1.7K 2.3M 1.0M 23K ArgoUML 3.1M 18k 15.6k

slide-10
SLIDE 10

Approach Overview

slide-11
SLIDE 11

Mine the SVN

  • Mine the SVN using J-Rex

– Identify fault fixing changes – Snapshots for all changed files

  • Remove the test files
slide-12
SLIDE 12

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

slide-13
SLIDE 13

Build Clone Genealogies

  • Build clone genealogies by existing clone groups
  • Use diff to track changes to each clone
  • Connect clone groups that share clones
slide-14
SLIDE 14

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.

slide-15
SLIDE 15

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

slide-16
SLIDE 16

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

slide-17
SLIDE 17

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

slide-18
SLIDE 18

Clone Mutation and Clone Migration

slide-19
SLIDE 19

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.

slide-20
SLIDE 20

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.

slide-21
SLIDE 21

RQ3

  • RQ3: Are some clone migrations more fault-

prone than others?

  • Main Findings:

Increasing the distances among cloned code segments make the clone genealogies more fault-prone.