Suppr超能文献

安卓应用的代码异味分析及降低电池消耗的解决方案。

Code smells analysis for android applications and a solution for less battery consumption.

作者信息

Gupta Aakanshi, Suri Bharti, Sharma Deepanshu, Misra Sanjay, Fernandez-Sanz Luis

机构信息

Department of Computer Science and Engineering, Amity University Uttar Pradesh, Noida, India.

University School of Information, Communication, and Technology, Guru Gobind Singh Indraprastha University, New Delhi, India.

出版信息

Sci Rep. 2024 Jul 26;14(1):17683. doi: 10.1038/s41598-024-67660-z.

Abstract

In the digitization era, the battery consumption factor plays a vital role for the devices that operate Android software, expecting them to deliver high performance and good maintainability.The study aims to analyze the Android-specific code smells, their impact on battery consumption, and the formulation of a mathematical model concerning static code metrics hampered by the code smells. We studied the impact on battery consumption by three Android-specific code smells, namely: No Low Memory Resolver (NLMR), Slow Loop (SL) and Unclosed Closable, considering 4,165 classes of 16 Android applications. We used a rule-based classification method that aids the refactoring ideology. Subsequently, multi-linear regression (MLR) modeling is used to evaluate battery usage against the software metrics of smelly code instances. Moreover, it was possible to devise a correlation for the software metric influenced by battery consumption and rule-based classifiers. The outcome confirms that the refactoring of the considered code smells minimizes the battery consumption levels. The refactoring method accounts for an accuracy of 87.47% cumulatively. The applied MLR model has an R-square value of 0.76 for NLMR and 0.668 for SL, respectively. This study can guide the developers towards a complete package for the focused development life cycle of Android code, helping them minimize smartphone battery consumption and use the saved battery lives for other operations, contributing to the green energy revolution in mobile devices.

摘要

在数字化时代,电池消耗因素对于运行安卓软件的设备至关重要,这些设备需要具备高性能和良好的可维护性。本研究旨在分析安卓特有的代码异味、它们对电池消耗的影响,以及构建一个关于受代码异味影响的静态代码指标的数学模型。我们研究了三种安卓特有的代码异味对电池消耗的影响,即:无低内存解析器(NLMR)、慢循环(SL)和未关闭可关闭对象,研究对象为16个安卓应用程序中的4165个类。我们使用了一种基于规则的分类方法,该方法有助于重构思想。随后,使用多元线性回归(MLR)建模来根据有异味代码实例的软件指标评估电池使用情况。此外,还可以为受电池消耗和基于规则的分类器影响的软件指标设计一种相关性。结果证实,对所考虑的代码异味进行重构可将电池消耗水平降至最低。重构方法的累积准确率为87.47%。应用的MLR模型对于NLMR的R平方值分别为0.76,对于SL为0.668。本研究可以指导开发者在安卓代码的专注开发生命周期中获得一个完整的方案,帮助他们最大限度地减少智能手机的电池消耗,并将节省的电池寿命用于其他操作,为移动设备的绿色能源革命做出贡献。

https://cdn.ncbi.nlm.nih.gov/pmc/blobs/9164/11291680/213e24444b43/41598_2024_67660_Fig1_HTML.jpg

文献AI研究员

20分钟写一篇综述,助力文献阅读效率提升50倍。

立即体验

用中文搜PubMed

大模型驱动的PubMed中文搜索引擎

马上搜索

文档翻译

学术文献翻译模型,支持多种主流文档格式。

立即体验