Identification of generalization refactoring opportunities

Generalization refactoring helps relate classes and share functions, including both interfaces and implementation, by inheritance. To apply generalization refactoring, developers should first identify potential generalization refactoring opportunities, i.e., software entities that might benefit from generalization refactoring. For non-trivial software systems, manual identification of these opportunities is challenging and time-consuming. However, to the best of our knowledge, no existing tools have been specifically designed for this task. As a result, people have to identify these opportunities manually or with the help of tools designed for other purposes, e.g., clone detectors. To this end, we propose a tool GenReferee (Generalization Referee) to identify potential refactoring opportunities according to conceptual relationship, implementation similarity, structural correspondence, and inheritance hierarchies. It was first calibrated on two non-trivial open source applications, and then evaluated on another three. Evaluation results suggest that the proposed approach is effective and efficient.

[1]  Miryung Kim,et al.  Program element matching for multi-version program analyses , 2006, MSR '06.

[2]  Yann-Gaël Guéhéneuc,et al.  DECOR: A Method for the Specification and Detection of Code and Design Smells , 2010, IEEE Transactions on Software Engineering.

[3]  J. W. Hunt,et al.  An Algorithm for Differential File Comparison , 2008 .

[4]  Gabriele Bavota,et al.  Identifying Extract Class refactoring opportunities using structural and semantic cohesion measures , 2011, J. Syst. Softw..

[5]  Michael W. Godfrey,et al.  Using origin analysis to detect merging and splitting of source code entities , 2005, IEEE Transactions on Software Engineering.

[6]  Oscar Nierstrasz,et al.  Finding refactorings via change metrics , 2000, OOPSLA '00.

