SlideShare a Scribd company logo
Recommending Refactoring Operations in Large 
Software SystemsPósGraduaçãoemCiênciadaComputaçãoAluno:CarlosEduardoDantasOrientador:MarceloMaia
Recommending Refactoring Operations in Large Software SystemsIntroduction 
•During its lifecycle, the internal structure of a Software system undergoes continuous modifications; 
•Source code quality often decreases; 
•Low quality is generally associated with lower productivity, more rework and more effort for developers.
Recommending Refactoring Operations in Large Software SystemsRefactoring 
•Process of changing Software System to improve its internal structure; 
•Help in removing codebad smells as well as antipatterns; 
•Improve Architeture and provide better Software extensibility.
Recommending Refactoring Operations in Large Software SystemsChallenges on Refactoring code 
•Design flaws are not always obvious; 
•Its not easy to apply the correct refactoring operation to solve design problems; 
•Apply the refactoring solution without changing the external behaviour of the system; 
•Manual refactoring is an error-prone task.
Recommending Refactoring Operations in Large Software SystemsChallenges on Refactoring code 
•Refactoring recommendation systems supports: 
Identifying refactoring opportunities; 
Designing and applying a refactoring solution.
Recommending Refactoring Operations in Large Software SystemsRefactoring operations catalog 
•Some refactoring operations, classified on the benefits provided to the source code. 
Improving Code Decomposition 
Extract Class 
Extract Package 
Extract Method 
Improving names and location of code 
Rename method (field) 
Move method 
Move class 
Improving Conformance with OOP principles 
Push down field/method 
Pull up field/method 
Extract/collapse hierarchy
Recommending Refactoring Operations in Large Software SystemsAlgorithms exploited to identify refactoring recommendations 
RefactoringOperation 
Approach 
Extract Class 
Clustering-basedor Graph-based 
Move Method 
Heuristic-based or Search-based 
Extract Method 
Slicing-based 
Extract Package 
Graph-based 
Move Class 
Search-based or Heuristic-based 
Combination of multiple operations 
Search-based 
•This presentation will discuss only Extract Class Refactoring approaches.
Recommending Refactoring Operations in Large Software SystemsExtract Class Refactoring 
•In OOP design, classes are called “God Class”, “System Class” or “Blob Class” when become very large, less cohesive and exhibit high levels of coupling; 
•Class should implement only one concept, having only one reason to change; 
•Extract class split the responsabilities implemented on Blob classes into different classes with higher cohesion.
Recommending Refactoring Operations in Large Software SystemsExtract Class Refactoring with Clustering-Based algorithm 
•Clustering methods can identify conceptually meaningful groups of similar entities; 
•Clusters may represent cohesive groups of class members; 
•Clusters compute an entity set for each attribute and invoke method.
Recommending Refactoring Operations in Large Software SystemsClustering-Based algorithm – extract entities
Recommending Refactoring Operations in Large Software SystemsClustering-Based algorithm – entity set 
a1 
name 
changeJob 
modifyName 
getTelephoneNumber 
a2 
job 
changeJob 
modifyName 
getTelephoneNumber 
a3 
officeAreaCode 
getTelephoneNumber 
a4 
officeNumber 
getTelephoneNumber 
m1 
changeJob 
job 
name 
m2 
modifyName 
job 
name 
m3 
getTelephoneNumber 
job 
name 
officeAreaCode 
officeAreaNumber
Recommending Refactoring Operations in Large Software SystemsClustering-Based algorithm – Jaccard method 
•Jaccard method calculate the distance between entities, generating distance matrix.
Recommending Refactoring Operations in Large Software SystemsClustering-Based algorithm – cluster deondrogram 
•Cluster´s hierarchy is usually represented by a deondrogram.
Recommending Refactoring Operations in Large Software SystemsClustering-Based algorithm – Evaluation 
Software 
Total Suggestions 
Assigned Names 
Applied 
eRisk 
37 
28 
16 
SelfPlanner 
14 
12 
9
Recommending Refactoring Operations in Large Software SystemsGraph-Based algorithm – class extraction process 
•The candidate class is parsed to build a method-by-method matrix; 
•NxN matrix where n is the number of methods of class to be refatored; 
•Each entry represents the likelihood that method mi and method mj should be in the same class; 
•Identify chains of strongly related or coupled methods.
Recommending Refactoring Operations in Large Software SystemsGraph-Based algorithm – class extraction process
Recommending Refactoring Operations in Large Software SystemsGraph-Based algorithm Method-by-method matrix 
•Structural Similarity between Methods; 
•Call-based dependence between methods; 
•Conceptual similarity between methods.
Recommending Refactoring Operations in Large Software SystemsGraph-Based algorithmMethod-by-method matrix
Recommending Refactoring Operations in Large Software SystemsGraph-Based algorithmIdentifying candidate chains 
Constant Threshold 
Variable Threshold
Recommending Refactoring Operations in Large Software SystemsGraph-Basedalgorithm – Evaluation 
•Created an artificial scenario, where classes with high cohesion of five open source systems have been merged to build classes with low cohesion and many responsibilities
Recommending Refactoring Operations in Large Software SystemsGraph-Basedalgorithm – Evaluation 
•Constant threshold (0.1,0.2,0.3,0.4)
Recommending Refactoring Operations in Large Software SystemsGraph-Basedalgorithm – Evaluation 
•Variable threshold (Q1,Q2,Q3)
Recommending Refactoring Operations in Large Software SystemsGraph-Basedalgorithm – Evaluation 
•Interaction between weight and variable threshold on JHotDraw merging 2 classes
Recommending Refactoring Operations in Large Software SystemsGraph-Basedalgorithm – Evaluation 
•Interaction between weight and variable threshold on JHotDraw merging 3 classes
Recommending Refactoring Operations in Large Software SystemsGraph-Basedalgorithm – Evaluation 
•Interaction between weight and system merging 2 classes
Recommending Refactoring Operations in Large Software SystemsGraph-Basedalgorithm – Evaluation 
•Interaction between weight and system merging 3 classes
Recommending Refactoring Operations in Large Software SystemsReferences 
•[1] Robillard, Martin P.:, Maalej, Wallid.: Recommendation Systems in Software Engineering. Springer, 2014; 
•[2] Fokaefs, M., Tsantalis, N., Chatzigeorgiou, A., Sander, J.: Decomposing object-oriented class modules using an agglomerative clustering technique. In: Proceedings of the IEEE International Conference on Software Maintenance, (2009); 
•[3] Fowler, M.: Refactoring: improving the design of existing code. Addison-Wesley, Reading, 1999;
Recommending Refactoring Operations in Large Software SystemsReferences 
•[4] Fokaefs, M., Tsantalis, N., Stroulia, E., Chatzigeorgiou, A.: Identification and application of extract class refactoringsin object-oriented systems. J. Syst. Software 85(10), 2012; 
•[5] Bavota, G., De Lucia, A., Marcus, A., Oliveto, R.: Automating extract class refactoring: a Novel Approach and its Evaluation, 2011; 
•[6] Bavota, G., De Lucia, A., Marcus, A., Oliveto, R.: In Medio Stat Virtus: Extract Class Refactoring through Nash Equilibria, 2011.
Recommending Refactoring Operations in Large Software SystemsAppendix –Another Graph- Based algorithm example 
Method 
Instance variables 
changeJob 
{job,name} 
modifyName 
{job,name} 
getTelephoneNumber 
{job,name,officeAreaCode,officeNumber} 
CJ 
MN 
GT 
CJ 
1 
1 
0,5 
MN 
1 
1 
0,5 
GT 
0,5 
0,5 
1 
Method 
Callmethods 
changeJob 
{} 
modifyName 
{} 
getTelephoneNumber 
{} 
CJ 
MN 
GT 
CJ 
1 
1 
0 
MN 
0 
1 
0 
GT 
0 
0 
1 
Method 
Conceptual Similarity 
changeJob 
{} 
modifyName 
{} 
getTelephoneNumber 
{} 
CJ 
MN 
GT 
CJ 
1 
0.7 
0.1 
MN 
0.7 
1 
0.1 
GT 
0.1 
0.1 
1
Recommending Refactoring Operations in Large Software SystemsAppendix –Another Graph- Based algorithm example 
CJ 
MN 
GT 
CJ 
1 
0.7 
0.2 
MN 
0.7 
1 
0.2 
GT 
0.2 
0.2 
1

