Publication | Closed Access
Identification of Move Method Refactoring Opportunities
337
Citations
27
References
2009
Year
Software MaintenanceEngineeringIndustrial EngineeringSoftware EngineeringObject OrientationSoftware AnalysisSystems EngineeringSoftware AspectSoftware Re-engineeringObject-oriented DesignNovel Entity PlacementAppropriate MetricsDesignComputer ScienceConceptual CriteriaCode RefactoringSoftware DesignMethod EngineeringProgram AnalysisSoftware Testing
Object‑oriented design places attributes and methods in classes based on conceptual criteria and metrics, and moving state or behavior can reduce coupling and increase cohesion, but identifying suitable refactoring opportunities is challenging and common across many systems. This paper proposes a methodology to identify Move Method refactoring opportunities that address feature‑envy anti‑patterns. The method uses a distance metric between entities and classes to generate behavior‑preserving refactoring suggestions, evaluates their impact with a novel entity‑placement metric, and presents them as a semi‑automatic recommendation for designers to approve. Evaluation on several open‑source projects demonstrates the approach’s effectiveness across qualitative, metric, conceptual, and efficiency dimensions.
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.
| Year | Citations | |
|---|---|---|
Page 1
Page 1