SlideShare a Scribd company logo
ICSE’2016 | Austin | May 19, 2016
Davood Mazinanian Nikolaos Tsantalis
: Clone Refactoring
Raphael Stein Zackary Valenta
1/20
38th International Conference on Software Engineering (ICSE'2016)
Formal Tool Demonstration Session
Department of Computer Science and Software Engineering
Concordia University
ICSE’2016 | Austin | May 19, 2016
Clones are harmful
• Error-prone due to inconsistent updates
(Juergens et al. @ ICSE’09)
• Increase maintenance effort and cost
(Lozano et al. @ ICSM’08)
• Change-prone
(Mondal et al. @ ACM SAC’12)
2/20
ICSE’2016 | Austin | May 19, 2016
Clones are good
• Positive impact on maintainability
(Kasper & Godfrey @ EMSE’08)
• Less buggy
Less effort to fix bugs
(Rahman, Bird & Devanbu @ EMSE’12)
3/20
ICSE’2016 | Austin | May 19, 2016
Clone management
Clones that change frequently & are buggy
might need some refactoring
4/20
ICSE’2016 | Austin | May 19, 2016
Motivation
Current clone refactoring support is poor
Tairas & Gray (IST’12) studied 1,200 Type-II
clones detected in 9 open-source projects:
• 10% could be refactored by Eclipse
• CeDAR (IST’12) refactored 19%
5/20
ICSE’2016 | Austin | May 19, 2016
Our goal
Help developers:
1. Explore clone groups and understand
their relations
2. Inspect and understand the differences
between clones
3. Refactor safely the clones
6/20
ICSE’2016 | Austin | May 19, 2016 7/20
ICSE’2016 | Austin | May 19, 2016
Clone import
8/20
ICSE’2016 | Austin | May 19, 2016
Subclone information
9/20
ICSE’2016 | Austin | May 19, 2016
Clone filtering
10/20
ICSE’2016 | Austin | May 19, 2016
Clone monitoring
11/20
ICSE’2016 | Austin | May 19, 2016 12/20
ICSE’2016 | Austin | May 19, 2016
Our approach
common
nesting trees
if (orientation == VERTICAL) {
Line2D line = new Line2D.Double();
double x0 = dataArea.getMinX();
double x1 = dataArea.getMaxX();
g2.setPaint(im.getOutlinePaint());
g2.setStroke(im.getOutlineStroke());
}
if (orientation == VERTICAL) {
Line2D line = new Line2D.Double();
double x0 = dataArea.getMinX();
double x1 = dataArea.getMaxX();
g2.setPaint(im.getOutlinePaint());
g2.setStroke(im.getOutlineStroke());
}
else if(orientation == HORIZONTAL) {
Line2D line = new Line2D.Double();
double y0 = dataArea.getMinY();
double y1 = dataArea.getMaxY();
g2.setPaint(im.getOutlinePaint());
g2.setStroke(im.getOutlineStroke());
}
Detected clones
Control Structure
Matching
PDG
Mapping
differences
unmapped
statements
Precondition
Examination
Refactorable clones
13/20
Assessing the Refactorability of Software Clones, IEEE TSE, Nov. 2015
ICSE’2016 | Austin | May 19, 2016
Clone pair visualization
14/20
ICSE’2016 | Austin | May 19, 2016
Semantic tooltips
15/20
ICSE’2016 | Austin | May 19, 2016
Renamed variables
16/20
ICSE’2016 | Austin | May 19, 2016 17/20
ICSE’2016 | Austin | May 19, 2016
Automatic clone refactoring
Based on the location of the clones, the best
refactoring strategy is automatically determined
1. Extract Method (same file)
2. Pull Up Method (common superclass)
a) Template Method (clones call local methods)
b) Extract Superclass (external common superclass)
3. Introduce Utility Method (static clones)
18/20
ICSE’2016 | Austin | May 19, 2016
Refactoring Preview
19/20
ICSE’2016 | Austin | May 19, 2016
Future work
• Support multi-clone refactoring (>2 clones)
• Explore lambda expressions
• Automated refactoring engine testing
20/20
ICSE’2016 | Austin | May 19, 2016
Visit our project at
http://jdeodorant.org
21/20
ICSE’2016 | Austin | May 19, 2016
Advanced matches
22/20
ICSE’2016 | Austin | May 19, 2016
Advanced matches
23/20

