Abstract

Code changes due to software change requests and bug fixing are inevitable in software lifecycle. The code modification may slowly deviate the code structure from its original structure that leads to unreadable code. Even though the code structure does not affect the software behaviour, it affects the code understandability and maintainability of software. Code refactoring is typically conducted to enhance the code structure; however, this task needs a lot of developers’ effort. Thus, this paper aims at developing a tool that will help programmers identify possible code refactoring.Weconsider two aspects of refactoring:(i) refactoring activities, and (ii) refactoring prediction model. In terms of refactoring activity, we focus on Extract Class. The object-oriented metrics are used to predict the possibility of code refactoring. The combination of two refactoring aspects recommends the possible refactoring effort and identify classes that are involved. As a result, we managed to get 79% percent of accuracy based on the 11 correct results out of 14 that the tool correctly detected. On top of supporting programmers in improving codes, this work also may give more insight into how refactoring improvessystems.

Highlights

  • Change requests and bugs fixing is one of the indicators that the software is still relevant to the business and customer

  • This strategy envelops the accompanying four fundamental steps represented as(i) find where refactoring is needed,(ii) analyzing the cost and benefit of performing the refactoring,(iii) apply refactoring technique, and(iv) assuring the behavior of the product is not affected.One of the main ideas of refactoring is to avoid bad smells in the code design.Brown et al (1998)argue that when centralized class hold all the responsibilities of system and the rest of the classes just hold data, complexity of a class like that led to the difficulty of reading the code which will affect the effort needed in the maintenance phase

  • To validate our proposed approach, we conduct an experiment by comparing classes that are selected to be refactored manually with the classes that are recommended based on our prediction model

Read more

Summary

Introduction

Change requests and bugs fixing is one of the indicators that the software is still relevant to the business and customer. Refactoring was defined by Fowler et al(1999) as “the process of changing a software system in such a way that it does not alter the external behavior of the code yet improves its internal structure.” This strategy envelops the accompanying four fundamental steps represented as(i) find where refactoring is needed,(ii) analyzing the cost and benefit of performing the refactoring,(iii) apply refactoring technique, and(iv) assuring the behavior of the product is not affected.One of the main ideas of refactoring is to avoid bad smells in the code design.Brown et al (1998)argue that when centralized class hold all the responsibilities of system and the rest of the classes just hold data, complexity of a class like that led to the difficulty of reading the code which will affect the effort needed in the maintenance phase Refactoring was defined by Fowler et al(1999) as “the process of changing a software system in such a way that it does not alter the external behavior of the code yet improves its internal structure.” This strategy envelops the accompanying four fundamental steps represented as(i) find where refactoring is needed,(ii) analyzing the cost and benefit of performing the refactoring,(iii) apply refactoring technique, and(iv) assuring the behavior of the product is not affected.One of the main ideas of refactoring is to avoid bad smells in the code design.Brown et al (1998)argue that when centralized class hold all the responsibilities of system and the rest of the classes just hold data, complexity of a class like that led to the difficulty of reading the code which will affect the effort needed in the maintenance phase

Objectives
Methods
Results
Conclusion
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call