Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University A Multi-Objective.

Slides:



Advertisements
Similar presentations
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Modularization.
Advertisements

Code Smell Research: History and Future Directions Second PLOW Installment - March 5, Nikolaos Tsantalis Computer Science & Software Engineering.
Preventive Software Maintenance: The Past, the Present, the Future Nikolaos Tsantalis Computer Science & Software Engineering Consortium for Software Engineering.
Software engineering as a model of understanding for learning and problem solving Paul Gibson and Jackie O’Kelly Computer Science Department NUI, Maynooth.
Automatically Extracting and Verifying Design Patterns in Java Code James Norris Ruchika Agrawal Computer Science Department Stanford University {jcn,
The Pareto fitness genetic algorithm: Test function study Wei-Ming Chen
Applying Multi-Criteria Optimisation to Develop Cognitive Models Peter Lane University of Hertfordshire Fernand Gobet Brunel University.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Industrial Application.
Customizing Cyberspace: Methods for User Representation and Prediction Amund Tveit Department of Computer and Information Science Norwegian University.
Maintenance Refactoring and Code Smells. Where are we? Over the semester we have talked about Software Engineering. The overall goal of software engineering.
Katanosh Morovat.   This concept is a formal approach for identifying the rules that encapsulate the structure, constraint, and control of the operation.
How Significant Is the Effect of Faults Interaction on Coverage Based Fault Localizations? Xiaozhen Xue Advanced Empirical Software Testing Group Department.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University ICSE 2003 Java.
A Budget Constrained Scheduling of Workflow Applications on Utility Grids using Genetic Algorithms Jia Yu and Rajkumar Buyya Grid Computing and Distributed.
On comparison of different approaches to the stability radius calculation Olga Karelkina Department of Mathematics University of Turku MCDM 2011.
1 v1.6 08/02/2006 Overview of Eclipse Lectures 1.Overview 2.Installing and Running 3.Building and Running Java Classes 4.Refactoring 5.Debugging 6.Testing.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University What Kinds of.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Refactoring.
Advanced Programing practices
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University A Criterion for.
Refactoring Cristescu Marilena. Definitions Loose Usage: Reorganize a program(or something) As a noun: a change made to the internal structure of some.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University What Do Practitioners.
MOGADES: Multi-Objective Genetic Algorithm with Distributed Environment Scheme Intelligent Systems Design Laboratory , Doshisha University , Kyoto Japan.
Placement of Entities in Object-oriented Systems by means of a Single-objective Genetic Algorithm Margaritis Basdavanos Alexander Chatzigeorgiou University.
Refactoring Improving the structure of existing code Refactoring1.
Inferring Temporal Properties of Finite-State Machines with Genetic Programming GECCO’15 Student Workshop July 11, 2015 Daniil Chivilikhin PhD student.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Design and Implementation.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Applying Clone.
Department of Computer Science, Graduate School of Information Science & Technology, Osaka University Inoue Laboratory Eunjong Choi 1 Investigating Clone.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University How to extract.
Refactoring1 Refactoring DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY February 6, 2009.
Applying Genetic Algorithm to the Knapsack Problem Qi Su ECE 539 Spring 2001 Course Project.
Fuzzy Genetic Algorithm
Refactoring1 Improving the structure of existing code.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Technology and Science, Osaka University Dependence-Cache.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University VerXCombo: An.
Job scheduling algorithm based on Berger model in cloud environment Advances in Engineering Software (2011) Baomin Xu,Chunyan Zhao,Enzhao Hua,Bin Hu 2013/1/251.
Department of Computer Science, Graduate School of Information Science & Technology, Osaka University 1 Towards an Assessment of the Quality of Refactoring.
DYNAMIC FACILITY LAYOUT : GENETIC ALGORITHM BASED MODEL
Department of Computer Science, Graduate School of Information Science & Technology, Osaka University 1 Towards an Investigation of Opportunities for Refactoring.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University July 21, 2008WODA.
Kanpur Genetic Algorithms Laboratory IIT Kanpur 25, July 2006 (11:00 AM) Multi-Objective Dynamic Optimization using Evolutionary Algorithms by Udaya Bhaskara.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
Chapter 4 Decision Support System & Artificial Intelligence.
Com S 362: Object-Oriented Analysis and Design Refactoring.
Review of Parnas’ Criteria for Decomposing Systems into Modules Zheng Wang, Yuan Zhang Michigan State University 04/19/2002.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Extracting Sequence.
What kind of and how clones are refactored? A case study of three OSS projects WRT2012 June 1, Eunjong Choi†, Norihiro Yoshida‡, Katsuro Inoue†
Refactoring1 Improving the structure of existing code.
Department of Computer Science, Graduate School of Information Science & Technology, Osaka University A Metric-based Approach for Reconstructing Methods.
Search-Based Peer Reviewers Recommendation in Modern Code Review 32 nd IEEE International Conference on Software Maintenance and Evolution (ICSME) 2016.
Principles and examples
Strategy Design Pattern
Module Road Map Refactoring Why Refactoring? Examples
Why We Refactor? Confessions of GitHub Contributors
Discrete ABC Based on Similarity for GCP
Naoya Ujihara1, Ali Ouni2, Takashi Ishio1, Katsuro Inoue1
Daniil Chivilikhin and Vladimir Ulyantsev
MultiRefactor: Automated Refactoring To Improve Software Quality
Jeliot 3 Spring 2004 Andrés Moreno García Niko Myller
Refactoring and Code Smells
Heuristic-based Recommendation for Metamodel–OCL Coevolution
Improving the structure of existing code
Refactoring and Code Smells
Quaid-i-Azam University
Technical Debt Reduction Using Search-Based Automated Refactoring
Refactoring and Code Smells
Dotri Quoc†, Kazuo Kobori†, Norihiro Yoshida
MAPO: Mining and Recommending API Usage Patterns
Refactoring and Code Smells
Presentation transcript:

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 Ouni 1, Marouane Kessentini 2, Houari Sahraoui 3, Mel Ó Cinnéide 4, Kalyanmoy Deb 5, Katsuro Inoue 1 1 Osaka University, Japan; 2 University of Michigan, USA 3 University of Montréal, Canada; 4 University College Dublin, Ireland 5 Michigan State University, 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 B List of possible refactorings E R 1 R 2 R 3 … R n R 1 R 2 R 3 … R n Design Patterns Detector C List of coherence constraints F 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 method Extract class Move field Inline class Move method Pull Up method Push 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

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 SystemsRelease# classesKLOC# anti-patterns# design patterns Xerces-Jv GanttProjectv AntApachev JHotDrawv

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 SystemsApproachesACRNPQG Xerces-J MORE89% Seng et al.23%00.54 Jensen et al.14% Kessentini et al.88%00.32 GanttProject MORE88%70.34 Seng et al.24%10.33 Jensen et al.33% Kessentini et al.84%00.21 AntApache MORE86%40.5 Seng et al.7%00.52 Jensen et al.12% Kessentini et al.87%00.39 JHotDraw MORE83%40.17 Seng et al.38%00.19 Jensen et al.25%90.14 Kessentini et al.88%00.1 Average (all systems) MORE86%70.37 Seng et al.23% Jensen et al.21% Kessentini et al.86%00.25

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Quality gain 14

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Qualitative evaluation 15 SystemsMOREJensen et al. Xerces-J83% (10 | 12)35% (11 | 31) GanttProject86% (6 | 7)36% (5 | 14) AntApache100% (4 | 4)14% (4 | 28) JHotDraw100% (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

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