More Related Content

Viewers also liked

Rio grande do sul
Rio grande do sulRio grande do sul
Rio grande do sul
Natayane
 
Efficient Model Partitioning for Distributed Model Transformations
Efficient Model Partitioning for Distributed Model TransformationsEfficient Model Partitioning for Distributed Model Transformations
Efficient Model Partitioning for Distributed Model Transformations
Amine Benelallam
 
Content Strategy for Naysayers
Content Strategy for NaysayersContent Strategy for Naysayers
Content Strategy for Naysayers
Rebecca Blakiston
 
Atividades AEE
Atividades AEEAtividades AEE
Atividades AEE
Marcos Alves
 
SiriusCon2016 - Extensible Sirius Editors for the Palladio Component Model
SiriusCon2016 - Extensible Sirius Editors for the Palladio Component ModelSiriusCon2016 - Extensible Sirius Editors for the Palladio Component Model
SiriusCon2016 - Extensible Sirius Editors for the Palladio Component Model
Obeo
 
All Electrical Engineering Formulas
All Electrical Engineering FormulasAll Electrical Engineering Formulas
Pirateship - growing a great crew: workshop facilitation guide
Pirateship - growing a great crew: workshop facilitation guidePirateship - growing a great crew: workshop facilitation guide
Pirateship - growing a great crew: workshop facilitation guide
Peter Antman
 
A Very British Black Friday: The Real Winners and Losers
A Very British Black Friday: The Real Winners and LosersA Very British Black Friday: The Real Winners and Losers
A Very British Black Friday: The Real Winners and Losers
FITCH
 
The Modern East, Jimmy Kmeid at Dubai Lynx
The Modern East, Jimmy Kmeid at Dubai LynxThe Modern East, Jimmy Kmeid at Dubai Lynx
The Modern East, Jimmy Kmeid at Dubai Lynx
FITCH
 
The rollercoaster of emotions: How brands and agencies can enjoy the ride
The rollercoaster of emotions: How brands and agencies can enjoy the rideThe rollercoaster of emotions: How brands and agencies can enjoy the ride
The rollercoaster of emotions: How brands and agencies can enjoy the ride
FITCH
 
Excel to TestLink
Excel to TestLinkExcel to TestLink
Excel to TestLink
Erol Selitektay
 
How Big is Your Lion? #CannesLions #EnlargeYourLion
How Big is Your Lion? #CannesLions #EnlargeYourLionHow Big is Your Lion? #CannesLions #EnlargeYourLion
How Big is Your Lion? #CannesLions #EnlargeYourLion
Aleksas Drozdovskis
 
User Story Workshop
User Story WorkshopUser Story Workshop
User Story Workshop
Peter Antman
 
Caderno de vocabulário
Caderno de vocabulário Caderno de vocabulário
Caderno de vocabulário
Isa ...
 
Aretha 2012
Aretha 2012Aretha 2012
Aretha 2012
Aretha Design
 
Dental caries
Dental cariesDental caries
Dental caries
Rajesh Bariker
 

Viewers also liked (16)

Rio grande do sul
Rio grande do sulRio grande do sul
Rio grande do sul
 
Efficient Model Partitioning for Distributed Model Transformations
Efficient Model Partitioning for Distributed Model TransformationsEfficient Model Partitioning for Distributed Model Transformations
Efficient Model Partitioning for Distributed Model Transformations
 
Content Strategy for Naysayers
Content Strategy for NaysayersContent Strategy for Naysayers
Content Strategy for Naysayers
 