More Related Content

Similar to Recommending refactoring operations in large software systems

Process model rup
Process model rupProcess model rup
Process model rup
Aryan Ajmer
 
AnalyticOps: Lessons Learned Moving Machine-Learning Algorithms to Production...
AnalyticOps: Lessons Learned Moving Machine-Learning Algorithms to Production...AnalyticOps: Lessons Learned Moving Machine-Learning Algorithms to Production...
AnalyticOps: Lessons Learned Moving Machine-Learning Algorithms to Production...
Robert Grossman
 
Few minutes To better Code - Refactoring
Few minutes To better Code - RefactoringFew minutes To better Code - Refactoring
Few minutes To better Code - Refactoring
Diaa Al-Salehi
 
Ph.D. Dissertation Defense
Ph.D. Dissertation Defense Ph.D. Dissertation Defense
Ph.D. Dissertation Defense
Ahrim Han, Ph.D.
 
Software evolution and maintenance basic concepts and preliminaries
Software evolution and maintenance   basic concepts and preliminariesSoftware evolution and maintenance   basic concepts and preliminaries
Software evolution and maintenance basic concepts and preliminaries
Moutasm Tamimi
 
the application of machine lerning algorithm for SEE
the application of machine lerning algorithm for SEEthe application of machine lerning algorithm for SEE
the application of machine lerning algorithm for SEE
KiranKumar671235
 
