SlideShare a Scribd company logo
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
A Multi-Objective Refactoring Approach to
Introduce Design Patterns
and Fix Anti-patterns
Ali Ouni1, Marouane Kessentini2, Houari Sahraoui3, Mel Ó Cinnéide4,
Kalyanmoy Deb5, Katsuro Inoue1
1Osaka University, Japan; 2University of Michigan, USA
3University of Montréal, Canada; 4University College Dublin, Ireland
5Michigan State University, USA
February 26, 2015, Detroit, MI, USA
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
Outline
• Context and research problem
• Approach
• Validation
• Conclusion and future work
2
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
Context
• Software, like people, get old
– increase in complexity and degrade in effectiveness
– Some changes may degrade the design and QoS of software systems
• Maintain a high level of quality during the life cycle of a
software system
– The original developers are not around anymore
• Refactoring
– “The process of improving a code after it has been written by changing
its internal structure without changing the external behavior” (Fowler et
al., ‘99)
3
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
Refactoring
• Modern IDEs: Eclipse, NetBeans
– Examples: Move method, move attribute, extract class, etc.
• Advantages
– Improve software quality, maintainability, readability
– Provide better software extensibility
– Increase the speed at which programmers can write and maintain
their code
• but…
– Manual refactoring is an error-prone and time-consuming task
– What are the suitable refactorings to apply?
4
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
Existing work: Refactoring
• Quality-based approaches
– Optimize a set of quality metrics/attributes. (Seng et al., ‘06, Harman et al.,
‘07, O’Keeffe et al., ‘08)
• Code smells-based approaches
– Fix code-smells in existing code. (Bavota et al., ‘10, Ouni et al., ‘12, Fokaefs,
et al., ‘12, Ouni et al., ’13)
• Design patterns-based approaches
– Find code transformations/refactorings to introduce design patterns
(Ó Cinnéide et al., ’00, Jensen et al., ‘10, Ajouli et al., ‘13)
5
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
Problem statement
• Limitations
– Most of existing works are goal-specific approaches
– Fixing anti-patterns may affect some quality metrics.
– Improve quality metrics does mean that anti-patterns are fixed
– Applying a design pattern where it is not needed may increase the
complexity of the system
– The semantic coherence of the refactored program is not considered
Conflicting considerations
• Existing refactoring techniques are underused (Murphy-Hill et al., ’11)
– Goal-oriented approaches
– Fit specific needs of developers
6
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
Approach
7
MORE
Original Source
Code
Suggested Refactoring
Solution
Source Code Parser and
Analyser
(SOOT)
A
Search Process
(NSGA-II)
Search Process
(NSGA-II)
G
Anti-patterns
Detector
Anti-patterns
Detector
B
List of possible
refactorings
List of possible
refactorings
E
R1 R2 R3 … RnR1 R2 R3 … Rn
Design Patterns
Detector
Design Patterns
Detector
C
List of coherence
constraints
List of coherence
constraints
F
Software Quality
Evaluator
Software Quality
Evaluator
D
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
SBSE formulation
• Search technique
– Non-dominated Sorting Genetic Algorithm (NSGA-II) (Deb et al., 2002)
• Solution representation
– Vector representation: sequence of refactoring operations
– Considered refactoring operations:
• Move method, Move field, Pull up field, Pull up method, Push down field, Push
down method, Inline class, Extract method, Extract class, Move class, Extract
superclass, Extract subclass, and Extract interface
• Introduce method factory, introduce visitor, introduce singleton
8
Move methodMove method Extract classExtract class Move fieldMove field Inline classInline class Move methodMove method Pull Up methodPull Up method Push down fieldPush down field
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
SBSE formulation
• Change operators
– Crossover : single, random, cut-point crossover
– Mutation: randomly select one or more refactorings and replace them
by other refactorings
• Objective functions
– Anti-patterns objective function
– Design patterns objective function
– Quality improvement
9
𝐴𝐶𝑅 =
𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑐𝑜𝑟𝑟𝑒𝑐𝑡𝑒𝑑 𝑎𝑛𝑡𝑖𝑝𝑎𝑡𝑡𝑒𝑟𝑛𝑠
𝑖𝑛𝑖𝑡𝑖𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑎𝑛𝑡𝑖𝑝𝑎𝑡𝑡𝑒𝑟𝑛𝑠
𝑁𝑃 = 𝐷𝑃𝐴 − 𝐷𝑃𝐵
𝑄𝐺 =
𝑖=1
n
𝑤𝑖 ∗ (𝑞𝑖
′
− 𝑞𝑖
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
Evaluation
• Three research questions
– RQ1: To what extent can the proposed approach improve the quality
of software systems?
– RQ2: How does the propose approach perform compared to existing
search-based refactoring approaches?
– RQ3: Is the proposed approach useful for software engineers?
10
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
Experimental setting
• Studied systems
• Antipatterns
– God Class, Feature Envy, Data Class, and Spaghetti Code
• Design patterns
– Abstract Method Factory, Visitor, and Singleton
• Quality attributes
– QMOOD: reusability, flexibility, understandability, effectiveness, functionality,
and extendibility
11
Systems Release # classes KLOC # anti-patterns # design patterns
Xerces-J v2.7.0 991 240 81 36
GanttProject v1.10.2 245 41 49 15
AntApache v1.8.2 1191 255 92 38
JHotDraw v 6.1 585 21 24 18
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
Analysis method
• Quantitative evaluation
– ACR: Ratio of fixed anti-patterns
– NP : number of introduced design patterns
– QG: Quality gain
• Qualitative evaluation
• Comparison to state-of-the-art research:
– Seng et al., ‘06, Jenson et al., ‘10, Kessentini et al., ‘11
12
𝑅𝑀 =
# 𝑚𝑒𝑎𝑛𝑖𝑛𝑔𝑓𝑢𝑙 𝑟𝑒𝑓𝑎𝑐𝑡𝑜𝑟𝑖𝑛𝑔𝑠
# 𝑒𝑣𝑎𝑙𝑢𝑎𝑡𝑒𝑑 𝑟𝑒𝑓𝑎𝑐𝑡𝑜𝑟𝑖𝑛𝑔𝑠
𝑃𝑈 =
# 𝑢𝑠𝑒𝑓𝑢𝑙 𝑑𝑒𝑠𝑖𝑔𝑛 𝑝𝑎𝑡𝑡𝑒𝑟𝑛𝑠
# 𝑖𝑛𝑡𝑟𝑜𝑑𝑢𝑐𝑒𝑑 𝑑𝑒𝑠𝑖𝑔𝑛 𝑝𝑎𝑡𝑡𝑒𝑟𝑛𝑠
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
Quantitative evaluation
13
Systems Approaches ACR NP QG
Xerces-J
MORE 89% 12 0.47
Seng et al. 23% 0 0.54
Jensen et al. 14% 31 0.41
Kessentini et al. 88% 0 0.32
GanttProject
MORE 88% 7 0.34
Seng et al. 24% 1 0.33
Jensen et al. 33% 14 0.35
Kessentini et al. 84% 0 0.21
AntApache
MORE 86% 4 0.5
Seng et al. 7% 0 0.52
Jensen et al. 12% 28 0.51
Kessentini et al. 87% 0 0.39
JHotDraw
MORE 83% 4 0.17
Seng et al. 38% 0 0.19
Jensen et al. 25% 9 0.14
Kessentini et al. 88% 0 0.1
Average (all
systems)
MORE 86% 7 0.37
Seng et al. 23% 0.25 0.39
Jensen et al. 21% 20.5 0.35
Kessentini et al. 86% 0 0.25
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
Quality gain
14
0
0,02
0,04
0,06
0,08
0,1
0,12
0,14
0,16
Reusability Flexibility Understandability Effectiveness Functionality Extendability
QG
QMOOD quality attributes
Xerces-J
GanttProject
AntApache
JHotDraw
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
Qualitative evaluation
15
Systems MORE Jensen et al.
Xerces-J 83% (10 | 12) 35% (11 | 31)
GanttProject 86% (6 | 7) 36% (5 | 14)
AntApache 100% (4 | 4) 14% (4 | 28)
JHotDraw 100% (4 | 4) 22% (2 | 9)
Refactoring meaningfulness (RM)
Design patterns usefulness (PU)
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
Scalability
16
30
35
40
45
50
55
60
65
70
75
0 200 400 600 800 1000 1200 1400
ExecutionTime(min)
Size of the systems (# of classes)
GanttProject
JHotDraw
Xerces-J
AntApache
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
Conclusion & Future Work
• We proposed an SBSE to recommend refactoring.
• Three objectives to optimize
– Fix antipatterns
– Introduce design patterns
– Improve quality attributes
• Empirical evaluation on 4 open-source java systems
• Future Works
– Include other types of anti-patterns and design patterns
– Test with other software systems
– Interactive refactoring: put the developer in the loop
17
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University
Thank you for your attention
Questions? Discussions? Sugggestions?
18

More Related Content

What's hot

Icsm19.ppt
Icsm19.pptIcsm19.ppt
A Survey on Automatic Software Evolution Techniques
A Survey on Automatic Software Evolution TechniquesA Survey on Automatic Software Evolution Techniques
A Survey on Automatic Software Evolution Techniques
Sung Kim
 
Cser13.ppt
Cser13.pptCser13.ppt
Cser13.ppt
Ptidej Team
 
Icsm20.ppt
Icsm20.pptIcsm20.ppt
Cross-project defect prediction
Cross-project defect predictionCross-project defect prediction
Cross-project defect prediction
Thomas Zimmermann
 
Software Defect Prediction on Unlabeled Datasets
Software Defect Prediction on Unlabeled DatasetsSoftware Defect Prediction on Unlabeled Datasets
Software Defect Prediction on Unlabeled Datasets
Sung Kim
 
Leveraging HPC Resources to Improve the Experimental Design of Software Analy...
Leveraging HPC Resources to Improve the Experimental Design of Software Analy...Leveraging HPC Resources to Improve the Experimental Design of Software Analy...
Leveraging HPC Resources to Improve the Experimental Design of Software Analy...
Chakkrit (Kla) Tantithamthavorn
 
Source code comprehension on evolving software
Source code comprehension on evolving softwareSource code comprehension on evolving software
Source code comprehension on evolving software
Sung Kim
 
An Empirical Study on the Adequacy of Testing in Open Source Projects
An Empirical Study on the Adequacy of Testing in Open Source ProjectsAn Empirical Study on the Adequacy of Testing in Open Source Projects
An Empirical Study on the Adequacy of Testing in Open Source Projects
Pavneet Singh Kochhar
 
An overview of automated test suites and defect density in Android
An overview of automated test suites and defect density in AndroidAn overview of automated test suites and defect density in Android
An overview of automated test suites and defect density in Android
Vahid Garousi
 
Performance analysis of machine learning approaches in software complexity pr...
Performance analysis of machine learning approaches in software complexity pr...Performance analysis of machine learning approaches in software complexity pr...
Performance analysis of machine learning approaches in software complexity pr...
Sayed Mohsin Reza
 
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
Sung Kim
 
DeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learning
DeepAM: Migrate APIs with Multi-modal Sequence to Sequence LearningDeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learning
DeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learning
Sung Kim
 
A survey of fault prediction using machine learning algorithms
A survey of fault prediction using machine learning algorithmsA survey of fault prediction using machine learning algorithms
A survey of fault prediction using machine learning algorithms
Ahmed Magdy Ezzeldin, MSc.
 
User-Perceived Source Code Quality Estimation based on Static Analysis Metrics
User-Perceived Source Code Quality Estimation based on Static Analysis MetricsUser-Perceived Source Code Quality Estimation based on Static Analysis Metrics
User-Perceived Source Code Quality Estimation based on Static Analysis Metrics
ISSEL
 
STAR: Stack Trace based Automatic Crash Reproduction
STAR: Stack Trace based Automatic Crash ReproductionSTAR: Stack Trace based Automatic Crash Reproduction
STAR: Stack Trace based Automatic Crash Reproduction
Sung Kim
 
Dissertation Defense
Dissertation DefenseDissertation Defense
Dissertation Defense
Sung Kim
 
Testing with Fewer Resources: An Adaptive Approach to Performance-Aware Test ...
Testing with Fewer Resources: An Adaptive Approach to Performance-Aware Test ...Testing with Fewer Resources: An Adaptive Approach to Performance-Aware Test ...
Testing with Fewer Resources: An Adaptive Approach to Performance-Aware Test ...
Sebastiano Panichella
 
Ssbse12b.ppt
Ssbse12b.pptSsbse12b.ppt
Ssbse12b.ppt
Ptidej Team
 

What's hot (20)

Icsm19.ppt
Icsm19.pptIcsm19.ppt
Icsm19.ppt
 
A Survey on Automatic Software Evolution Techniques
A Survey on Automatic Software Evolution TechniquesA Survey on Automatic Software Evolution Techniques
A Survey on Automatic Software Evolution Techniques
 
Cser13.ppt
Cser13.pptCser13.ppt
Cser13.ppt
 
Icsm20.ppt
Icsm20.pptIcsm20.ppt
Icsm20.ppt
 
Cross-project defect prediction
Cross-project defect predictionCross-project defect prediction
Cross-project defect prediction
 
Software Defect Prediction on Unlabeled Datasets
Software Defect Prediction on Unlabeled DatasetsSoftware Defect Prediction on Unlabeled Datasets
Software Defect Prediction on Unlabeled Datasets
 
Leveraging HPC Resources to Improve the Experimental Design of Software Analy...
Leveraging HPC Resources to Improve the Experimental Design of Software Analy...Leveraging HPC Resources to Improve the Experimental Design of Software Analy...
Leveraging HPC Resources to Improve the Experimental Design of Software Analy...
 
Source code comprehension on evolving software
Source code comprehension on evolving softwareSource code comprehension on evolving software
Source code comprehension on evolving software
 
An Empirical Study on the Adequacy of Testing in Open Source Projects
An Empirical Study on the Adequacy of Testing in Open Source ProjectsAn Empirical Study on the Adequacy of Testing in Open Source Projects
An Empirical Study on the Adequacy of Testing in Open Source Projects
 
An overview of automated test suites and defect density in Android
An overview of automated test suites and defect density in AndroidAn overview of automated test suites and defect density in Android
An overview of automated test suites and defect density in Android
 
Performance analysis of machine learning approaches in software complexity pr...
Performance analysis of machine learning approaches in software complexity pr...Performance analysis of machine learning approaches in software complexity pr...
Performance analysis of machine learning approaches in software complexity pr...
 
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
 
DeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learning
DeepAM: Migrate APIs with Multi-modal Sequence to Sequence LearningDeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learning
DeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learning
 
A survey of fault prediction using machine learning algorithms
A survey of fault prediction using machine learning algorithmsA survey of fault prediction using machine learning algorithms
A survey of fault prediction using machine learning algorithms
 
User-Perceived Source Code Quality Estimation based on Static Analysis Metrics
User-Perceived Source Code Quality Estimation based on Static Analysis MetricsUser-Perceived Source Code Quality Estimation based on Static Analysis Metrics
User-Perceived Source Code Quality Estimation based on Static Analysis Metrics
 
STAR: Stack Trace based Automatic Crash Reproduction
STAR: Stack Trace based Automatic Crash ReproductionSTAR: Stack Trace based Automatic Crash Reproduction
STAR: Stack Trace based Automatic Crash Reproduction
 
Dissertation Defense
Dissertation DefenseDissertation Defense
Dissertation Defense
 
ICSM12.ppt
ICSM12.pptICSM12.ppt
ICSM12.ppt
 
Testing with Fewer Resources: An Adaptive Approach to Performance-Aware Test ...
Testing with Fewer Resources: An Adaptive Approach to Performance-Aware Test ...Testing with Fewer Resources: An Adaptive Approach to Performance-Aware Test ...
Testing with Fewer Resources: An Adaptive Approach to Performance-Aware Test ...
 
Ssbse12b.ppt
Ssbse12b.pptSsbse12b.ppt
Ssbse12b.ppt
 

Similar to A Multi-Objective Refactoring Approach to Introduce Design Patterns and Fix Anti-patterns

[2017/2018] RESEARCH in software engineering
[2017/2018] RESEARCH in software engineering[2017/2018] RESEARCH in software engineering
[2017/2018] RESEARCH in software engineering
Ivano Malavolta
 
A Framework for Classifying and Comparing Architecture-Centric Software Evolu...
A Framework for Classifying and Comparing Architecture-Centric Software Evolu...A Framework for Classifying and Comparing Architecture-Centric Software Evolu...
A Framework for Classifying and Comparing Architecture-Centric Software Evolu...
Pooyan Jamshidi
 
Apsec 2014 Presentation
Apsec 2014 PresentationApsec 2014 Presentation
Apsec 2014 Presentation
Ahrim Han, Ph.D.
 
[2016/2017] RESEARCH in software engineering
[2016/2017] RESEARCH in software engineering[2016/2017] RESEARCH in software engineering
[2016/2017] RESEARCH in software engineering
Ivano Malavolta
 
Doing Science Properly in the Digital Age: Software Skills for Free-Range Res...
Doing Science Properly in the Digital Age: Software Skills for Free-Range Res...Doing Science Properly in the Digital Age: Software Skills for Free-Range Res...
Doing Science Properly in the Digital Age: Software Skills for Free-Range Res...
Neil Chue Hong
 
Kanban in software development: A systematic literature review
Kanban in software development: A systematic literature reviewKanban in software development: A systematic literature review
Kanban in software development: A systematic literature review
Muhammad Ahmad
 
DITEC - Software Engineering
DITEC - Software EngineeringDITEC - Software Engineering
DITEC - Software Engineering
Rasan Samarasinghe
 
Software Engineering Research: Leading a Double-Agent Life.
Software Engineering Research: Leading a Double-Agent Life.Software Engineering Research: Leading a Double-Agent Life.
Software Engineering Research: Leading a Double-Agent Life.
Lionel Briand
 
OMG Essence in systems engineering courses
OMG Essence in systems engineering coursesOMG Essence in systems engineering courses
OMG Essence in systems engineering courses
Anatoly Levenchuk
 
Yamuna Chari(Experience -3years(Automation & Manual))
Yamuna Chari(Experience -3years(Automation & Manual))Yamuna Chari(Experience -3years(Automation & Manual))
Yamuna Chari(Experience -3years(Automation & Manual))Yamuna Chari
 
Yamuna chari(experience 3years(automation & manual))
Yamuna chari(experience  3years(automation & manual))Yamuna chari(experience  3years(automation & manual))
Yamuna chari(experience 3years(automation & manual))
Yamuna Chari
 
Web Engineering Workshop
Web Engineering WorkshopWeb Engineering Workshop
Web Engineering WorkshopDhaval Dalal
 
Ibm colloquium 070915_nyberg
Ibm colloquium 070915_nybergIbm colloquium 070915_nyberg
Ibm colloquium 070915_nyberg
diannepatricia
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
Hironori Washizaki
 
Goal Decomposition and Abductive Reasoning for Policy Analysis and Refinement
Goal Decomposition and Abductive Reasoning for Policy Analysis and RefinementGoal Decomposition and Abductive Reasoning for Policy Analysis and Refinement
Goal Decomposition and Abductive Reasoning for Policy Analysis and Refinement
Emil Lupu
 
Who cares about Software Process Modelling? A First Investigation about the P...
Who cares about Software Process Modelling? A First Investigation about the P...Who cares about Software Process Modelling? A First Investigation about the P...
Who cares about Software Process Modelling? A First Investigation about the P...
Daniel Mendez
 
Technical briefing on Software Release Planning
Technical briefing on Software Release PlanningTechnical briefing on Software Release Planning
Technical briefing on Software Release Planning
Guenther Ruhe
 
function (mal120) By Wakil Kumar
function (mal120) By Wakil Kumarfunction (mal120) By Wakil Kumar
function (mal120) By Wakil Kumar
Wakil Kumar
 
From Bugs to Decision Support - Selected Research Highlights
From Bugs to Decision Support - Selected Research HighlightsFrom Bugs to Decision Support - Selected Research Highlights
From Bugs to Decision Support - Selected Research Highlights
Markus Borg
 

Similar to A Multi-Objective Refactoring Approach to Introduce Design Patterns and Fix Anti-patterns (20)

[2017/2018] RESEARCH in software engineering
[2017/2018] RESEARCH in software engineering[2017/2018] RESEARCH in software engineering
[2017/2018] RESEARCH in software engineering
 
A Framework for Classifying and Comparing Architecture-Centric Software Evolu...
A Framework for Classifying and Comparing Architecture-Centric Software Evolu...A Framework for Classifying and Comparing Architecture-Centric Software Evolu...
A Framework for Classifying and Comparing Architecture-Centric Software Evolu...
 
Apsec 2014 Presentation
Apsec 2014 PresentationApsec 2014 Presentation
Apsec 2014 Presentation
 
[2016/2017] RESEARCH in software engineering
[2016/2017] RESEARCH in software engineering[2016/2017] RESEARCH in software engineering
[2016/2017] RESEARCH in software engineering
 
Doing Science Properly in the Digital Age: Software Skills for Free-Range Res...
Doing Science Properly in the Digital Age: Software Skills for Free-Range Res...Doing Science Properly in the Digital Age: Software Skills for Free-Range Res...
Doing Science Properly in the Digital Age: Software Skills for Free-Range Res...
 
Kanban in software development: A systematic literature review
Kanban in software development: A systematic literature reviewKanban in software development: A systematic literature review
Kanban in software development: A systematic literature review
 
DITEC - Software Engineering
DITEC - Software EngineeringDITEC - Software Engineering
DITEC - Software Engineering
 
Software Engineering Research: Leading a Double-Agent Life.
Software Engineering Research: Leading a Double-Agent Life.Software Engineering Research: Leading a Double-Agent Life.
Software Engineering Research: Leading a Double-Agent Life.
 
OMG Essence in systems engineering courses
OMG Essence in systems engineering coursesOMG Essence in systems engineering courses
OMG Essence in systems engineering courses
 
Yamuna Chari(Experience -3years(Automation & Manual))
Yamuna Chari(Experience -3years(Automation & Manual))Yamuna Chari(Experience -3years(Automation & Manual))
Yamuna Chari(Experience -3years(Automation & Manual))
 
Yamuna chari(experience 3years(automation & manual))
Yamuna chari(experience  3years(automation & manual))Yamuna chari(experience  3years(automation & manual))
Yamuna chari(experience 3years(automation & manual))
 
Web Engineering Workshop
Web Engineering WorkshopWeb Engineering Workshop
Web Engineering Workshop
 
Ibm colloquium 070915_nyberg
Ibm colloquium 070915_nybergIbm colloquium 070915_nyberg
Ibm colloquium 070915_nyberg
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Goal Decomposition and Abductive Reasoning for Policy Analysis and Refinement
Goal Decomposition and Abductive Reasoning for Policy Analysis and RefinementGoal Decomposition and Abductive Reasoning for Policy Analysis and Refinement
Goal Decomposition and Abductive Reasoning for Policy Analysis and Refinement
 
Word
WordWord
Word
 
Who cares about Software Process Modelling? A First Investigation about the P...
Who cares about Software Process Modelling? A First Investigation about the P...Who cares about Software Process Modelling? A First Investigation about the P...
Who cares about Software Process Modelling? A First Investigation about the P...
 
Technical briefing on Software Release Planning
Technical briefing on Software Release PlanningTechnical briefing on Software Release Planning
Technical briefing on Software Release Planning
 
function (mal120) By Wakil Kumar
function (mal120) By Wakil Kumarfunction (mal120) By Wakil Kumar
function (mal120) By Wakil Kumar
 
From Bugs to Decision Support - Selected Research Highlights
From Bugs to Decision Support - Selected Research HighlightsFrom Bugs to Decision Support - Selected Research Highlights
From Bugs to Decision Support - Selected Research Highlights
 

Recently uploaded

Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
XfilesPro
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
varshanayak241
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
WSO2
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
ayushiqss
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 

Recently uploaded (20)

Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 

A Multi-Objective Refactoring Approach to Introduce Design Patterns and Fix Anti-patterns

  • 1. Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University A Multi-Objective Refactoring Approach to Introduce Design Patterns and Fix Anti-patterns Ali Ouni1, Marouane Kessentini2, Houari Sahraoui3, Mel Ó Cinnéide4, Kalyanmoy Deb5, Katsuro Inoue1 1Osaka University, Japan; 2University of Michigan, USA 3University of Montréal, Canada; 4University College Dublin, Ireland 5Michigan State University, USA February 26, 2015, Detroit, MI, USA
  • 2. Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Outline • Context and research problem • Approach • Validation • Conclusion and future work 2
  • 3. Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Context • Software, like people, get old – increase in complexity and degrade in effectiveness – Some changes may degrade the design and QoS of software systems • Maintain a high level of quality during the life cycle of a software system – The original developers are not around anymore • Refactoring – “The process of improving a code after it has been written by changing its internal structure without changing the external behavior” (Fowler et al., ‘99) 3
  • 4. Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Refactoring • Modern IDEs: Eclipse, NetBeans – Examples: Move method, move attribute, extract class, etc. • Advantages – Improve software quality, maintainability, readability – Provide better software extensibility – Increase the speed at which programmers can write and maintain their code • but… – Manual refactoring is an error-prone and time-consuming task – What are the suitable refactorings to apply? 4
  • 5. Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Existing work: Refactoring • Quality-based approaches – Optimize a set of quality metrics/attributes. (Seng et al., ‘06, Harman et al., ‘07, O’Keeffe et al., ‘08) • Code smells-based approaches – Fix code-smells in existing code. (Bavota et al., ‘10, Ouni et al., ‘12, Fokaefs, et al., ‘12, Ouni et al., ’13) • Design patterns-based approaches – Find code transformations/refactorings to introduce design patterns (Ó Cinnéide et al., ’00, Jensen et al., ‘10, Ajouli et al., ‘13) 5
  • 6. Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Problem statement • Limitations – Most of existing works are goal-specific approaches – Fixing anti-patterns may affect some quality metrics. – Improve quality metrics does mean that anti-patterns are fixed – Applying a design pattern where it is not needed may increase the complexity of the system – The semantic coherence of the refactored program is not considered Conflicting considerations • Existing refactoring techniques are underused (Murphy-Hill et al., ’11) – Goal-oriented approaches – Fit specific needs of developers 6
  • 7. Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Approach 7 MORE Original Source Code Suggested Refactoring Solution Source Code Parser and Analyser (SOOT) A Search Process (NSGA-II) Search Process (NSGA-II) G Anti-patterns Detector Anti-patterns Detector B List of possible refactorings List of possible refactorings E R1 R2 R3 … RnR1 R2 R3 … Rn Design Patterns Detector Design Patterns Detector C List of coherence constraints List of coherence constraints F Software Quality Evaluator Software Quality Evaluator D
  • 8. Department of Computer Science, Graduate School of Information Science and Technology, Osaka University SBSE formulation • Search technique – Non-dominated Sorting Genetic Algorithm (NSGA-II) (Deb et al., 2002) • Solution representation – Vector representation: sequence of refactoring operations – Considered refactoring operations: • Move method, Move field, Pull up field, Pull up method, Push down field, Push down method, Inline class, Extract method, Extract class, Move class, Extract superclass, Extract subclass, and Extract interface • Introduce method factory, introduce visitor, introduce singleton 8 Move methodMove method Extract classExtract class Move fieldMove field Inline classInline class Move methodMove method Pull Up methodPull Up method Push down fieldPush down field
  • 9. Department of Computer Science, Graduate School of Information Science and Technology, Osaka University SBSE formulation • Change operators – Crossover : single, random, cut-point crossover – Mutation: randomly select one or more refactorings and replace them by other refactorings • Objective functions – Anti-patterns objective function – Design patterns objective function – Quality improvement 9 𝐴𝐶𝑅 = 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑐𝑜𝑟𝑟𝑒𝑐𝑡𝑒𝑑 𝑎𝑛𝑡𝑖𝑝𝑎𝑡𝑡𝑒𝑟𝑛𝑠 𝑖𝑛𝑖𝑡𝑖𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑎𝑛𝑡𝑖𝑝𝑎𝑡𝑡𝑒𝑟𝑛𝑠 𝑁𝑃 = 𝐷𝑃𝐴 − 𝐷𝑃𝐵 𝑄𝐺 = 𝑖=1 n 𝑤𝑖 ∗ (𝑞𝑖 ′ − 𝑞𝑖
  • 10. Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Evaluation • Three research questions – RQ1: To what extent can the proposed approach improve the quality of software systems? – RQ2: How does the propose approach perform compared to existing search-based refactoring approaches? – RQ3: Is the proposed approach useful for software engineers? 10
  • 11. Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Experimental setting • Studied systems • Antipatterns – God Class, Feature Envy, Data Class, and Spaghetti Code • Design patterns – Abstract Method Factory, Visitor, and Singleton • Quality attributes – QMOOD: reusability, flexibility, understandability, effectiveness, functionality, and extendibility 11 Systems Release # classes KLOC # anti-patterns # design patterns Xerces-J v2.7.0 991 240 81 36 GanttProject v1.10.2 245 41 49 15 AntApache v1.8.2 1191 255 92 38 JHotDraw v 6.1 585 21 24 18
  • 12. Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Analysis method • Quantitative evaluation – ACR: Ratio of fixed anti-patterns – NP : number of introduced design patterns – QG: Quality gain • Qualitative evaluation • Comparison to state-of-the-art research: – Seng et al., ‘06, Jenson et al., ‘10, Kessentini et al., ‘11 12 𝑅𝑀 = # 𝑚𝑒𝑎𝑛𝑖𝑛𝑔𝑓𝑢𝑙 𝑟𝑒𝑓𝑎𝑐𝑡𝑜𝑟𝑖𝑛𝑔𝑠 # 𝑒𝑣𝑎𝑙𝑢𝑎𝑡𝑒𝑑 𝑟𝑒𝑓𝑎𝑐𝑡𝑜𝑟𝑖𝑛𝑔𝑠 𝑃𝑈 = # 𝑢𝑠𝑒𝑓𝑢𝑙 𝑑𝑒𝑠𝑖𝑔𝑛 𝑝𝑎𝑡𝑡𝑒𝑟𝑛𝑠 # 𝑖𝑛𝑡𝑟𝑜𝑑𝑢𝑐𝑒𝑑 𝑑𝑒𝑠𝑖𝑔𝑛 𝑝𝑎𝑡𝑡𝑒𝑟𝑛𝑠
  • 13. Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Quantitative evaluation 13 Systems Approaches ACR NP QG Xerces-J MORE 89% 12 0.47 Seng et al. 23% 0 0.54 Jensen et al. 14% 31 0.41 Kessentini et al. 88% 0 0.32 GanttProject MORE 88% 7 0.34 Seng et al. 24% 1 0.33 Jensen et al. 33% 14 0.35 Kessentini et al. 84% 0 0.21 AntApache MORE 86% 4 0.5 Seng et al. 7% 0 0.52 Jensen et al. 12% 28 0.51 Kessentini et al. 87% 0 0.39 JHotDraw MORE 83% 4 0.17 Seng et al. 38% 0 0.19 Jensen et al. 25% 9 0.14 Kessentini et al. 88% 0 0.1 Average (all systems) MORE 86% 7 0.37 Seng et al. 23% 0.25 0.39 Jensen et al. 21% 20.5 0.35 Kessentini et al. 86% 0 0.25
  • 14. Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Quality gain 14 0 0,02 0,04 0,06 0,08 0,1 0,12 0,14 0,16 Reusability Flexibility Understandability Effectiveness Functionality Extendability QG QMOOD quality attributes Xerces-J GanttProject AntApache JHotDraw
  • 15. Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Qualitative evaluation 15 Systems MORE Jensen et al. Xerces-J 83% (10 | 12) 35% (11 | 31) GanttProject 86% (6 | 7) 36% (5 | 14) AntApache 100% (4 | 4) 14% (4 | 28) JHotDraw 100% (4 | 4) 22% (2 | 9) Refactoring meaningfulness (RM) Design patterns usefulness (PU)
  • 16. Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Scalability 16 30 35 40 45 50 55 60 65 70 75 0 200 400 600 800 1000 1200 1400 ExecutionTime(min) Size of the systems (# of classes) GanttProject JHotDraw Xerces-J AntApache
  • 17. Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Conclusion & Future Work • We proposed an SBSE to recommend refactoring. • Three objectives to optimize – Fix antipatterns – Introduce design patterns – Improve quality attributes • Empirical evaluation on 4 open-source java systems • Future Works – Include other types of anti-patterns and design patterns – Test with other software systems – Interactive refactoring: put the developer in the loop 17
  • 18. Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Thank you for your attention Questions? Discussions? Sugggestions? 18