Atividades AEE
Atividades AEEAtividades AEE
Atividades AEE
 
SiriusCon2016 - Extensible Sirius Editors for the Palladio Component Model
SiriusCon2016 - Extensible Sirius Editors for the Palladio Component ModelSiriusCon2016 - Extensible Sirius Editors for the Palladio Component Model
SiriusCon2016 - Extensible Sirius Editors for the Palladio Component Model
 
All Electrical Engineering Formulas
All Electrical Engineering FormulasAll Electrical Engineering Formulas
All Electrical Engineering Formulas
 
Pirateship - growing a great crew: workshop facilitation guide
Pirateship - growing a great crew: workshop facilitation guidePirateship - growing a great crew: workshop facilitation guide
Pirateship - growing a great crew: workshop facilitation guide
 
A Very British Black Friday: The Real Winners and Losers
A Very British Black Friday: The Real Winners and LosersA Very British Black Friday: The Real Winners and Losers
A Very British Black Friday: The Real Winners and Losers
 
The Modern East, Jimmy Kmeid at Dubai Lynx
The Modern East, Jimmy Kmeid at Dubai LynxThe Modern East, Jimmy Kmeid at Dubai Lynx
The Modern East, Jimmy Kmeid at Dubai Lynx
 
The rollercoaster of emotions: How brands and agencies can enjoy the ride
The rollercoaster of emotions: How brands and agencies can enjoy the rideThe rollercoaster of emotions: How brands and agencies can enjoy the ride
The rollercoaster of emotions: How brands and agencies can enjoy the ride
 
Excel to TestLink
Excel to TestLinkExcel to TestLink
Excel to TestLink
 
How Big is Your Lion? #CannesLions #EnlargeYourLion
How Big is Your Lion? #CannesLions #EnlargeYourLionHow Big is Your Lion? #CannesLions #EnlargeYourLion
How Big is Your Lion? #CannesLions #EnlargeYourLion
 
User Story Workshop
User Story WorkshopUser Story Workshop
User Story Workshop
 
Caderno de vocabulário
Caderno de vocabulário Caderno de vocabulário
Caderno de vocabulário
 
Aretha 2012
Aretha 2012Aretha 2012
Aretha 2012
 
Dental caries
Dental cariesDental caries
Dental caries
 

More from Nikolaos Tsantalis

Refactoring Mining - The key to unlock software evolution
Refactoring Mining - The key to unlock software evolutionRefactoring Mining - The key to unlock software evolution
Refactoring Mining - The key to unlock software evolution
Nikolaos Tsantalis
 
CASCON 2023 Most Influential Paper Award Talk
CASCON 2023 Most Influential Paper Award TalkCASCON 2023 Most Influential Paper Award Talk
CASCON 2023 Most Influential Paper Award Talk
Nikolaos Tsantalis
 
SANER 2019 Most Influential Paper Talk
SANER 2019 Most Influential Paper TalkSANER 2019 Most Influential Paper Talk
SANER 2019 Most Influential Paper Talk
Nikolaos Tsantalis
 
Accurate and Efficient Refactoring Detection in Commit History
Accurate and Efficient Refactoring Detection in Commit HistoryAccurate and Efficient Refactoring Detection in Commit History
Accurate and Efficient Refactoring Detection in Commit History
Nikolaos Tsantalis
 
Clone Refactoring with Lambda Expressions
Clone Refactoring with Lambda ExpressionsClone Refactoring with Lambda Expressions
Clone Refactoring with Lambda Expressions
Nikolaos Tsantalis
 
Why We Refactor? Confessions of GitHub Contributors
Why We Refactor? Confessions of GitHub ContributorsWhy We Refactor? Confessions of GitHub Contributors
Why We Refactor? Confessions of GitHub Contributors
Nikolaos Tsantalis
 
Migrating cascading style sheets to preprocessors
Migrating cascading style sheets to preprocessorsMigrating cascading style sheets to preprocessors
Migrating cascading style sheets to preprocessors
Nikolaos Tsantalis
 