Bdd with m spec
Bdd with m specBdd with m spec
Bdd with m spec
Pavneet Singh Saund
 
Foutse_Khomh.pptx
Foutse_Khomh.pptxFoutse_Khomh.pptx
Foutse_Khomh.pptx
Foutse Khomh
 
Ranking The Refactoring Techniques Based on The External Quality Attributes
Ranking The Refactoring Techniques Based on The External Quality AttributesRanking The Refactoring Techniques Based on The External Quality Attributes
Ranking The Refactoring Techniques Based on The External Quality Attributes
IJRES Journal
 
Applying Machine Learning to Software Clustering
Applying Machine Learning to Software ClusteringApplying Machine Learning to Software Clustering
Applying Machine Learning to Software Clustering
butest
 
software Engineering process
software Engineering processsoftware Engineering process
software Engineering process
Raheel Aslam
 
Aspect Oriented Programming
Aspect Oriented ProgrammingAspect Oriented Programming
Aspect Oriented Programming
Shreya Chatterjee
 
Modern Software Architecture
Modern Software Architecture Modern Software Architecture
Modern Software Architecture
Ahmed Marzouk
 
Unit 5- Architectural Design in software engineering
Unit 5- Architectural Design in software engineering Unit 5- Architectural Design in software engineering
Unit 5- Architectural Design in software engineering
arvind pandey
 
Apsec 2014 Presentation
Apsec 2014 PresentationApsec 2014 Presentation
Apsec 2014 Presentation
Ahrim Han, Ph.D.
 
Preparing for DevOps
Preparing for DevOpsPreparing for DevOps
Preparing for DevOps
Eklove Mohan
 
Design p atterns
Design p atternsDesign p atterns
Design p atterns
Amr Abd El Latief
 
How to Lower the Cost of Deploying Analytics: An Introduction to the Portable...
How to Lower the Cost of Deploying Analytics: An Introduction to the Portable...How to Lower the Cost of Deploying Analytics: An Introduction to the Portable...
How to Lower the Cost of Deploying Analytics: An Introduction to the Portable...
Robert Grossman
 
Data structure design in SE
Data structure  design in SEData structure  design in SE
Data structure design in SE
Dr. Somnath Sinha
 
The recommendations system for source code components retrieval
The recommendations system for source code components retrievalThe recommendations system for source code components retrieval
The recommendations system for source code components retrieval
AYESHA JAVED
 

Similar to Recommending refactoring operations in large software systems (20)

Process model rup
Process model rupProcess model rup
Process model rup
 
AnalyticOps: Lessons Learned Moving Machine-Learning Algorithms to Production...
AnalyticOps: Lessons Learned Moving Machine-Learning Algorithms to Production...AnalyticOps: Lessons Learned Moving Machine-Learning Algorithms to Production...
AnalyticOps: Lessons Learned Moving Machine-Learning Algorithms to Production...
 
Few minutes To better Code - Refactoring
Few minutes To better Code - RefactoringFew minutes To better Code - Refactoring
Few minutes To better Code - Refactoring
 
Ph.D. Dissertation Defense
Ph.D. Dissertation Defense Ph.D. Dissertation Defense
Ph.D. Dissertation Defense
 
Software evolution and maintenance basic concepts and preliminaries
Software evolution and maintenance   basic concepts and preliminariesSoftware evolution and maintenance   basic concepts and preliminaries
Software evolution and maintenance basic concepts and preliminaries
 
