Recommending Refactoring Solutions Based on Traceability and Code Metrics

Software refactoring has been extensively used to rectify the design flaws and improve software quality without affecting its observable behaviors. For a given code smell, it is common that there exist multiple refactoring solutions. However, it is challenging for developers to select the best one from such potential solutions. Consequently, a number of approaches have been proposed to facilitate the selection. Such approaches compare and select among alternative refactoring solutions based on their impact on metrics of source code. However, their impact on the traceability between source code and requirements is ignored although the importance of such traceability has been well recognized. To this end, we select among alternative refactoring solutions according to how they improve the traceability as well as source code design. To quantify the quality of traceability and source code design we leverage the use of entropy-based and traditional coupling and cohesion metrics respectively. We virtually apply alternative refactoring solutions and measure their effect on the traceability and source code design. The one leading to greatest improvement is recommended. The proposed approach has been evaluated on a well-known data set. The evaluation results suggest that on up to 71% of the cases, developers prefer our recommendation to the traditional recommendation based on code metrics.

[1]  Hironori Washizaki,et al.  Recovering traceability links between requirements and source code in the same series of software products , 2013, SPLC '13.

[2]  Patrick Mäder,et al.  Software traceability: trends and future directions , 2014, FOSE.

[3]  Letha H. Etzkorn,et al.  A semantic entropy metric , 2002, J. Softw. Maintenance Res. Pract..

[4]  Marouane Kessentini,et al.  A context-based refactoring recommendation approach using simulated annealing: two industrial case studies , 2017, GECCO.

[5]  Ricardo Terra,et al.  JMove: A novel heuristic and tool to detect move method refactoring opportunities , 2018, J. Syst. Softw..

[6]  Andrew P. Black,et al.  An interactive ambient visualization for code smells , 2010, SOFTVIS '10.

[7]  Katsuro Inoue,et al.  Multi-Criteria Code Refactoring Using Search-Based Software Engineering , 2016, ACM Trans. Softw. Eng. Methodol..

[8]  Chris F. Kemerer,et al.  A Metrics Suite for Object Oriented Design , 2015, IEEE Trans. Software Eng..

[9]  Alessandro Bianchi,et al.  Evaluating software degradation through entropy , 2001, Proceedings Seventh International Software Metrics Symposium.

[10]  Patrick Mäder,et al.  Continuous Assessment of Software Traceability , 2016, 2016 IEEE/ACM 38th International Conference on Software Engineering Companion (ICSE-C).

[11]  Francesca Arcelli Fontana,et al.  An Experience Report on Using Code Smells Detection Tools , 2011, 2011 IEEE Fourth International Conference on Software Testing, Verification and Validation Workshops.

[12]  Mauricio A. Saca Refactoring improving the design of existing code , 2017, 2017 IEEE 37th Central America and Panama Convention (CONCAPAN XXXVII).

[13]  Nan Niu,et al.  Gray links in the use of requirements traceability , 2016, SIGSOFT FSE.

[14]  Mohamed Wiem Mkaouer,et al.  Recommendation system for software refactoring using innovization and interactive dynamic optimization , 2014, ASE.

[15]  Mesfin Abebe,et al.  Trends, Opportunities and Challenges of Software Refactoring: A Systematic Literature Review , 2014 .

[16]  Eduardo Figueiredo,et al.  Experimental Evaluation of Code Smell Detection Tools , 2015 .

[17]  Barbara Paech,et al.  Tracing Requirements and Source Code during Software Development: An Empirical Study , 2013, 2013 ACM / IEEE International Symposium on Empirical Software Engineering and Measurement.

[18]  Nan Niu,et al.  Supporting requirements traceability through refactoring , 2013, 2013 21st IEEE International Requirements Engineering Conference (RE).

[19]  Katsuro Inoue,et al.  MORE: A multi‐objective refactoring recommendation approach to introducing design patterns and fixing code smells , 2017, J. Softw. Evol. Process..