An empirical study on the use of CSS preprocessors
An empirical study on the use of CSS preprocessorsAn empirical study on the use of CSS preprocessors
An empirical study on the use of CSS preprocessors
Nikolaos Tsantalis
 
An Empirical Study on the Use of CSS Preprocessors
An Empirical Study on the Use of CSS PreprocessorsAn Empirical Study on the Use of CSS Preprocessors
An Empirical Study on the Use of CSS Preprocessors
Nikolaos Tsantalis
 
Improving the Unification of Software Clones Using Tree and Graph Matching Al...
Improving the Unification of Software Clones Using Tree and Graph Matching Al...Improving the Unification of Software Clones Using Tree and Graph Matching Al...
Improving the Unification of Software Clones Using Tree and Graph Matching Al...
Nikolaos Tsantalis
 
Code Smell Research: History and Future Directions
Code Smell Research: History and Future DirectionsCode Smell Research: History and Future Directions
Code Smell Research: History and Future Directions
Nikolaos Tsantalis
 
Preventive Software Maintenance: The Past, the Present, the Future
Preventive Software Maintenance: The Past, the Present, the FuturePreventive Software Maintenance: The Past, the Present, the Future
Preventive Software Maintenance: The Past, the Present, the Future
Nikolaos Tsantalis
 
An Empirical Study of Duplication in Cascading Style Sheets
An Empirical Study of Duplication in Cascading Style SheetsAn Empirical Study of Duplication in Cascading Style Sheets
An Empirical Study of Duplication in Cascading Style Sheets
Nikolaos Tsantalis
 
Ranking Refactoring Suggestions based on Historical Volatility
Ranking Refactoring Suggestions based on Historical VolatilityRanking Refactoring Suggestions based on Historical Volatility
Ranking Refactoring Suggestions based on Historical Volatility
Nikolaos Tsantalis
 
Feature Detection in Ajax-enabled Web Applications
Feature Detection in Ajax-enabled Web ApplicationsFeature Detection in Ajax-enabled Web Applications
Feature Detection in Ajax-enabled Web Applications
Nikolaos Tsantalis
 
A Multidimensional Empirical Study on Refactoring Activity
A Multidimensional Empirical Study on Refactoring ActivityA Multidimensional Empirical Study on Refactoring Activity
A Multidimensional Empirical Study on Refactoring Activity
Nikolaos Tsantalis
 
Unification and Refactoring of Clones
Unification and Refactoring of ClonesUnification and Refactoring of Clones
Unification and Refactoring of Clones
Nikolaos Tsantalis
 

More from Nikolaos Tsantalis (17)

Refactoring Mining - The key to unlock software evolution
Refactoring Mining - The key to unlock software evolutionRefactoring Mining - The key to unlock software evolution
Refactoring Mining - The key to unlock software evolution
 
CASCON 2023 Most Influential Paper Award Talk
CASCON 2023 Most Influential Paper Award TalkCASCON 2023 Most Influential Paper Award Talk
CASCON 2023 Most Influential Paper Award Talk
 
SANER 2019 Most Influential Paper Talk
SANER 2019 Most Influential Paper TalkSANER 2019 Most Influential Paper Talk
SANER 2019 Most Influential Paper Talk
 
Accurate and Efficient Refactoring Detection in Commit History
Accurate and Efficient Refactoring Detection in Commit HistoryAccurate and Efficient Refactoring Detection in Commit History
Accurate and Efficient Refactoring Detection in Commit History
 
Clone Refactoring with Lambda Expressions
Clone Refactoring with Lambda ExpressionsClone Refactoring with Lambda Expressions
Clone Refactoring with Lambda Expressions
 
Why We Refactor? Confessions of GitHub Contributors
Why We Refactor? Confessions of GitHub ContributorsWhy We Refactor? Confessions of GitHub Contributors
Why We Refactor? Confessions of GitHub Contributors
 