the application of machine lerning algorithm for SEE
the application of machine lerning algorithm for SEEthe application of machine lerning algorithm for SEE
the application of machine lerning algorithm for SEE
 
Bdd with m spec
Bdd with m specBdd with m spec
Bdd with m spec
 
Foutse_Khomh.pptx
Foutse_Khomh.pptxFoutse_Khomh.pptx
Foutse_Khomh.pptx
 
Ranking The Refactoring Techniques Based on The External Quality Attributes
Ranking The Refactoring Techniques Based on The External Quality AttributesRanking The Refactoring Techniques Based on The External Quality Attributes
Ranking The Refactoring Techniques Based on The External Quality Attributes
 
Applying Machine Learning to Software Clustering
Applying Machine Learning to Software ClusteringApplying Machine Learning to Software Clustering
Applying Machine Learning to Software Clustering
 
software Engineering process
software Engineering processsoftware Engineering process
software Engineering process
 
Aspect Oriented Programming
Aspect Oriented ProgrammingAspect Oriented Programming
Aspect Oriented Programming
 
Modern Software Architecture
Modern Software Architecture Modern Software Architecture
Modern Software Architecture
 
Unit 5- Architectural Design in software engineering
Unit 5- Architectural Design in software engineering Unit 5- Architectural Design in software engineering
Unit 5- Architectural Design in software engineering
 
Apsec 2014 Presentation
Apsec 2014 PresentationApsec 2014 Presentation
Apsec 2014 Presentation
 
Preparing for DevOps
Preparing for DevOpsPreparing for DevOps
Preparing for DevOps
 
Design p atterns
Design p atternsDesign p atterns
Design p atterns
 
How to Lower the Cost of Deploying Analytics: An Introduction to the Portable...
How to Lower the Cost of Deploying Analytics: An Introduction to the Portable...How to Lower the Cost of Deploying Analytics: An Introduction to the Portable...
How to Lower the Cost of Deploying Analytics: An Introduction to the Portable...
 
Data structure design in SE
Data structure  design in SEData structure  design in SE
Data structure design in SE
 
The recommendations system for source code components retrieval
The recommendations system for source code components retrievalThe recommendations system for source code components retrieval
The recommendations system for source code components retrieval
 

More from Carlos Eduardo

When and Why Your Code Starts to Smell Bad
When and Why Your Code Starts to Smell BadWhen and Why Your Code Starts to Smell Bad
When and Why Your Code Starts to Smell Bad
Carlos Eduardo
 
Experimentos envolvendo ações de Rejuvenescimento de Software
Experimentos envolvendo ações de Rejuvenescimento de SoftwareExperimentos envolvendo ações de Rejuvenescimento de Software
Experimentos envolvendo ações de Rejuvenescimento de Software
Carlos Eduardo
 
A Measurement-Based Model for Estimation of Resource Exhaustion in Operationa...
A Measurement-Based Model for Estimation of Resource Exhaustion in Operationa...A Measurement-Based Model for Estimation of Resource Exhaustion in Operationa...
A Measurement-Based Model for Estimation of Resource Exhaustion in Operationa...
Carlos Eduardo
 
Programação Orientada a Objetos - Pós Graduação - Aula 8 - Bad Smells & Desig...
Programação Orientada a Objetos - Pós Graduação - Aula 8 - Bad Smells & Desig...Programação Orientada a Objetos - Pós Graduação - Aula 8 - Bad Smells & Desig...
Programação Orientada a Objetos - Pós Graduação - Aula 8 - Bad Smells & Desig...
Carlos Eduardo
 
Programação Orientada a Objetos - Pós Graduação - Aula 7 - Inversão de Controle
Programação Orientada a Objetos - Pós Graduação - Aula 7 - Inversão de ControleProgramação Orientada a Objetos - Pós Graduação - Aula 7 - Inversão de Controle
Programação Orientada a Objetos - Pós Graduação - Aula 7 - Inversão de Controle
Carlos Eduardo
 
Programação Orientada a Objetos - Pós Graduação - Aula 6 - Princípios OO
Programação Orientada a Objetos - Pós Graduação - Aula 6 - Princípios OOProgramação Orientada a Objetos - Pós Graduação - Aula 6 - Princípios OO
Programação Orientada a Objetos - Pós Graduação - Aula 6 - Princípios OO
Carlos Eduardo
 
