Identification of Move Method Refactoring Opportunities

被引:273
作者
Tsantalis, Nikolaos [1 ]
Chatzigeorgiou, Alexander [1 ]
机构
[1] Univ Macedonia, Dept Appl Math, Thessaloniki 54006, Greece
关键词
Move Method refactoring; Feature Envy; object-oriented design; Jaccard distance; design quality; SOFTWARE; METRICS;
D O I
10.1109/TSE.2009.1
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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.
引用
收藏
页码:347 / 367
页数:21
相关论文
共 33 条
[1]   Evaluating the impact of Object-Oriented design on software quality [J].
Abreu, FBE ;
Melo, W .
PROCEEDINGS OF THE 3RD INTERNATIONAL SOFTWARE METRICS SYMPOSIUM, 1996, :90-99
[2]  
ABREU FBE, 1995, P 9 EUR C OBJ OR PRO
[3]  
[Anonymous], 2003, ALAN APT SERIES
[4]   A hierarchical model for object-oriented design quality assessment [J].
Bansiya, J ;
Davis, CG .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2002, 28 (01) :4-17
[5]   A validation of object-oriented design metrics as quality indicators [J].
Basili, VR ;
Briand, LC ;
Melo, WL .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 1996, 22 (10) :751-761
[6]   Validation of the coupling dependency metric as a predictor of run-time failures and maintenance measures [J].
Binkley, AB ;
Schach, SR .
PROCEEDINGS OF THE 1998 INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, 1998, :452-455
[7]  
Briand L. C., 1999, Proceedings of the 1999 International Conference on Software Engineering (IEEE Cat. No.99CB37002), P345, DOI 10.1109/ICSE.1999.841025
[8]   A Unified Framework for Cohesion Measurement in Object-Oriented Systems [J].
Briand L.C. ;
Daly J.W. ;
Wüst J. .
Empirical Software Engineering, 1998, 3 (1) :65-117
[9]  
Briand L. C., 1999, Proceedings IEEE International Conference on Software Maintenance - 1999 (ICSM'99). `Software Maintenance for Business Change' (Cat. No.99CB36360), P475, DOI 10.1109/ICSM.1999.792645
[10]   Modeling development effort in object-oriented systems using design properties [J].
Briand, LC ;
Wüst, J .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2001, 27 (11) :963-986