Migrating cascading style sheets to preprocessors
Migrating cascading style sheets to preprocessorsMigrating cascading style sheets to preprocessors
Migrating cascading style sheets to preprocessors
 
An empirical study on the use of CSS preprocessors
An empirical study on the use of CSS preprocessorsAn empirical study on the use of CSS preprocessors
An empirical study on the use of CSS preprocessors
 
An Empirical Study on the Use of CSS Preprocessors
An Empirical Study on the Use of CSS PreprocessorsAn Empirical Study on the Use of CSS Preprocessors
An Empirical Study on the Use of CSS Preprocessors
 
Improving the Unification of Software Clones Using Tree and Graph Matching Al...
Improving the Unification of Software Clones Using Tree and Graph Matching Al...Improving the Unification of Software Clones Using Tree and Graph Matching Al...
Improving the Unification of Software Clones Using Tree and Graph Matching Al...
 
Code Smell Research: History and Future Directions
Code Smell Research: History and Future DirectionsCode Smell Research: History and Future Directions
Code Smell Research: History and Future Directions
 
Preventive Software Maintenance: The Past, the Present, the Future
Preventive Software Maintenance: The Past, the Present, the FuturePreventive Software Maintenance: The Past, the Present, the Future
Preventive Software Maintenance: The Past, the Present, the Future
 
An Empirical Study of Duplication in Cascading Style Sheets
An Empirical Study of Duplication in Cascading Style SheetsAn Empirical Study of Duplication in Cascading Style Sheets
An Empirical Study of Duplication in Cascading Style Sheets
 
Ranking Refactoring Suggestions based on Historical Volatility
Ranking Refactoring Suggestions based on Historical VolatilityRanking Refactoring Suggestions based on Historical Volatility
Ranking Refactoring Suggestions based on Historical Volatility
 
Feature Detection in Ajax-enabled Web Applications
Feature Detection in Ajax-enabled Web ApplicationsFeature Detection in Ajax-enabled Web Applications
Feature Detection in Ajax-enabled Web Applications
 
A Multidimensional Empirical Study on Refactoring Activity
A Multidimensional Empirical Study on Refactoring ActivityA Multidimensional Empirical Study on Refactoring Activity
A Multidimensional Empirical Study on Refactoring Activity
 
Unification and Refactoring of Clones
Unification and Refactoring of ClonesUnification and Refactoring of Clones
Unification and Refactoring of Clones
 

Recently uploaded

Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
TaghreedAltamimi
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
ISH Technologies
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
YAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring detailsYAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring details
NishanthaBulumulla1
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
gapen1
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
Karya Keeper
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
ShulagnaSarkar2
 

Recently uploaded (20)

Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
YAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring detailsYAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring details
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
 

