Recommending refactoring solutions based on traceability and code metrics

Ally S. Nyamawe, Hui Liu*, Zhendong Niu, Wentao Wang, Nan Niu

*Corresponding author for this work

Research output: Contribution to journalArticlepeer-review

20 Citations (Scopus)

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 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.

Original languageEnglish
Article number8456513
Pages (from-to)49460-49475
Number of pages16
JournalIEEE Access
Volume6
DOIs
Publication statusPublished - 5 Sept 2018

Keywords

  • Entropy
  • Refactoring
  • Requirements traceability
  • Solution recommendation

Fingerprint

Dive into the research topics of 'Recommending refactoring solutions based on traceability and code metrics'. Together they form a unique fingerprint.

Cite this