An Empirical Evaluation on the Effect Refactoring Code Smells Mobile Applications Android with ASATs on Resource Usage

Indira Syawanodya (1), Dian Anggraini (2), Fajar Muhammad Al-Hijri (3), Mochamad Iqbal Ardimansyah (4)
(1) Department of Software Engineering, Universitas Pendidikan Indonesia, Bandung, 40625, Indonesia
(2) Department of Software Engineering, Universitas Pendidikan Indonesia, Bandung, 40625, Indonesia
(3) Department of Software Engineering, Universitas Pendidikan Indonesia, Bandung, 40625, Indonesia
(4) Department of Software Engineering, Universitas Pendidikan Indonesia, Bandung, 40625, Indonesia
Fulltext View | Download
How to cite (IJASEIT) :
Syawanodya, Indira, et al. “An Empirical Evaluation on the Effect Refactoring Code Smells Mobile Applications Android With ASATs on Resource Usage”. International Journal on Advanced Science, Engineering and Information Technology, vol. 14, no. 1, Feb. 2024, pp. 214-23, doi:10.18517/ijaseit.14.1.18852.
The Application is closely connected to mobile devices designed for many people and has maintenance, However, even maintenance can contain violations such as code smells that effect non-functional requirements, specifically the use of CPU and memory resources. When the software has a rapid use of resources, it gives rise to the phenomenon that the user may switch or uninstall the software. The solution to this phenomenon is to explore resource-related code smells and fix them by refactoring them. Developments to explore code smells came with ASATs, namely SonarQube, which 85,000 organizations are already using to speed up analyzing code in software. This topic is related to code smells, and the research objective is to analyze and compare the performance of the original versions and single or cumulative refactored versions of Android mobile software using the Design Research Methodology (DRM) approach. Code smells are represented based on the classification on SonarQube, namely Blocker, Critical, Major, and Minor, with code smells such as HashMap Usage, Member Ignoring Method, and Slow Loop. Aspects tested include Fixed Detection Ratio (FDR), improvement, CPU, and memory usage. Based on the results of the research, it shows the depreciation of code smells which is proven to significantly increase CPU performance in a single refactoring, namely Member Ignoring Method and Critical by 7.7% and 9.90%, respectively. Moreover, single refactoring offers developers advantages reducing high costs, diminished exertion, and truncated maintenance duration. However, the cumulative refactoring occasionally endeavors hold the potential be high improvements.

J. Oliveira, M. Viggiato, M. Santos, E. Figueiredo, and H. Marques-Neto, “An Empirical Study on the Impact of Android Code Smells on Resource Usage,” Jul. 2018, pp. 314–359, doi: 10.18293/SEKE2018-157.

S. Habchi, N. Moha, and R. Rouvoy, “Android code smells: From introduction to refactoring,” J. Syst. Softw., vol. 177, p. 110964, 2021, doi:10.1016/j.jss.2021.110964.

U. A. Mannan, I. Ahmed, R. A. M. Almurshed, D. Dig, and C. Jensen, “Understanding code smells in android applications,” Proc. - Int. Conf. Mob. Softw. Eng. Syst. MOBILESoft 2016, pp. 225–236, 2016, doi: 10.1145/2897073.2897094.

G. Hecht, N. Moha, and R. Rouvoy, “An empirical study of the performance impacts of Android code smells,” in Proceedings of the International Conference on Mobile Software Engineering and Systems, May 2016, pp. 59–69, doi:10.1145/2897073.2897100.

G. Rasool and Z. Arshad, “A Lightweight Approach for Detection of Code Smells,” Arab. J. Sci. Eng., vol. 42, no. 2, pp. 483–506, 2017, doi:10.1007/s13369-016-2238-8.

D. Stefanović, D. Nikolić, D. Dakić, I. Spasojević, and S. Ristić, “Static code analysis tools: A systematic literature review,” Ann. DAAAM Proc. Int. DAAAM Symp., vol. 31, no. 1, pp. 565–573, 2020, doi: 10.2507/31st.daaam.proceedings.078.

D. Marcilio, C. A. Furia, R. Bonifácio, and G. Pinto, “SpongeBugs: Automatically generating fix suggestions in response to static code analysis warnings,” J. Syst. Softw., vol. 168, p. 110671, 2020. doi:10.1016/j.jss.2020.110671.

