An Empirical Investigation on the Effect of Code Smells on Resource Usage of Android Mobile Applications

Code smells refer to suboptimal coding practices which impact software quality and software non-functional requirements such as performance, maintainability, and resource usage. Although desktop application code smells have been extensively studied in the literature, mobile applications are relative...

Full description

Bibliographic Details
Main Authors: Mohammad A. Alkandari, Ali Kelkawi, Mahmoud O. Elish
Format: Article
Language:English
Published: IEEE 2021-01-01
Series:IEEE Access
Subjects:
Online Access:https://ieeexplore.ieee.org/document/9410530/
_version_ 1818732153448431616
author Mohammad A. Alkandari
Ali Kelkawi
Mahmoud O. Elish
author_facet Mohammad A. Alkandari
Ali Kelkawi
Mahmoud O. Elish
author_sort Mohammad A. Alkandari
collection DOAJ
description Code smells refer to suboptimal coding practices which impact software quality and software non-functional requirements such as performance, maintainability, and resource usage. Although desktop application code smells have been extensively studied in the literature, mobile applications are relatively new in nature, and the effect of code smells is only recently being studied on mobile devices. This paper investigates the effect of code refactoring on enhancing both CPU usage and Memory usage. It presents a study of three code smells: HashMap Usage, Member Ignoring Method and Slow Loop, and eight open-source applications were selected from Github for testing purposes. The three aforementioned code smells were refactored individually and cumulatively to study their effects on a mobile phone’s resource usage, with CPU usage and memory usage as the metrics of choice. The resource usage of five different versions of eight different mobile applications were measured to find the optimal refactoring strategy. The results obtained suggest that refactoring HashMap Usage and Member Ignoring Methods yielded significantly an average improvement in CPU usage of 12.7% and 13.7% respectively, while the refactoring of all three code smells yielded an improvement of up to 7.1% in memory usage. This research shows that certain refactoring methods have significant impacts on improving both the CPU usage and Memory usage. These statistically significant results can be used as the basis of guidelines to assist in writing codes which utilize smartphones’ resources more efficiently and enhance their quality.
first_indexed 2024-12-17T23:29:03Z
format Article
id doaj.art-a90843852f6d41878348bf84e17dace2
institution Directory Open Access Journal
issn 2169-3536
language English
last_indexed 2024-12-17T23:29:03Z
publishDate 2021-01-01
publisher IEEE
record_format Article
series IEEE Access
spelling doaj.art-a90843852f6d41878348bf84e17dace22022-12-21T21:28:43ZengIEEEIEEE Access2169-35362021-01-019618536186310.1109/ACCESS.2021.30750409410530An Empirical Investigation on the Effect of Code Smells on Resource Usage of Android Mobile ApplicationsMohammad A. Alkandari0https://orcid.org/0000-0002-0893-6116Ali Kelkawi1https://orcid.org/0000-0002-1969-1169Mahmoud O. Elish2https://orcid.org/0000-0002-2767-0501Department of Computer Engineering, Kuwait University, Kuwait City, KuwaitDepartment of Computer Engineering, Kuwait University, Kuwait City, KuwaitDepartment of Computer Science, Gulf University for Science and Technology, Hawally, KuwaitCode smells refer to suboptimal coding practices which impact software quality and software non-functional requirements such as performance, maintainability, and resource usage. Although desktop application code smells have been extensively studied in the literature, mobile applications are relatively new in nature, and the effect of code smells is only recently being studied on mobile devices. This paper investigates the effect of code refactoring on enhancing both CPU usage and Memory usage. It presents a study of three code smells: HashMap Usage, Member Ignoring Method and Slow Loop, and eight open-source applications were selected from Github for testing purposes. The three aforementioned code smells were refactored individually and cumulatively to study their effects on a mobile phone’s resource usage, with CPU usage and memory usage as the metrics of choice. The resource usage of five different versions of eight different mobile applications were measured to find the optimal refactoring strategy. The results obtained suggest that refactoring HashMap Usage and Member Ignoring Methods yielded significantly an average improvement in CPU usage of 12.7% and 13.7% respectively, while the refactoring of all three code smells yielded an improvement of up to 7.1% in memory usage. This research shows that certain refactoring methods have significant impacts on improving both the CPU usage and Memory usage. These statistically significant results can be used as the basis of guidelines to assist in writing codes which utilize smartphones’ resources more efficiently and enhance their quality.https://ieeexplore.ieee.org/document/9410530/Code smellsAndroidresource usage
spellingShingle Mohammad A. Alkandari
Ali Kelkawi
Mahmoud O. Elish
An Empirical Investigation on the Effect of Code Smells on Resource Usage of Android Mobile Applications
IEEE Access
Code smells
Android
resource usage
title An Empirical Investigation on the Effect of Code Smells on Resource Usage of Android Mobile Applications
title_full An Empirical Investigation on the Effect of Code Smells on Resource Usage of Android Mobile Applications
title_fullStr An Empirical Investigation on the Effect of Code Smells on Resource Usage of Android Mobile Applications
title_full_unstemmed An Empirical Investigation on the Effect of Code Smells on Resource Usage of Android Mobile Applications
title_short An Empirical Investigation on the Effect of Code Smells on Resource Usage of Android Mobile Applications
title_sort empirical investigation on the effect of code smells on resource usage of android mobile applications
topic Code smells
Android
resource usage
url https://ieeexplore.ieee.org/document/9410530/
work_keys_str_mv AT mohammadaalkandari anempiricalinvestigationontheeffectofcodesmellsonresourceusageofandroidmobileapplications
AT alikelkawi anempiricalinvestigationontheeffectofcodesmellsonresourceusageofandroidmobileapplications
AT mahmoudoelish anempiricalinvestigationontheeffectofcodesmellsonresourceusageofandroidmobileapplications
AT mohammadaalkandari empiricalinvestigationontheeffectofcodesmellsonresourceusageofandroidmobileapplications
AT alikelkawi empiricalinvestigationontheeffectofcodesmellsonresourceusageofandroidmobileapplications
AT mahmoudoelish empiricalinvestigationontheeffectofcodesmellsonresourceusageofandroidmobileapplications