Recommending Refactoring Solutions Based on Traceability and Code Metrics
Authors:
Open Access
- 6 September 2018
- journal article
- research article
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Access
- Vol. 6, 49460-49475
Abstract
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 entropybased 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.Keywords
Funding Information
- National Natural Science Foundation of China (61472034, 61772071, 61690205)
- National Key Research and Development Program of China (2016YFB1000801)
- National Science Foundation (1350487)
This publication has 48 references indexed in Scilit:
- JMove: A novel heuristic and tool to detect move method refactoring opportunitiesJournal of Systems and Software, 2018
- Traceability in a Fine Grained Software Configuration Management System2016
- On the Impact of Refactoring Operations on Code Quality Metrics2014
- An empirical study on the importance of source code entities for requirements traceabilityEmpirical Software Engineering, 2014
- Search-Based Refactoring Using Recorded Code Changes2013
- Identification and application of Extract Class refactorings in object-oriented systemsJournal of Systems and Software, 2012
- How changes affect software entropy: an empirical studyEmpirical Software Engineering, 2012
- DECOR: A Method for the Specification and Detection of Code and Design SmellsIEEE Transactions on Software Engineering, 2009
- Identification of Move Method Refactoring OpportunitiesIEEE Transactions on Software Engineering, 2009
- A semantic entropy metricJournal of Software Maintenance and Evolution: Research and Practice, 2002