Litcius/Paper detail

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

Mohammad Alkandari, Ali Kelkawi, Mahmoud O. Elish

2021IEEE Access15 citationsDOIOpen Access PDF

Abstract

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.

Topics & Concepts

Code refactoringCode smellComputer scienceAndroid (operating system)MaintainabilitySoftware qualityEmbedded systemSoftwareSource codeOperating systemSoftware engineeringSoftware developmentGreen IT and SustainabilityAdvanced Data Storage TechnologiesDistributed systems and fault tolerance