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 f...
Main Authors: | , , , , |
---|---|
Format: | Article |
Language: | English |
Published: |
IEEE
2018-01-01
|
Series: | IEEE Access |
Subjects: | |
Online Access: | https://ieeexplore.ieee.org/document/8456513/ |
_version_ | 1819320532027310080 |
---|---|
author | Ally S. Nyamawe Hui Liu Zhendong Niu Wentao Wang Nan Niu |
author_facet | Ally S. Nyamawe Hui Liu Zhendong Niu Wentao Wang Nan Niu |
author_sort | Ally S. Nyamawe |
collection | DOAJ |
description | 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. |
first_indexed | 2024-12-24T11:21:04Z |
format | Article |
id | doaj.art-a7fa55db70364218baf54b64792a794a |
institution | Directory Open Access Journal |
issn | 2169-3536 |
language | English |
last_indexed | 2024-12-24T11:21:04Z |
publishDate | 2018-01-01 |
publisher | IEEE |
record_format | Article |
series | IEEE Access |
spelling | doaj.art-a7fa55db70364218baf54b64792a794a2022-12-21T16:58:14ZengIEEEIEEE Access2169-35362018-01-016494604947510.1109/ACCESS.2018.28689908456513Recommending Refactoring Solutions Based on Traceability and Code MetricsAlly S. Nyamawe0https://orcid.org/0000-0002-5210-259XHui Liu1Zhendong Niu2Wentao Wang3Nan Niu4School of Computer Science and Technology, Beijing Institute of Technology, Beijing, ChinaSchool of Computer Science and Technology, Beijing Institute of Technology, Beijing, ChinaSchool of Computer Science and Technology, Beijing Institute of Technology, Beijing, ChinaDepartment of Electrical Engineering and Computer Science, University of Cincinnati, Cincinnati, OH, USADepartment of Electrical Engineering and Computer Science, University of Cincinnati, Cincinnati, OH, USASoftware 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.https://ieeexplore.ieee.org/document/8456513/Entropyrefactoringrequirements traceabilitysolution recommendation |
spellingShingle | Ally S. Nyamawe Hui Liu Zhendong Niu Wentao Wang Nan Niu Recommending Refactoring Solutions Based on Traceability and Code Metrics IEEE Access Entropy refactoring requirements traceability solution recommendation |
title | Recommending Refactoring Solutions Based on Traceability and Code Metrics |
title_full | Recommending Refactoring Solutions Based on Traceability and Code Metrics |
title_fullStr | Recommending Refactoring Solutions Based on Traceability and Code Metrics |
title_full_unstemmed | Recommending Refactoring Solutions Based on Traceability and Code Metrics |
title_short | Recommending Refactoring Solutions Based on Traceability and Code Metrics |
title_sort | recommending refactoring solutions based on traceability and code metrics |
topic | Entropy refactoring requirements traceability solution recommendation |
url | https://ieeexplore.ieee.org/document/8456513/ |
work_keys_str_mv | AT allysnyamawe recommendingrefactoringsolutionsbasedontraceabilityandcodemetrics AT huiliu recommendingrefactoringsolutionsbasedontraceabilityandcodemetrics AT zhendongniu recommendingrefactoringsolutionsbasedontraceabilityandcodemetrics AT wentaowang recommendingrefactoringsolutionsbasedontraceabilityandcodemetrics AT nanniu recommendingrefactoringsolutionsbasedontraceabilityandcodemetrics |