D. Nikolic, D. Stefanovic, D. Dakic, S. Sladojevic, and S. Ristic, “Analysis of the Tools for Static Code Analysis,” 2021 20th Int. Symp. INFOTEH-JAHORINA, INFOTEH 2021 - Proc., no. March, pp. 17–19, 2021, doi:10.1109/infoteh51037.2021.9400688.

J. Wang, Y. Huang, S. Wang, and Q. Wang, “Find Bugs in Static Bug Finders,” IEEE Int. Conf. Progr. Compr., vol. 2022-March, pp. 516–527, 2022, doi:10.1145/3377811.3380380.

D. Marcilio, R. Bonifacio, E. Monteiro, E. Canedo, W. Luz, and G. Pinto, “Are static analysis violations really fixed? a closer look at realistic usage of sonarqube,” IEEE Int. Conf. Progr. Compr., vol. 2019-May, pp. 209–219, 2019, doi:10.1109/ICPC.2019.00040.

M. A. Alkandari, A. Kelkawi, and M. O. Elish, “An Empirical Investigation on the Effect of Code Smells on Resource Usage of Android Mobile Applications,” IEEE Access, vol. 9, pp. 61853–61863, 2021, doi:10.1109/access.2021.3075040.

L. Cruz and R. Abreu, “Performance-Based Guidelines for Energy Efficient Mobile Applications,” in 2017 IEEE/ACM 4th International Conference on Mobile Software Engineering and Systems (MOBILESoft), May 2017, pp. 46–57, doi:10.1109/MobileSoft.2017.19.

A. Carette, M. A. A. Younes, G. Hecht, N. Moha, and R. Rouvoy, “Investigating the energy impact of Android smells,” in 2017 IEEE 24th International Conference on Software Analysis, Evolution and Reengineering (SANER), Feb. 2017, pp. 115–126, doi:10.1109/saner.2017.7884614.

D. Kwan Kim, “Towards Performance-Enhancing Programming for Android Application Development,” Int. J. Contents, vol. 13, no. 4, pp. 39–46, 2017, doi:10.5392/IJoC.2017.13.4.039.

A. Wibowo, A. R. Chrismanto, M. N. A. Rini, and L. Chrisantyo, “Mobile Application Performance Improvement with the Implementation of Code Refactor Based on Code Smells Identification: Dutataniku Agriculture Mobile App Case Study,” in 2022 Seventh International Conference on Informatics and Computing (ICIC), Dec. 2022, pp. 1–7, doi: 10.1109/ICIC56845.2022.10006961.

Q. Xu, J. C. Davis, Y. C. Hu, and A. Jindal, “An Empirical Study on the Impact of Deep Parameters on Mobile App Energy Usage,” in 2022 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER), Mar. 2022, pp. 844–855, doi: 10.1109/SANER53432.2022.00103.

R. Verdecchia, R. Aparicio Saez, G. Procaccianti, and P. Lago, “Empirical Evaluation of the Energy Impact of Refactoring Code Smells,” 2018, pp. 365–345, doi: 10.29007/dz83.

H. Anwar, D. Pfahl, and S. N. Srirama, “Evaluating the Impact of Code Smell Refactoring on the Energy Consumption of Android Applications,” in 2019 45th Euromicro Conference on Software Engineering and Advanced Applications (SEAA), Aug. 2019, pp. 82–86, doi: 10.1109/SEAA.2019.00021.

K. Etemadi Someoliayi et al., “Sorald: Automatic Patch Suggestions for SonarQube Static Analysis Violations,” IEEE Trans. Dependable Secur. Comput., pp. 1–17, 2022, doi:10.1109/TDSC.2022.3167316.

A. Guerra-Manzanares and M. Välbe, “Cross-device behavioral consistency: Benchmarking and implications for effective android malware detection,” Mach. Learn. with Appl., vol. 9, p. 100357, Sep. 2022, doi: 10.1016/j.mlwa.2022.100357.

F. Palomba, D. Di Nucci, A. Panichella, A. Zaidman, and A. De Lucia, “Lightweight detection of Android-specific code smells: The aDoctor project,” in 2017 IEEE 24th International Conference on Software Analysis, Evolution and Reengineering (SANER), Feb. 2017, pp. 487–491, doi: 10.1109/saner.2017.7884659.