Socket Descriptor Leak encontrado na JDK
Socket Descriptor Leak encontrado na JDKSocket Descriptor Leak encontrado na JDK
Socket Descriptor Leak encontrado na JDK
Carlos Eduardo
 
Programação Orientada a Objetos - Pós Graduação - Aula 5 - refactoring com ho...
Programação Orientada a Objetos - Pós Graduação - Aula 5 - refactoring com ho...Programação Orientada a Objetos - Pós Graduação - Aula 5 - refactoring com ho...
Programação Orientada a Objetos - Pós Graduação - Aula 5 - refactoring com ho...
Carlos Eduardo
 
Programação Orientada a Objetos - Pós Graduação - Aula 4 - refactoring com ho...
Programação Orientada a Objetos - Pós Graduação - Aula 4 - refactoring com ho...Programação Orientada a Objetos - Pós Graduação - Aula 4 - refactoring com ho...
Programação Orientada a Objetos - Pós Graduação - Aula 4 - refactoring com ho...
Carlos Eduardo
 
Programação Orientada a Objetos - Pós Graduação - Aula 3
Programação Orientada a Objetos - Pós Graduação - Aula 3Programação Orientada a Objetos - Pós Graduação - Aula 3
Programação Orientada a Objetos - Pós Graduação - Aula 3
Carlos Eduardo
 
Programação Orientada a Objetos - Pós Graduação - Aula 2
Programação Orientada a Objetos - Pós Graduação - Aula 2Programação Orientada a Objetos - Pós Graduação - Aula 2
Programação Orientada a Objetos - Pós Graduação - Aula 2
Carlos Eduardo
 
Programação Orientada a Objetos - Pós Graduação - aula 1
Programação Orientada a Objetos - Pós Graduação - aula 1Programação Orientada a Objetos - Pós Graduação - aula 1
Programação Orientada a Objetos - Pós Graduação - aula 1
Carlos Eduardo
 
Máquinas de turing com memória limitada
Máquinas de turing com memória limitadaMáquinas de turing com memória limitada
Máquinas de turing com memória limitada
Carlos Eduardo
 
Detecting bad smells in source code using change history information
Detecting bad smells in source code using change history informationDetecting bad smells in source code using change history information
Detecting bad smells in source code using change history information
Carlos Eduardo
 
Mini Curso - Programação de Interfaces Gráficas - aula extra persistência
Mini Curso - Programação de Interfaces Gráficas - aula extra persistênciaMini Curso - Programação de Interfaces Gráficas - aula extra persistência
Mini Curso - Programação de Interfaces Gráficas - aula extra persistência
Carlos Eduardo
 
Mini Curso - Programação de Interfaces Gráficas - aula 4
Mini Curso - Programação de Interfaces Gráficas - aula 4Mini Curso - Programação de Interfaces Gráficas - aula 4
Mini Curso - Programação de Interfaces Gráficas - aula 4
Carlos Eduardo
 
Mini Curso - Programação de Interfaces Gráficas - aula 3
Mini Curso - Programação de Interfaces Gráficas - aula 3Mini Curso - Programação de Interfaces Gráficas - aula 3
Mini Curso - Programação de Interfaces Gráficas - aula 3
Carlos Eduardo
 
Mini Curso - Programação de Interfaces Gráficas - aula 2
Mini Curso - Programação de Interfaces Gráficas - aula 2Mini Curso - Programação de Interfaces Gráficas - aula 2
Mini Curso - Programação de Interfaces Gráficas - aula 2
Carlos Eduardo
 
Mini Curso - Programação de Interfaces Gráficas - aula 1
Mini Curso - Programação de Interfaces Gráficas - aula 1Mini Curso - Programação de Interfaces Gráficas - aula 1
Mini Curso - Programação de Interfaces Gráficas - aula 1
Carlos Eduardo
 
NoSql
NoSqlNoSql

More from Carlos Eduardo (20)

When and Why Your Code Starts to Smell Bad
When and Why Your Code Starts to Smell BadWhen and Why Your Code Starts to Smell Bad
When and Why Your Code Starts to Smell Bad
 
Experimentos envolvendo ações de Rejuvenescimento de Software
Experimentos envolvendo ações de Rejuvenescimento de SoftwareExperimentos envolvendo ações de Rejuvenescimento de Software
Experimentos envolvendo ações de Rejuvenescimento de Software
 