[7]  Yann-Gaël Guéhéneuc,et al.  Automatic Generation of Detection Algorithms for Design Defects , 2006, 21st IEEE/ACM International Conference on Automated Software Engineering (ASE'06).

[8]  M.J. Munro,et al.  Product Metrics for Automatic Identification of "Bad Smell" Design Problems in Java Source-Code , 2005, 11th IEEE International Software Metrics Symposium (METRICS'05).

[9]  Zheng Wang,et al.  BMAT - A Binary Matching Tool for Stale Profile Propagation , 2000, J. Instr. Level Parallelism.

[10]  William C. Wake,et al.  Refactoring Workbook , 2003 .

[11]  Shinji Kusumoto,et al.  CCFinder: A Multilinguistic Token-Based Code Clone Detection System for Large Scale Source Code , 2002, IEEE Trans. Software Eng..

[12]  Andreas Zeller,et al.  Mining version histories to guide software changes , 2005, Proceedings. 26th International Conference on Software Engineering.

[13]  Rainer Koschke,et al.  Clone Detection Using Abstract Syntax Suffix Trees , 2006, 2006 13th Working Conference on Reverse Engineering.

[14]  Tom Mens,et al.  Identifying refactoring opportunities using logic meta programming , 2003, Seventh European Conference onSoftware Maintenance and Reengineering, 2003. Proceedings..

[15]  Yann-Gaël Guéhéneuc,et al.  Recognizing Words from Source Code Identifiers Using Speech Recognition Techniques , 2010, 2010 14th European Conference on Software Maintenance and Reengineering.

[16]  Wuu Yang,et al.  Identifying syntactic differences between two programs , 1991, Softw. Pract. Exp..

[17]  Alexander Chatzigeorgiou,et al.  Identification of extract method refactoring opportunities for the decomposition of methods , 2011, J. Syst. Softw..

[18]  Shinji Kusumoto,et al.  ARIES: refactoring support tool for code clone , 2005, ACM SIGSOFT Softw. Eng. Notes.

[19]  Zhendong Niu,et al.  Identifying Fragments to be Extracted from Long Methods , 2009, 2009 16th Asia-Pacific Software Engineering Conference.

[20]  Miryung Kim,et al.  Automatic Inference of Structural Changes for Matching across Program Versions , 2007, 29th International Conference on Software Engineering (ICSE'07).

[21]  Alexander Chatzigeorgiou,et al.  Identification of Move Method Refactoring Opportunities , 2009, IEEE Transactions on Software Engineering.

[22]  Dawn J Lawrie,et al.  AN EMPIRICAL COMPARISON OF TECHNIQUES FOR EXTRACTING CONCEPT ABBREVIATIONS FROM IDENTIFIERS , 2006 .

[23]  Shinji Kusumoto,et al.  On Software Maintenance Process Improvement Based on Code Clone Analysis , 2002, PROFES.

[24]  Tracy Hall,et al.  Code Bad Smells: a review of current knowledge , 2011, J. Softw. Maintenance Res. Pract..

[25]  Abraham Bernstein,et al.  Detecting similar Java classes using tree algorithms , 2006, MSR '06.

[26]  Miryung Kim,et al.  Discovering and representing systematic code changes , 2009, 2009 IEEE 31st International Conference on Software Engineering.

[27]  Friedrich Steimann,et al.  The Infer Type Refactoring and its Use for Interface-Based Programming , 2007, J. Object Technol..

[28]  Ralph E. Johnson,et al.  Automated Detection of Refactorings in Evolving Components , 2006, ECOOP.

[29]  Ivan Moore Guru - A Tool for Automatic Restructuring of Self Inheritance Hierarchies , 1995 .

[30]  Shinji Kusumoto,et al.  ARIES: Refactoring support environment based on code clone analysis , 2004, IASTED Conf. on Software Engineering and Applications.

[31]  Brenda S. Baker,et al.  A Program for Identifying Duplicated Code , 1992 .

[32]  Emily Hill,et al.  Mining source code to automatically split identifiers for software analysis , 2009, 2009 6th IEEE International Working Conference on Mining Software Repositories.

[33]  Robert J. Walker,et al.  Approximate Structural Context Matching: An Approach to Recommend Relevant Examples , 2006, IEEE Transactions on Software Engineering.

[34]  J. Laski,et al.  Identification of program modifications and its applications in software maintenance , 1992, Proceedings Conference on Software Maintenance 1992.

[35]  Yann-Gaël Guéhéneuc,et al.  TIDIER: an identifier splitting approach using speech recognition techniques , 2013, J. Softw. Evol. Process..

[36]  Frank Tip,et al.  Refactoring for generalization using type constraints , 2003, OOPSLA 2003.

[37]  Eleni Stroulia,et al.  UMLDiff: an algorithm for object-oriented design differencing , 2005, ASE.

[38]  Frank Tip,et al.  Reengineering class hierarchies using concept analysis , 1998, SIGSOFT '98/FSE-6.

[39]  Serge Demeyer,et al.  On The Detection of Test Smells: A Metrics-Based Approach for General Fixture and Eager Test , 2007, IEEE Trans. Software Eng..

[40]  Forrest Shull,et al.  Detecting defects in object-oriented designs: using reading techniques to increase software quality , 1999, OOPSLA '99.

[41]  Denys Poshyvanyk,et al.  Using structural and textual information to capture feature coupling in object-oriented software , 2011, Empirical Software Engineering.

[42]  William F. Opdyke,et al.  Refactoring object-oriented frameworks , 1992 .

[43]  Robert J. Walker,et al.  Determining detailed structural correspondence for generalization tasks , 2007, ESEC-FSE '07.

[44]  Friedrich Steimann,et al.  Systematically refactoring inheritance to delegation in java , 2008, 2008 ACM/IEEE 30th International Conference on Software Engineering.

[45]  Walter F. Tichy,et al.  Extensible language-aware merging , 2002, International Conference on Software Maintenance, 2002. Proceedings..

[46]  Tom Mens,et al.  A survey of software refactoring , 2004, IEEE Transactions on Software Engineering.

[47]  Gregor Snelting,et al.  Refactoring class hierarchies with KABA , 2004, OOPSLA '04.

[48]  Arie van Deursen,et al.  Using Cluster Analysis to Improve the Design of Component Interfaces , 2008, 2008 23rd IEEE/ACM International Conference on Automated Software Engineering.

[49]  Gabriele Bavota,et al.  Playing with refactoring: Identifying extract class opportunities through game theory , 2010, 2010 IEEE International Conference on Software Maintenance.

[50]  Alexander Chatzigeorgiou,et al.  Identification of refactoring opportunities introducing polymorphism , 2010, J. Syst. Softw..