W. Choi, G. Necula, and K. Sen, “Guided GUI testing of Android apps with minimal restart and approximate learning,” ACM SIGPLAN Not., vol. 48, no. 10, pp. 623–639, 2013, doi: 10.1145/2544173.2509552.

M. Nass, E. Alegroth, and R. Feldt, “Augmented testing: Industry feedback to shape a new testing technology,” Proc. - 2019 IEEE 12th Int. Conf. Softw. Testing, Verif. Valid. Work. ICSTW 2019, pp. 176–183, 2019, doi: 10.1109/ICSTW.2019.00048.

X. Gao, Z. Gu, Z. Li, H. Jamjoom, and C. Wang, “Houdini’s Escape: Breaking the Resource Rein of Linux Control Groups,” in Proceedings of the 2019 ACM SIGSAC Conference on Computer and Communications Security, Nov. 2019, pp. 1073–1086, doi:10.1145/3319535.3354227.

J. Lee, A. V. Raja, and D. Gao, “SplitSecond: Flexible Privilege Separation of Android Apps,” in 2019 17th International Conference on Privacy, Security and Trust (PST), Aug. 2019, pp. 1–10, doi:10.1109/PST47121.2019.8949067.

E. Wen, J. Cao, J. Shen, and X. Liu, “Fraus: Launching Cost-efficient and Scalable Mobile Click Fraud Has Never Been So Easy,” in 2018 IEEE Conference on Communications and Network Security (CNS), May 2018, pp. 1–9, doi: 10.1109/CNS.2018.8433126.

V. Lenarduzzi, N. Saarimäki, and D. Taibi, “Some SonarQube issues have a significant but small effect on faults and changes. A large-scale empirical study,” J. Syst. Softw., vol. 170, p. 110750, Dec. 2020, doi:10.1016/j.jss.2020.110750.

P. H. De Andrade Gomes, R. E. Garcia, G. Spadon, D. M. Eler, C. Olivete, and R. C. M. Correia, “Teaching software quality via source code inspection tool,” Proc. - Front. Educ. Conf. FIE, vol. 2017-Octob, pp. 1–8, 2017, doi: 10.1109/FIE.2017.8190658.

D. Stefanović, D. Nikolić, S. Havzi, T. Lolić, and D. Dakić, “Identification of strategies over tools for static code analysis,” Identif. Strateg. over tools static code Anal., vol. 1163, no. 012012, pp. 1–9, 2021.

I. Blasquez and H. Leblanc, “Experience in learning test-driven development: space invaders project-driven,” in Proceedings of the 23rd Annual ACM Conference on Innovation and Technology in Computer Science Education, Jul. 2018, pp. 111–116, doi: 10.1145/3197091.3197132.

O. Hamdi, A. Ouni, E. A. AlOmar, M. O Cinneide, and M. W. Mkaouer, “An Empirical Study on the Impact of Refactoring on Quality Metrics in Android Applications,” in 2021 IEEE/ACM 8th International Conference on Mobile Software Engineering and Systems (MobileSoft), May 2021, pp. 28–39, doi:10.1109/MobileSoft52590.2021.00010.

T. Oo, H. Liu, and B. Nyirongo, “Dynamic Ranking of Refactoring Menu Items for Integrated Development Environment,” IEEE Access, vol. 6, pp. 76025–76035, 2018, doi: 10.1109/ACCESS.2018.2883769.

N. Pombo and C. Martins, “Test driven development in action: Case study of a cross-platform web application,” EUROCON 2021 - 19th IEEE Int. Conf. Smart Technol. Proc., no. July, pp. 352–356, 2021, doi: 10.1109/eurocon52738.2021.9535554.

S. Romano, F. Zampetti, M. T. Baldassarre, M. Di Penta, and G. Scanniello, “Do Static Analysis Tools Affect Software Quality when Using Test-driven Development?,” Int. Symp. Empir. Softw. Eng. Meas., pp. 80–91, 2022, doi:10.1145/3544902.3546233.

Creative Commons License

This work is licensed under a Creative Commons Attribution 4.0 International License.

Authors who publish with this journal agree to the following terms:

    1. Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution License that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
    2. Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
    3. Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).