A Measurement-Based Model for Estimation of Resource Exhaustion in Operationa...
A Measurement-Based Model for Estimation of Resource Exhaustion in Operationa...A Measurement-Based Model for Estimation of Resource Exhaustion in Operationa...
A Measurement-Based Model for Estimation of Resource Exhaustion in Operationa...
 
Programação Orientada a Objetos - Pós Graduação - Aula 8 - Bad Smells & Desig...
Programação Orientada a Objetos - Pós Graduação - Aula 8 - Bad Smells & Desig...Programação Orientada a Objetos - Pós Graduação - Aula 8 - Bad Smells & Desig...
Programação Orientada a Objetos - Pós Graduação - Aula 8 - Bad Smells & Desig...
 
Programação Orientada a Objetos - Pós Graduação - Aula 7 - Inversão de Controle
Programação Orientada a Objetos - Pós Graduação - Aula 7 - Inversão de ControleProgramação Orientada a Objetos - Pós Graduação - Aula 7 - Inversão de Controle
Programação Orientada a Objetos - Pós Graduação - Aula 7 - Inversão de Controle
 
Programação Orientada a Objetos - Pós Graduação - Aula 6 - Princípios OO
Programação Orientada a Objetos - Pós Graduação - Aula 6 - Princípios OOProgramação Orientada a Objetos - Pós Graduação - Aula 6 - Princípios OO
Programação Orientada a Objetos - Pós Graduação - Aula 6 - Princípios OO
 
Socket Descriptor Leak encontrado na JDK
Socket Descriptor Leak encontrado na JDKSocket Descriptor Leak encontrado na JDK
Socket Descriptor Leak encontrado na JDK
 
Programação Orientada a Objetos - Pós Graduação - Aula 5 - refactoring com ho...
Programação Orientada a Objetos - Pós Graduação - Aula 5 - refactoring com ho...Programação Orientada a Objetos - Pós Graduação - Aula 5 - refactoring com ho...
Programação Orientada a Objetos - Pós Graduação - Aula 5 - refactoring com ho...
 
Programação Orientada a Objetos - Pós Graduação - Aula 4 - refactoring com ho...
Programação Orientada a Objetos - Pós Graduação - Aula 4 - refactoring com ho...Programação Orientada a Objetos - Pós Graduação - Aula 4 - refactoring com ho...
Programação Orientada a Objetos - Pós Graduação - Aula 4 - refactoring com ho...
 
Programação Orientada a Objetos - Pós Graduação - Aula 3
Programação Orientada a Objetos - Pós Graduação - Aula 3Programação Orientada a Objetos - Pós Graduação - Aula 3
Programação Orientada a Objetos - Pós Graduação - Aula 3
 
Programação Orientada a Objetos - Pós Graduação - Aula 2
Programação Orientada a Objetos - Pós Graduação - Aula 2Programação Orientada a Objetos - Pós Graduação - Aula 2
Programação Orientada a Objetos - Pós Graduação - Aula 2
 
Programação Orientada a Objetos - Pós Graduação - aula 1
Programação Orientada a Objetos - Pós Graduação - aula 1Programação Orientada a Objetos - Pós Graduação - aula 1
Programação Orientada a Objetos - Pós Graduação - aula 1
 
Máquinas de turing com memória limitada
Máquinas de turing com memória limitadaMáquinas de turing com memória limitada
Máquinas de turing com memória limitada
 
Detecting bad smells in source code using change history information
Detecting bad smells in source code using change history informationDetecting bad smells in source code using change history information
Detecting bad smells in source code using change history information
 
Mini Curso - Programação de Interfaces Gráficas - aula extra persistência
Mini Curso - Programação de Interfaces Gráficas - aula extra persistênciaMini Curso - Programação de Interfaces Gráficas - aula extra persistência
Mini Curso - Programação de Interfaces Gráficas - aula extra persistência
 
Mini Curso - Programação de Interfaces Gráficas - aula 4
Mini Curso - Programação de Interfaces Gráficas - aula 4Mini Curso - Programação de Interfaces Gráficas - aula 4
Mini Curso - Programação de Interfaces Gráficas - aula 4
 
Mini Curso - Programação de Interfaces Gráficas - aula 3
Mini Curso - Programação de Interfaces Gráficas - aula 3Mini Curso - Programação de Interfaces Gráficas - aula 3
Mini Curso - Programação de Interfaces Gráficas - aula 3
 
