Identification of Move Method Refactoring Opportunities
By Nikolaos Tsantalis, A. Chatzigeorgiou. IEEE Transactions on Software Engineering, 2009
372 citations recorded by the source corpus.
Placement of attributes/methods within classes in an object-oriented system is usually guided by conceptual criteria and aided by appropriate metrics. Moving state and behavior between classes can help reduce coupling and increase cohesion, but it is nontrivial to identify where such refactorings should be applied. In this paper, we propose a methodology for the identification of Move Method refactoring opportunities that constitute a way for solving many common feature envy bad smells. An algorithm that employs the notion of distance between system entities (attributes/methods) and classes extracts a list of behavior-preserving refactorings based on the examination of a set of preconditions. In practice, a software system may exhibit such problems in many different places. Therefore, our approach measures the effect of all refactoring suggestions based on a novel entity placement metric that quantifies how well entities have been placed in system classes. The proposed methodology can be regarded as a semi-automatic approach since the designer will eventually decide whether a suggested refactoring should be applied or not based on conceptual or other design quality criteria. The evaluation of the proposed approach has been performed considering qualitative, metric, conceptual, and efficiency aspects of the suggested refactorings in a number of open-source projects.
Subfields: Information Systems, Software
View Paper: https://www.semanticscholar.org/paper/88c7e496d828ced15dca824d6fcb24de8c4c6804
How researchers see this paper
The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.
In Information Systems
- Earl T. Barr
- Gabriele Bavota
- Premkumar T. Devanbu
- Michele Tufano
- Denys Poshyvanyk
- Mark Harman
- Charles Sutton
- Miltiadis Allamanis
In Software
- Earl T. Barr
- Gabriele Bavota
- Premkumar T. Devanbu
- Denys Poshyvanyk
- Michele Tufano
- Yuriy Brun
- Charles Sutton
- Massimiliano Di Penta
Citations in the corpus
- On the diffuseness and the impact on maintainability of code smells: a large scale empirical investigation (2017, methodology): “Indeed, DECOR identifies only one of the actual instances, while JDeodorant and HIST detect three of them.”
- Why we refactor? confessions of GitHub contributors (2016, background): “As a practical consequence of these studies, refactoring recommendation systems [1] have been proposed to foster the use of refactoring tools and leverage the benefits of refactoring, by alerting developers about potential refactoring opportunities [35, 36, 2, 30, 3, 31].”
- The plastic surgery hypothesis (2014, background): “The early success in automating program repair has triggered a dramatic recent upsurge in research on automated repair [2,9,19,24, 29], refactoring [10, 12, 36], and genetic improvement [14, 22, 23, 30, 42].”
- When and Why Your Code Starts to Smell Bad (and Whether the Smells Go Away) (2017, positive): “Tsantalis and Chatzigeorgiou [79] presented JDeodor-ant, a tool able to detect instances of Feature Envy smells with the aim of suggesting move method refactoring opportunities.”
- Comparing and experimenting machine learning techniques for code smell detection (2015, methodology): “For example, the JDeodorant (Tsantalis et al., 2009) tool has not been considered, because it is not possible (without customizations) to run it in batch without a manual configuration of the project that has to be analyzed.”