JDeodorant: Clone Refactoring

  • 1. ICSE’2016 | Austin | May 19, 2016 Davood Mazinanian Nikolaos Tsantalis : Clone Refactoring Raphael Stein Zackary Valenta 1/20 38th International Conference on Software Engineering (ICSE'2016) Formal Tool Demonstration Session Department of Computer Science and Software Engineering Concordia University
  • 2. ICSE’2016 | Austin | May 19, 2016 Clones are harmful • Error-prone due to inconsistent updates (Juergens et al. @ ICSE’09) • Increase maintenance effort and cost (Lozano et al. @ ICSM’08) • Change-prone (Mondal et al. @ ACM SAC’12) 2/20
  • 3. ICSE’2016 | Austin | May 19, 2016 Clones are good • Positive impact on maintainability (Kasper & Godfrey @ EMSE’08) • Less buggy Less effort to fix bugs (Rahman, Bird & Devanbu @ EMSE’12) 3/20
  • 4. ICSE’2016 | Austin | May 19, 2016 Clone management Clones that change frequently & are buggy might need some refactoring 4/20
  • 5. ICSE’2016 | Austin | May 19, 2016 Motivation Current clone refactoring support is poor Tairas & Gray (IST’12) studied 1,200 Type-II clones detected in 9 open-source projects: • 10% could be refactored by Eclipse • CeDAR (IST’12) refactored 19% 5/20
  • 6. ICSE’2016 | Austin | May 19, 2016 Our goal Help developers: 1. Explore clone groups and understand their relations 2. Inspect and understand the differences between clones 3. Refactor safely the clones 6/20
  • 7. ICSE’2016 | Austin | May 19, 2016 7/20
  • 8. ICSE’2016 | Austin | May 19, 2016 Clone import 8/20
  • 9. ICSE’2016 | Austin | May 19, 2016 Subclone information 9/20
  • 10. ICSE’2016 | Austin | May 19, 2016 Clone filtering 10/20
  • 11. ICSE’2016 | Austin | May 19, 2016 Clone monitoring 11/20
  • 12. ICSE’2016 | Austin | May 19, 2016 12/20
  • 13. ICSE’2016 | Austin | May 19, 2016 Our approach common nesting trees if (orientation == VERTICAL) { Line2D line = new Line2D.Double(); double x0 = dataArea.getMinX(); double x1 = dataArea.getMaxX(); g2.setPaint(im.getOutlinePaint()); g2.setStroke(im.getOutlineStroke()); } if (orientation == VERTICAL) { Line2D line = new Line2D.Double(); double x0 = dataArea.getMinX(); double x1 = dataArea.getMaxX(); g2.setPaint(im.getOutlinePaint()); g2.setStroke(im.getOutlineStroke()); } else if(orientation == HORIZONTAL) { Line2D line = new Line2D.Double(); double y0 = dataArea.getMinY(); double y1 = dataArea.getMaxY(); g2.setPaint(im.getOutlinePaint()); g2.setStroke(im.getOutlineStroke()); } Detected clones Control Structure Matching PDG Mapping differences unmapped statements Precondition Examination Refactorable clones 13/20 Assessing the Refactorability of Software Clones, IEEE TSE, Nov. 2015
  • 14. ICSE’2016 | Austin | May 19, 2016 Clone pair visualization 14/20
  • 15. ICSE’2016 | Austin | May 19, 2016 Semantic tooltips 15/20
  • 16. ICSE’2016 | Austin | May 19, 2016 Renamed variables 16/20
  • 17. ICSE’2016 | Austin | May 19, 2016 17/20
  • 18. ICSE’2016 | Austin | May 19, 2016 Automatic clone refactoring Based on the location of the clones, the best refactoring strategy is automatically determined 1. Extract Method (same file) 2. Pull Up Method (common superclass) a) Template Method (clones call local methods) b) Extract Superclass (external common superclass) 3. Introduce Utility Method (static clones) 18/20
  • 19. ICSE’2016 | Austin | May 19, 2016 Refactoring Preview 19/20
  • 20. ICSE’2016 | Austin | May 19, 2016 Future work • Support multi-clone refactoring (>2 clones) • Explore lambda expressions • Automated refactoring engine testing 20/20
  • 21. ICSE’2016 | Austin | May 19, 2016 Visit our project at http://jdeodorant.org 21/20
  • 22. ICSE’2016 | Austin | May 19, 2016 Advanced matches 22/20
  • 23. ICSE’2016 | Austin | May 19, 2016 Advanced matches 23/20

Editor's Notes

  1. so that we don’t have to apply the same changes multiple times.
  2. The import wizard checks if the clone fragments actually exist in the examined project. And fixes the clone instances that are syntactically incomplete (e.g., missing closing brackets, incomplete statements)
  3. Group A is a subclone of group B, if every clone instance in A is a subclone (i.e., a partial code fragment) of an instance in B.
  4. Group A is a subclone of group B, if every clone instance in A is a subclone (i.e., a partial code fragment) of an instance in B.
  5. In yellow color, we highlight the differences between matched statements. In red color, we highlight the statements that could not be matched. In green color we highlight semantically equivalent statements (statement having a different AST structure, but identical functionality)