Mini Curso - Programação de Interfaces Gráficas - aula 2
Mini Curso - Programação de Interfaces Gráficas - aula 2Mini Curso - Programação de Interfaces Gráficas - aula 2
Mini Curso - Programação de Interfaces Gráficas - aula 2
 
Mini Curso - Programação de Interfaces Gráficas - aula 1
Mini Curso - Programação de Interfaces Gráficas - aula 1Mini Curso - Programação de Interfaces Gráficas - aula 1
Mini Curso - Programação de Interfaces Gráficas - aula 1
 
NoSql
NoSqlNoSql
NoSql
 

Recently uploaded

leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
GDSC PJATK
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Jeffrey Haguewood
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 

Recently uploaded (20)

leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 

Recommending refactoring operations in large software systems

  • 1. Recommending Refactoring Operations in Large Software SystemsPósGraduaçãoemCiênciadaComputaçãoAluno:CarlosEduardoDantasOrientador:MarceloMaia
  • 2. Recommending Refactoring Operations in Large Software SystemsIntroduction •During its lifecycle, the internal structure of a Software system undergoes continuous modifications; •Source code quality often decreases; •Low quality is generally associated with lower productivity, more rework and more effort for developers.
  • 3. Recommending Refactoring Operations in Large Software SystemsRefactoring •Process of changing Software System to improve its internal structure; •Help in removing codebad smells as well as antipatterns; •Improve Architeture and provide better Software extensibility.
  • 4. Recommending Refactoring Operations in Large Software SystemsChallenges on Refactoring code •Design flaws are not always obvious; •Its not easy to apply the correct refactoring operation to solve design problems; •Apply the refactoring solution without changing the external behaviour of the system; •Manual refactoring is an error-prone task.
  • 5. Recommending Refactoring Operations in Large Software SystemsChallenges on Refactoring code •Refactoring recommendation systems supports: Identifying refactoring opportunities; Designing and applying a refactoring solution.
  • 6. Recommending Refactoring Operations in Large Software SystemsRefactoring operations catalog •Some refactoring operations, classified on the benefits provided to the source code. Improving Code Decomposition Extract Class Extract Package Extract Method Improving names and location of code Rename method (field) Move method Move class Improving Conformance with OOP principles Push down field/method Pull up field/method Extract/collapse hierarchy
  • 7. Recommending Refactoring Operations in Large Software SystemsAlgorithms exploited to identify refactoring recommendations RefactoringOperation Approach Extract Class Clustering-basedor Graph-based Move Method Heuristic-based or Search-based Extract Method Slicing-based Extract Package Graph-based Move Class Search-based or Heuristic-based Combination of multiple operations Search-based •This presentation will discuss only Extract Class Refactoring approaches.
  • 8. Recommending Refactoring Operations in Large Software SystemsExtract Class Refactoring •In OOP design, classes are called “God Class”, “System Class” or “Blob Class” when become very large, less cohesive and exhibit high levels of coupling; •Class should implement only one concept, having only one reason to change; •Extract class split the responsabilities implemented on Blob classes into different classes with higher cohesion.
  • 9. Recommending Refactoring Operations in Large Software SystemsExtract Class Refactoring with Clustering-Based algorithm •Clustering methods can identify conceptually meaningful groups of similar entities; •Clusters may represent cohesive groups of class members; •Clusters compute an entity set for each attribute and invoke method.
  • 10. Recommending Refactoring Operations in Large Software SystemsClustering-Based algorithm – extract entities
  • 11. Recommending Refactoring Operations in Large Software SystemsClustering-Based algorithm – entity set a1 name changeJob modifyName getTelephoneNumber a2 job changeJob modifyName getTelephoneNumber a3 officeAreaCode getTelephoneNumber a4 officeNumber getTelephoneNumber m1 changeJob job name m2 modifyName job name m3 getTelephoneNumber job name officeAreaCode officeAreaNumber
  • 12. Recommending Refactoring Operations in Large Software SystemsClustering-Based algorithm – Jaccard method •Jaccard method calculate the distance between entities, generating distance matrix.
  • 13. Recommending Refactoring Operations in Large Software SystemsClustering-Based algorithm – cluster deondrogram •Cluster´s hierarchy is usually represented by a deondrogram.
  • 14. Recommending Refactoring Operations in Large Software SystemsClustering-Based algorithm – Evaluation Software Total Suggestions Assigned Names Applied eRisk 37 28 16 SelfPlanner 14 12 9
  • 15. Recommending Refactoring Operations in Large Software SystemsGraph-Based algorithm – class extraction process •The candidate class is parsed to build a method-by-method matrix; •NxN matrix where n is the number of methods of class to be refatored; •Each entry represents the likelihood that method mi and method mj should be in the same class; •Identify chains of strongly related or coupled methods.
  • 16. Recommending Refactoring Operations in Large Software SystemsGraph-Based algorithm – class extraction process
  • 17. Recommending Refactoring Operations in Large Software SystemsGraph-Based algorithm Method-by-method matrix •Structural Similarity between Methods; •Call-based dependence between methods; •Conceptual similarity between methods.
  • 18. Recommending Refactoring Operations in Large Software SystemsGraph-Based algorithmMethod-by-method matrix
  • 19. Recommending Refactoring Operations in Large Software SystemsGraph-Based algorithmIdentifying candidate chains Constant Threshold Variable Threshold
  • 20. Recommending Refactoring Operations in Large Software SystemsGraph-Basedalgorithm – Evaluation •Created an artificial scenario, where classes with high cohesion of five open source systems have been merged to build classes with low cohesion and many responsibilities
  • 21. Recommending Refactoring Operations in Large Software SystemsGraph-Basedalgorithm – Evaluation •Constant threshold (0.1,0.2,0.3,0.4)
  • 22. Recommending Refactoring Operations in Large Software SystemsGraph-Basedalgorithm – Evaluation •Variable threshold (Q1,Q2,Q3)
  • 23. Recommending Refactoring Operations in Large Software SystemsGraph-Basedalgorithm – Evaluation •Interaction between weight and variable threshold on JHotDraw merging 2 classes
  • 24. Recommending Refactoring Operations in Large Software SystemsGraph-Basedalgorithm – Evaluation •Interaction between weight and variable threshold on JHotDraw merging 3 classes
  • 25. Recommending Refactoring Operations in Large Software SystemsGraph-Basedalgorithm – Evaluation •Interaction between weight and system merging 2 classes
  • 26. Recommending Refactoring Operations in Large Software SystemsGraph-Basedalgorithm – Evaluation •Interaction between weight and system merging 3 classes
  • 27. Recommending Refactoring Operations in Large Software SystemsReferences •[1] Robillard, Martin P.:, Maalej, Wallid.: Recommendation Systems in Software Engineering. Springer, 2014; •[2] Fokaefs, M., Tsantalis, N., Chatzigeorgiou, A., Sander, J.: Decomposing object-oriented class modules using an agglomerative clustering technique. In: Proceedings of the IEEE International Conference on Software Maintenance, (2009); •[3] Fowler, M.: Refactoring: improving the design of existing code. Addison-Wesley, Reading, 1999;
  • 28. Recommending Refactoring Operations in Large Software SystemsReferences •[4] Fokaefs, M., Tsantalis, N., Stroulia, E., Chatzigeorgiou, A.: Identification and application of extract class refactoringsin object-oriented systems. J. Syst. Software 85(10), 2012; •[5] Bavota, G., De Lucia, A., Marcus, A., Oliveto, R.: Automating extract class refactoring: a Novel Approach and its Evaluation, 2011; •[6] Bavota, G., De Lucia, A., Marcus, A., Oliveto, R.: In Medio Stat Virtus: Extract Class Refactoring through Nash Equilibria, 2011.
  • 29. Recommending Refactoring Operations in Large Software SystemsAppendix –Another Graph- Based algorithm example Method Instance variables changeJob {job,name} modifyName {job,name} getTelephoneNumber {job,name,officeAreaCode,officeNumber} CJ MN GT CJ 1 1 0,5 MN 1 1 0,5 GT 0,5 0,5 1 Method Callmethods changeJob {} modifyName {} getTelephoneNumber {} CJ MN GT CJ 1 1 0 MN 0 1 0 GT 0 0 1 Method Conceptual Similarity changeJob {} modifyName {} getTelephoneNumber {} CJ MN GT CJ 1 0.7 0.1 MN 0.7 1 0.1 GT 0.1 0.1 1
  • 30. Recommending Refactoring Operations in Large Software SystemsAppendix –Another Graph- Based algorithm example CJ MN GT CJ 1 0.7 0.2 MN 0.7 1 0.2 GT 0.2 0.2 1