An Automated Performance Enhancement Approach for Mobile Applications
DOI:
https://doi.org/10.61506/01.00211Keywords:
mobile applications, code smells, performance optimization, Android Studio plugin, static code analysis, refactoring, application performance, memory consumption, software engineeringAbstract
In the rapidly evolving landscape of mobile applications, the demand for high-quality, performance-driven software is paramount. However, the swift pace of development often leads to the introduction of code smells—bad programming practices that compromise both code quality and application performance. These code smells, if left unaddressed, can result in increased memory consumption, energy consumption, and CPU utilization, ultimately leading to a suboptimal user experience. This paper presents an automated approach for the detection and refactoring of code smells in Android applications, with a focus on improving performance. The proposed approach involves the development of a plugin integrated with Android Studio, which employs static code analysis to identify code smells. The plugin encompasses a customizable rule-based framework that allows for the detection of various code smells unique to Android development. To validate the approach, a comprehensive experiment is conducted. The experiment assesses the effectiveness of the proposed method in detecting code smells and explores the impact of refactoring on application performance. The results showcase that the proposed plugin successfully detects code smells in various open-source Android applications. Moreover, the integration of refactoring recommendations significantly improves the performance of the applications, as demonstrated through memory, energy, and CPU consumption metrics. Comparison with existing tools reveals that the proposed approach offers superior performance in terms of both code smell detection and refactoring. Additionally, the approach bridges the gap left by some existing tools by identifying previously undetected code smells, such as "string concatenation." The presented method not only enhances code quality but also contributes to the overall performance optimization of Android applications. As mobile applications continue to play an increasingly central role in modern life, the importance of maintaining high-quality code that performs optimally cannot be understated. This work provides a valuable contribution towards achieving these goals, offering developers a powerful tool for ensuring that their applications not only meet but exceed user expectations in terms of quality and performance.
References
Alkandari, M. A., Kelkawi, A., & Elish, M. O. (2021). An Empirical Investigation on the Effect of Code Smells on Resource Usage of Android Mobile Applications. IEEE Access, 9,61853-61863. DOI: https://doi.org/10.1109/ACCESS.2021.3075040
Amalfitano, D., Riccio, V., Tramontana, P., & Fasolino, A. R. (2020). Do Memories Haunt You? An Automated Black Box Testing Approach for Detecting Memory Leaks in Android Apps. IEEE Access, 8, 12217-12231. DOI: https://doi.org/10.1109/ACCESS.2020.2966522
Bhatt, B. N., & Furia, C. A. (2020). Automated Repair of Resource Leaks in Android Applications.
Boutaib, S., Bechikh, S., Palomba, F., Elarbi, M., Makhlouf, M., & ben Said, L. (2021). Code smell detection and identification in imbalanced environments. Expert Systems with Applications, 166.
Boutaib, S., Bechikh, S., Palomba, F., Elarbi, M., Makhlouf, M., & ben Said, L. (2021). Code smell detection and identification in imbalanced environments. Expert Systems with Applications, 166.
Boutaib, S., Bechikh, S., Palomba, F., Elarbi, M., Makhlouf, M., & ben Said, L. (2021). Code smell detection and identification in imbalanced environments. Expert Systems with Applications, 166. DOI: https://doi.org/10.1016/j.eswa.2020.114076
Carette, A., Ait Younes, M. A., Hecht, G., Moha, N., & Rouvoy, R. (2017). Investigating the Energy Impact of Android Smells. DOI: https://doi.org/10.1109/SANER.2017.7884614
Chouchane, M., Soui, M., & Ghedira, K. (2021). The impact of the code smells of the presentation layer on the diffuseness of aesthetic defects of Android apps. Automated Software Engineering, 28(2).
Chouchane, M., Soui, M., & Ghedira, K. (2021). The impact of the code smells of the presentation layer on the diffuseness of aesthetic defects of Android apps. Automated Software Engineering, 28(2). DOI: https://doi.org/10.1007/s10515-021-00297-8
Couto, M., Saraiva, J., & Fernandes, J. P. (n.d.). Energy Refactorings for Android in the Large and in the Wild.
Das, T., di Penta, M., & Malavolta, I. (2020). Characterizing the evolution of statically-detectable performance issues of Android apps. Empirical Software Engineering, 25(4), 2748-2808.
Das, T., di Penta, M., & Malavolta, I. (2020). Characterizing the evolution of statically-detectable performance issues of Android apps. Empirical Software Engineering, 25(4), 2748-2808. DOI: https://doi.org/10.1007/s10664-019-09798-3
Degu, A. (n.d.). Android Application Memory and Energy Performance: Systematic Literature Review, 21(3), 20-32.
Falessi, D., & Kazman, R. (2021). Worst smells and their worst reasons. In 2021 IEEE/ACM International Conference on Technical Debt (TechDebt), (pp. 45-54). IEEE. DOI: https://doi.org/10.1109/TechDebt52882.2021.00014
Fatima, I., Anwar, H., Pfahl, D., & Qamar, U. (2020). Detection and Correction of Android-specific Code Smells and Energy Bugs: An Android Lint Extension.
Fatima, I., Anwar, H., Pfahl, D., & Qamar, U. (2020). Tool support for green android development: A systematic mapping study. In ICSOFT 2020 - Proceedings of the 15th International Conference on Software Technologies, (pp. 409-417). DOI: https://doi.org/10.5220/0009770304090417
Gattal, A., Hammache, A., Bousbia, N., & Henniche, A. N. (2021). Exploiting the progress of OO refactoring tools with Android code smells: RAndroid, a plugin for Android studio. In Proceedings of the ACM Symposium on Applied Computing, (pp. 1580-1583). DOI: https://doi.org/10.1145/3412841.3442129
Habchi, S., Moha, N., & Rouvoy, R. (2020). Android Code Smells: From Introduction to Refactoring.
Habchi, S., Moha, N., & Rouvoy, R. (2020). Android Code Smells: From Introduction to Refactoring.
Habchi, S., Moha, N., & Rouvoy, R. (2020). Android Code Smells: From Introduction to Refactoring. DOI: https://doi.org/10.1016/j.jss.2021.110964
Hamdi, O., Ouni, A., Cinnéide, M. O., & Mkaouer, M. W. (2021). A longitudinal study of the impact of refactoring in android applications. Information and Software Technology, 140. DOI: https://doi.org/10.1016/j.infsof.2021.106699
Hecht, G., Benomar, O., Rouvoy, R., Moha, N., & Duchien, L. (2016). Tracking the software quality of android applications along their evolution. In Proceedings - 2015 30th IEEE/ACM International Conference on Automated Software Engineering, ASE 2015, (pp. 236-247).
Hecht, G., Benomar, O., Rouvoy, R., Moha, N., & Duchien, L. (2016). Tracking the software quality of android applications along their evolution. In Proceedings - 2015 30th IEEE/ACM International Conference on Automated Software Engineering, ASE 2015, (pp. 236-247). DOI: https://doi.org/10.1109/ASE.2015.46
Hort, M., Kechagia, M., Sarro, F., & Harman, M. (2021). A Survey of Performance Optimization for Mobile Applications. IEEE Transactions on Software Engineering.
Hort, M., Kechagia, M., Sarro, F., & Harman, M. (2021). A Survey of Performance Optimization for Mobile Applications. IEEE Transactions on Software Engineering. DOI: https://doi.org/10.1109/TSE.2021.3071193
Iannone, E., Pecorelli, F., di Nucci, D., Palomba, F., & de Lucia, A. (2020). Refactoring android-specific energy smells: A plugin for android studio. In IEEE International Conference on Program Comprehension, (pp. 451-455). DOI: https://doi.org/10.1145/3387904.3389298
Institute of Electrical and Electronics Engineers, & International Conference on Software Engineering (35th : 2013 : San Kim, D. K. (2017). Towards Performance-Enhancing Programming for Android Application Development. International Journal of Contents, 13(4).
Khan, M. N. (2016). Institutional Governance, Population Dynamics, and Economic Growth: Insights from a Global Panel. Journal of Business and Economic Options, 3(2), 33-45.
Khan, M. U., Lee, S. U. J., Abbas, S., Abbas, A., & Bashir, A. K. (2021). Detecting Wake Lock Leaks in Android Apps Using Machine Learning. IEEE Access, 9, 125753-125767. DOI: https://doi.org/10.1109/ACCESS.2021.3110244
Kim, D. K. (2017). Towards Performance-Enhancing Programming for Android Application Development. International Journal of Contents, 13(4).
Kim, W., ACM Digital Library, & Association for Computing Machinery Special Interest Group on Knowledge Discovery & Data Mining. (2009). Proceedings of the 3rd International Conference on Ubiquitous Information Management and Communication. ACM.
Kong, P., Li, L., Gao, J., Liu, K., Bissyandé, T. F., & Klein, J. (2019). Automated testing of Android apps: A systematic literature review. IEEE Transactions on Reliability, 68(1),45-66.
Kong, P., Li, L., Gao, J., Liu, K., Bissyandé, T. F., & Klein, J. (2019). Automated testing of Android apps: A systematic literature review. IEEE Transactions on Reliability, 68(1),45-66.
Kong, P., Li, L., Gao, J., Liu, K., Bissyandé, T. F., & Klein, J. (2019). Automated testing of Android apps: A systematic literature review. IEEE Transactions on Reliability, 68(1), 45-66. DOI: https://doi.org/10.1109/TR.2018.2865733
le Goaer, O. (2020). Enforcing Green Code with Android Lint. In Proceedings - 2020 35th IEEE/ACM International Conference on Automated Software Engineering Workshops, ASEW 2020, (pp. 85-90). DOI: https://doi.org/10.1145/3417113.3422188
Mao, C., Wang, H., Han, G., & Zhang, X. (2020). Droidlens: Robust and Fine-Grained Detection for Android Code Smells. In Proceedings - 2020 International Symposium on Theoretical Aspects of Software Engineering, TASE 2020, (pp. 161-168). DOI: https://doi.org/10.1109/TASE49443.2020.00030
Mõškovski, S. (n.d.). Building a tool for detecting code smells in Android application code.
Nguyen, M. D., Huynh, T. Q., & Nguyen, T. H. (2016). Improve the performance of mobile applications based on code optimization techniques using PMD and android lint. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), 9978 LNAI, (pp. 343-356).
Nguyen, M. D., Huynh, T. Q., & Nguyen, T. H. (2016). Improve the performance of mobile applications based on code optimization techniques using PMD and android lint. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), 9978 LNAI, (pp. 343-356).
Nguyen, M. D., Huynh, T. Q., & Nguyen, T. H. (2016). Improve the performance of mobile applications based on code optimization techniques using PMD and android lint. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), 9978 LNAI, (pp. 343-356). DOI: https://doi.org/10.1007/978-3-319-49046-5_29
Ogenrwot, D., Nakatumba-Nabende, J., & van Chaudron, M. R. (2020). Comparison of Occurrence of Design Smells in Desktop and Mobile Applications. Retrieved from http://web.engr.oregonstate.edu/Francisco, Calif.). (2013). 1st International Workshop on the Engineering of Mobile-Enabled Systems (MOBS) : Proceedings : May 25, 2013, San Francisco, CA, USA. IEEE.
Ogenrwot, D., Nakatumba-Nabende, J., & van Chaudron, M. R. (2020). Comparison of Occurrence of Design Smells in Desktop and Mobile Applications.
Ournani, Z., Rouvoy, R., Rust, P., & Penhoat, J. (2021). Tales from the Code #1: The Effective Impact of Code Refactorings on Software Energy Consumption.
Ournani, Z., Rouvoy, R., Rust, P., & Penhoat, J. (2021). Tales from the Code #1: The Effective Impact of Code Refactorings on Software Energy Consumption. DOI: https://doi.org/10.5220/0010517900340046
Palomba, F., di Nucci, D., Panichella, A., Zaidman, A., & de Lucia, A. (2017). Lightweight detection of Android-specific code smells: The aDoctor project. In SANER 2017 - 24th IEEE International Conference on Software Analysis, Evolution, and Reengineering, (pp. 487-491). DOI: https://doi.org/10.1109/SANER.2017.7884659
Palomba, F., di Nucci, D., Panichella, A., Zaidman, A., & de Lucia, A. (2019). On the impact of code smells on the energy consumption of mobile applications. Information and Software Technology, 105, 43-55.
Palomba, F., di Nucci, D., Panichella, A., Zaidman, A., & de Lucia, A. (2019). On the impact of code smells on the energy consumption of mobile applications. Information and Software Technology, 105, 43-55. DOI: https://doi.org/10.1016/j.infsof.2018.08.004
Pldi 12 Proceedings Committee. (2013). PLDI 12 Proceedings of the 2012 ACM SIGPLAN Conference on Programming Language Design and Implementation. Association for Computing Machinery.
Rahkema, K., & Pfahl, D. (2020). Comparison of Code Smells in iOS and Android Applications.
Rasool, G., & Ali, A. (2020). Recovering Android Bad Smells from Android Applications. Arabian Journal for Science and Engineering, 45(4), 3289-3315. DOI: https://doi.org/10.1007/s13369-020-04365-1
Rodriguez, A., Mateos, C., & Zunino, A. (2017). Improving scientific application execution on android mobile devices via code refactorings. Software - Practice and Experience, 47(5), 763-796. DOI: https://doi.org/10.1002/spe.2419
Skretting, A., & Gronli, T. M. (2020). Baseline for Performance Prediction of Android Applications. In Proceedings - 2020 IEEE International Conference on Big Data, Big Data 2020, (pp. 3304-3310).
Skretting, A., & Gronli, T. M. (2020). Baseline for Performance Prediction of Android Applications. In Proceedings - 2020 IEEE International Conference on Big Data, Big Data 2020, (pp. 3304-3310). DOI: https://doi.org/10.1109/BigData50022.2020.9377882
Usman, M., Iqbal, M. Z., & Khan, M. U. (2020). An automated model-based approach for unit-level performance test generation of mobile applications. Journal of Software: Evolution and Process, 32(1). DOI: https://doi.org/10.1002/smr.2215
Zhang, P., & Elbaum, S. (2012). Amplifying tests to validate exception handling code. In Proceedings - International Conference on Software Engineering, (pp. 595–605). DOI: https://doi.org/10.1109/ICSE.2012.6227157