[20]  Adrian Trifu,et al.  Diagnosing design problems in object oriented systems , 2005, 12th Working Conference on Reverse Engineering (WCRE'05).

[21]  Yuanfang Cai,et al.  Interactive and guided architectural refactoring with search-based recommendation , 2016, SIGSOFT FSE.

[22]  Klaus D. Müller-Glaser,et al.  Traceability in a Fine Grained Software Configuration Management System , 2017, SWQD.

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

[24]  Eduardo Figueiredo,et al.  A review-based comparative study of bad smell detection tools , 2016, EASE.

[25]  Weizhong Shao,et al.  Monitor-Based Instant Software Refactoring , 2013, IEEE Transactions on Software Engineering.

[26]  Giuliano Antoniol,et al.  Recovering Traceability Links between Code and Documentation , 2002, IEEE Trans. Software Eng..

[27]  Olly Gotel,et al.  An analysis of the requirements traceability problem , 1994, Proceedings of IEEE International Conference on Requirements Engineering.

[28]  Johannes Stammel,et al.  Search-based determination of refactorings for improving the class structure of object-oriented systems , 2006, GECCO.

[29]  Alim Ul Gias,et al.  Achieving Better Requirements to Code Traceability: Which Refactoring Should Be Done First? , 2016, 2016 10th International Conference on the Quality of Information and Communications Technology (QUATIC).

[30]  Sayyed Garba Maisikeli EVALUATION AND STUDY OF SOFTWARE DEGRADATION IN THE EVOLUTION OF SIX VERSIONS OF STABLE AND MATURED OPEN SOURCE SOFTWARE FRAMEWORK , 2016 .

[31]  Ricardo Terra,et al.  Recommending Move Method refactorings using dependency sets , 2013, 2013 20th Working Conference on Reverse Engineering (WCRE).

[32]  Alexander Chatzigeorgiou,et al.  JDeodorant: Identification and Removal of Feature Envy Bad Smells , 2007, ICSM.

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

[34]  Yann-Gaël Guéhéneuc,et al.  Requirements Traceability for Object Oriented Systems by Partitioning Source Code , 2011, 2011 18th Working Conference on Reverse Engineering.

[35]  Francesca Arcelli Fontana,et al.  Automatic detection of bad smells in code: An experimental assessment , 2012, J. Object Technol..

[36]  Ahmed E. Hassan,et al.  Predicting faults using the complexity of code changes , 2009, 2009 IEEE 31st International Conference on Software Engineering.

[37]  Ali Idri,et al.  Chidamber and Kemerer Object-Oriented Measures: Analysis of their Design from the Metrology Perspective , 2014 .

[38]  Eleni Stroulia,et al.  Identification and application of Extract Class refactorings in object-oriented systems , 2012, J. Syst. Softw..

[39]  Alexander Egyed,et al.  Assessing the effect of requirements traceability for software maintenance , 2012, 2012 28th IEEE International Conference on Software Maintenance (ICSM).

[40]  Challa Bonja,et al.  Metrics for class cohesion and similarity between methods , 2006, ACM-SE 44.

[41]  Gerardo Canfora,et al.  How changes affect software entropy: an empirical study , 2014, Empirical Software Engineering.

[42]  Jane Cleland-Huang,et al.  A Framework for Evaluating Traceability Benchmark Metrics , 2012 .

[43]  Sang Joon Kim,et al.  A Mathematical Theory of Communication , 2006 .

[44]  Camelia Chisăliţă-Creţu The Multi-Objective Refactoring Set Selection Problem - A Solution Representation Analysis , 2011 .

[45]  Gabriele Bavota,et al.  Methodbook: Recommending Move Method Refactorings via Relational Topic Models , 2014, IEEE Transactions on Software Engineering.

[46]  Eleni Stroulia,et al.  JDeodorant: identification and application of extract class refactorings , 2011, 2011 33rd International Conference on Software Engineering (ICSE).

[47]  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.

[48]  Denys Poshyvanyk,et al.  Using Traceability Links to Assess and Maintain the Quality of Software Documentation , 2007 .

[49]  Gabriele Bavota,et al.  On the Impact of Refactoring Operations on Code Quality Metrics , 2014, 2014 IEEE International Conference on Software Maintenance and Evolution.

[50]  Andrew P. Black,et al.  Refactoring Tools: Fitness for Purpose , 2008, IEEE Software.

[51]  Patrick Mäder,et al.  A quality model for the systematic assessment of requirements traceability , 2015, 2015 IEEE 23rd International Requirements Engineering Conference (RE).

[52]  Cristina Marinescu,et al.  iPlasma: An Integrated Platform for Quality Assessment of Object-Oriented Design , 2005, ICSM.

[53]  Houari A. Sahraoui,et al.  Search-Based Refactoring Using Recorded Code Changes , 2013, 2013 17th European Conference on Software Maintenance and Reengineering.

[54]  Zhendong Niu,et al.  Traceability-enabled refactoring for managing just-in-time requirements , 2014, 2014 IEEE 22nd International Requirements Engineering Conference (RE).

[55]  Letha H. Etzkorn,et al.  An Entropy-Based Approach to Assessing Object-Oriented Software Maintainability and Degradation - A Method and Case Study , 2006, Software Engineering Research and Practice.

[56]  Yann-Gaël Guéhéneuc,et al.  An empirical study on the importance of source code entities for requirements traceability , 2015, Empirical Software Engineering.

[57]  Zhe Dang,et al.  Entropy and software systems: towards an information-theoretic foundation of software testing , 2010, FoSER '10.