Technical Debt Reduction Using Search-Based Automated Refactoring

Slides:



Advertisements
Similar presentations
Test-Driven Development and Refactoring CPSC 315 – Programming Studio.
Advertisements

Enterprise Resource Planning
Variance reduction techniques. 2 Introduction Simulation models should be coded such that they are efficient. Efficiency in terms of programming ensures.
Further abstraction techniques Abstract classes and interfaces 5.0.
Prediction of fault-proneness at early phase in object-oriented development Toshihiro Kamiya †, Shinji Kusumoto † and Katsuro Inoue †‡ † Osaka University.
David Streader Computer Science Victoria University of Wellington Copyright: David Streader, Victoria University of Wellington Interface COMP T1.
Date:2011/06/08 吳昕澧 BOA: The Bayesian Optimization Algorithm.
Page 1 Building Reliable Component-based Systems Chapter 7 - Role-Based Component Engineering Chapter 7 Role-Based Component Engineering.
Project 4 U-Pick – A Project of Your Own Design Proposal Due: April 14 th (earlier ok) Project Due: April 25 th.
Using Natural Language Program Analysis to Locate and understand Action-Oriented Concerns David Shepherd, Zachary P. Fry, Emily Hill, Lori Pollock, and.
Automatically Extracting and Verifying Design Patterns in Java Code James Norris Ruchika Agrawal Computer Science Department Stanford University {jcn,
Feature Subset Selection using Minimum Cost Spanning Trees Mike Farah Supervisor: Dr. Sid Ray.
Further abstraction techniques Abstract classes and interfaces 3.0.
1 Using Heuristic Search Techniques to Extract Design Abstractions from Source Code The Genetic and Evolutionary Computation Conference (GECCO'02). Brian.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Refactoring.
Chapter 6 : Software Metrics
Artificial Intelligence Techniques Internet Applications 1.
1 Research Groups : KEEL: A Software Tool to Assess Evolutionary Algorithms for Data Mining Problems SCI 2 SMetrology and Models Intelligent.
Developing.NET Web Service- based Architectures with Aspect-Oriented Component Engineering Santokh Singh 1, Professor John Grundy 1,2 and Professor John.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University A Multi-Objective.
Steps in simulation study 1. - Clearly understand problem - Reformulation of the problem 2. - Which questions should be answered? - Is simulation appropriate?
Software Measurement & Metrics
Inferring Temporal Properties of Finite-State Machines with Genetic Programming GECCO’15 Student Workshop July 11, 2015 Daniil Chivilikhin PhD student.
The CK Metrics Suite. Weighted Methods Per Class b To use this metric, the software engineer must repeat this process n times, where n is the number of.
1 A Heuristic Approach Towards Solving the Software Clustering Problem ICSM03 Brian S. Mitchell /
Investigating Adaptive Compilation using the MIPSpro Compiler Keith D. Cooper Todd Waterman Department of Computer Science Rice University Houston, TX.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
CSc 461/561 Information Systems Engineering Lecture 5 – Software Metrics.
Chapter 6 CASE Tools Software Engineering Chapter 6-- CASE TOOLS
Software Architecture Evaluation Methodologies Presented By: Anthony Register.
Coevolutionary Automated Software Correction Josh Wilkerson PhD Candidate in Computer Science Missouri S&T.
ApproxHadoop Bringing Approximations to MapReduce Frameworks
Ontology Support for Abstraction Layer Modularization Hyun Cho, Jeff Gray Department of Computer Science University of Alabama
1 COS 260 DAY 22 Tony Gauvin. 2 Agenda Questions? 9 th Mini Quiz corrected –Good results Assignment 5 Not corrected yet Assignment 6 Posted (one more)
Metaheuristics for the New Millennium Bruce L. Golden RH Smith School of Business University of Maryland by Presented at the University of Iowa, March.
Static Software Metrics Tool
Optimization Problems
Rapidly-Exploring Random Trees
A Hierarchical Model for Object-Oriented Design Quality Assessment
Michael J. Salé, Seidenberg School of CSIS, Westchester DPS 2016
Software Metrics 1.
Van Laarhoven, Aarts Version 1, October 2000
Rule Induction for Classification Using
CSC 221: Computer Programming I Fall 2005
Presented by: Dr Beatriz de la Iglesia
Copyright © by Curt Hill
Green IT CHAPTER 3: PROGRAMMATIC AND INSTITUTIONAL OPPORTUNITIES TO ENHANCE COMPUTER SCIENCE RESEARCH FOR SUSTAINABILITY.
MultiRefactor: Automated Refactoring To Improve Software Quality
Lecture 2 of Computer Science II
Design Metrics Software Engineering Fall 2003
Design Metrics Software Engineering Fall 2003
Fault-Tolerant Architecture Design for Flow-Based Biochips
Test Case Purification for Improving Fault Localization
Optimization Problems
Predicting Fault-Prone Modules Based on Metrics Transitions
Software Testing: A Research Travelogue
COS 260 DAY 23 Tony Gauvin.
Authors: Barry Smyth, Mark T. Keane, Padraig Cunningham
Software Metrics SAD ::: Fall 2015 Sabbir Muhammad Saleh.
COS 260 DAY 23 Tony Gauvin.
Applications of Genetic Algorithms TJHSST Computer Systems Lab
More on HW 2 (due Jan 26) Again, it must be in Python 2.7.
More on HW 2 (due Jan 26) Again, it must be in Python 2.7.
Further abstraction techniques
Alex Bolsoy, Jonathan Suggs, Casey Wenner
Communication Driven Remapping of Processing Element (PE) in Fault-tolerant NoC-based MPSoCs Chia-Ling Chen, Yen-Hao Chen and TingTing Hwang Department.
Chapter 2: Building a System
Building a “System” Moving from writing a program to building a system. What’s the difference?! Complexity, size, complexity, size complexity Breadth.
Refactoring the Aspectizable Interfaces: An Empirical Assessment
Presentation transcript:

Technical Debt Reduction Using Search-Based Automated Refactoring Michael Mohan1, Des Greer and Paul McMullan Queen’s University Belfast, Northern Ireland, UK 1mmohan03@qub.ac.uk

mmohan03@qub.ac.uk Technical Debt As the development of a software project progresses, it will build up technical debt. This makes it more difficult to add new functionality due to the code becoming less extendable, more complex etc. If this debt isn’t paid off early on, the project can eventually fall into disrepair and the cost of resolving the debt in order to add new functionality may become too great.

mmohan03@qub.ac.uk Paper Outline Technical debt is a difficult property to measure in a program. We propose a metric function to measure the level of technical debt in a Java program. We compare the function with measures of 3 other software properties to determine its usefulness. To compare, we use a refactoring tool to modify different open source programs to improve each measure.

mmohan03@qub.ac.uk Refactoring Tool Used The A-CMA tool1 was adapted and used for the experimentation. The tool contain 20 refactorings and 24 software metrics. There are 5 different search techniques available to use in the tool. 1 Koc, E., Ersoy, N., Andac, A., Camlidere, Z.S., Cereci, I., Kilic, H., 2012. An empirical study about search-based refactoring using alternative multiple and population- based search techniques. In: Gelenbe, E., Lent, R., Sakellari, G. (Eds.), Computer and Information Sciences II. Springer London, London, pp. 59–66. doi: 10.1007/ 978- 1- 4471- 2155- 8 .

Refactorings Used Field Level Method Level Class Level mmohan03@qub.ac.uk Refactorings Used Field Level Method Level Class Level Increase Field Security Increase Method Security Introduce Factory Decrease Field Security Decrease Method Security Make Class Abstract Move Down Field Move Down Method Make Class Final Move Up Field Move Up Method Make Class Non-Final Remove Field Move Method Remove Class Instantiate Method Remove Interface Freeze Method Remove Method Inline Method

Metrics Used mmohan03@qub.ac.uk numField avrgFieldVisibility eC_Attr numOps nesting iC_Par numCls NOC eC_Par numInterf numDesc Dep_In iFImpl numAnc Dep_Out abstractness iC_attr

Search Techniques Used mmohan03@qub.ac.uk Search Techniques Used Search Technique Iterations/ Amount Of Restarts Temperature/Depth Random Search 5,000 Iterations Steepest Ascent Hill Climbing 30 Restarts Depth Of 5 Neighbours Simulated Annealing Temperature Value Of 1.5

mmohan03@qub.ac.uk Tool Location The original tool can be found at https://github.com/eknkc/a-cma The tool was modified in order to give more configuration for the experimentation in this paper. The modified version of the tool can be found at https://github.com/mmohan01/a-cma This repository also contains the programs used for experimentation and the results generated.

mmohan03@qub.ac.uk Experimental Setup For each of the 4 software measures, a fitness function is constructed using weighted combinations of metrics. The SOLID principles of object oriented design and the QMOOD metrics suite were used to aid in constructing the functions. A search-based refactoring setup was run for each of the 4 fitness functions.

Experimental Setup Software Factor Metric Components And Weights mmohan03@qub.ac.uk Experimental Setup Software Factor Metric Components And Weights Technical Debt −0.1 ∗numFields − 0.1 ∗avrgFieldVisibility − 0.1 ∗numOps − 0.06 ∗nesting + 0.1 ∗abstractness + 0.1 ∗numCls + 0.1 ∗numInterf + 0.1 ∗iFImpl + 0.06 ∗NOC + 0.06 ∗numDesc − 0.06 ∗Dep_In − 0.06 ∗Dep_Out Coupling −0 .125 ∗iC_Attr − 0.125 ∗eC_Attr − 0.125 ∗iC_Par − 0.125 ∗eC_Par − 0.25 ∗Dep_In − 0.25 ∗Dep_Out Inheritance 0.25 ∗iFImpl + 0.25 ∗NOC + 0.25 ∗numDesc + 0.25 ∗numAnc Abstraction 0.33 ∗abstractness + 0.33 ∗numInterf + 0.33 ∗iFImpl

mmohan03@qub.ac.uk Experimental Setup Each fitness function was run separately with 6 different open source Java programs, and repeated for each of the 3 search techniques. Each task was run 10 times.

Experimental Setup For a total of 720 runs. 4 Fitness Functions mmohan03@qub.ac.uk Experimental Setup 4 Fitness Functions 3 Search Techniques 6 Open Source Inputs 10 Runs Of Each Task For a total of 720 runs.

Input Programs Used Name Classes Lines Of Code mmohan03@qub.ac.uk JSON 1.1 12 167 JFlex 1.4.1 56 1,094 Apache-XmlRpc 3.1.1 100 712 Mango 78 598 Beaver 0.9.8 81 801 JHotDraw 5.3 241 3,297

Execution Times Input Program Overall Time Taken mmohan03@qub.ac.uk JSON 1.1 0h 3m 13s JFlex 1.4.1 2h 6m 38s Apache-XmlRpc 3.1.1 1h 23m 43s Mango 1h 1m 29s Beaver 0.9.8 1h 25m 4s JHotDraw 5.3 49h 28m 4s Total 55h 28m 11s

Comparison Of Searches mmohan03@qub.ac.uk Comparison Of Searches The Wilcoxon Rank-Sum/Mann– Whitney U statistical test was used to compare the results across the different searches. Simulated annealing was found to be statistically different to the other searches. The random results were also found to be significantly different to hill climbing. This could possibly be due to the input parameters not being optimal for the hill climbing search.

Comparison Of Functions mmohan03@qub.ac.uk Comparison Of Functions Across Each Input Program Average Wilcoxon Signed-Rank statistical test compared initial and final technical debt results and found that they were significantly better.

Refactoring Actions Applied mmohan03@qub.ac.uk Refactoring Actions Applied Across Each Input Program Average The similarity implies that there is a lack of available refactoring actions related to the metrics that make up the inheritance and abstraction functions.

mmohan03@qub.ac.uk Conclusion A practical method was developed using the A- CMA refactoring tool to reduce technical debt in Java programs. 3 search techniques were compared and simulated annealing was shown to be more successful than hill climbing and a random search.

mmohan03@qub.ac.uk Conclusion The technical debt function was compared against 3 other properties and was found to be more successful on average at improving the software. The coupling function gave better improvements for 2 of the inputs, possibly due to coupling being higher for these inputs and allowing for more of an improvement.

Opportunities For Future Work mmohan03@qub.ac.uk Opportunities For Future Work There is a possibility of using A-CMA’s parallel functionality to reduce the execution times of the search tasks. Further experimentation with individual metrics could provide insight into their effect on refactoring ability. The technical debt measure could be compared against other factors such as cohesion or complexity.

Email at: mmohan03@qub.ac.uk