An Empirical Study of the Performance Impacts of Android Code Smells

Android code smells are bad implementation practices within Android applications (or apps) that may lead to poor software quality, in particular in terms of performance. Yet, performance is a main software quality concern in the development of mobile apps. Correcting Android code smells is thus an important activity to increase the performance of mobile apps and to provide the best experience to mobile end-users while considering the limited constraints of mobile devices (e.g., CPU, memory, battery). However, no empirical study has assessed the positive performance impacts of correcting mobile code smells. In this paper, we therefore conduct an empirical study focusing on the individual and combined performance impacts of three Android performance code smells (namely, Internal Getter/Setter, Member Ignoring Method, and HashMap Usage) on two open source Android apps. To perform this study, we use the Paprika toolkit to detect these three code smells in the analyzed apps, and we derive four versions of the apps by correcting each detected smell independently, and all of them. Then, we evaluate the performance of each version on a common user scenario test. In particular, we evaluate the UI and memory performance using the following metrics: frame time, number of delayed frames, memory usage, and number of garbage collection calls. Our results show that correcting these Android code smells effectively improve the UI and memory performance. In particular, we observe an improvement up to 12.4% on UI metrics when correcting Member Ignoring Method and up to 3.6% on memory-related metrics when correcting the three Android code smells. We believe that developers can benefit from these results to guide their refactoring, and thus improve the quality of their mobile apps.

[1]  Claes Wohlin,et al.  Experimentation in Software Engineering , 2000, The Kluwer International Series in Software Engineering.

[2]  Girish Suryanarayana,et al.  Chapter 1 – Technical Debt , 2015 .

[3]  Mauricio A. Saca Refactoring improving the design of existing code , 2017, 2017 IEEE 37th Central America and Panama Convention (CONCAPAN XXXVII).

[4]  Yepang Liu,et al.  Characterizing and detecting performance bugs for smartphone applications , 2014, ICSE.

[5]  Ahmed E. Hassan,et al.  Understanding reuse in the Android Market , 2012, 2012 20th IEEE International Conference on Program Comprehension (ICPC).

[6]  N. Cliff Dominance statistics: Ordinal analyses to answer ordinal questions. , 1993 .

[7]  Liang Xu Techniques and Tools for Analyzing and Understanding Android Applications , 2013 .

[8]  Romain Rouvoy,et al.  Detecting Antipatterns in Android Apps , 2015, 2015 2nd ACM International Conference on Mobile Software Engineering and Systems.

[9]  Michele Lanza,et al.  Software Analytics for Mobile Applications--Insights & Lessons Learned , 2013, 2013 17th European Conference on Software Maintenance and Reengineering.

[10]  Jacob Cohen,et al.  A power primer. , 1992, Psychological bulletin.

[11]  M. Fowler Improving the Design of Existing Code , 2000 .

[12]  Girish Suryanarayana,et al.  Refactoring for Software Design Smells: Managing Technical Debt , 2014 .

[13]  Ding Li,et al.  An investigation into energy-saving programming practices for Android smartphone app development , 2014, GREENS 2014.

[14]  Uwe Aßmann,et al.  A Tool-Supported Quality Smell Catalogue For Android Developers , 2014, Softwaretechnik-Trends.

[15]  Romain Rouvoy,et al.  Tracking the Software Quality of Android Applications Along Their Evolution (T) , 2015, 2015 30th IEEE/ACM International Conference on Automated Software Engineering (ASE).

[16]  Student,et al.  THE PROBABLE ERROR OF A MEAN , 1908 .

[17]  D. Verloop,et al.  Code Smells in the Mobile Applications Domain , 2013 .

[18]  Yann-Gaël Guéhéneuc,et al.  Domain matters: bringing further evidence of the relationships among anti-patterns, application domains, and quality-related metrics in Java mobile apps , 2014, ICPC 2014.

[19]  Maliha S. Nash,et al.  Handbook of Parametric and Nonparametric Statistical Procedures , 2001, Technometrics.

[20]  Lisane B. de Brisolara,et al.  Analysis and Evaluation of the Android Best Practices Impact on the Efficiency of Mobile Applications , 2013, 2013 III Brazilian Symposium on Computing Systems Engineering.

[21]  Sona Mundody,et al.  Evaluating the Impact of Android Best Practices on Energy Consumption , 2014 .

[22]  A. Sockloff,et al.  Statistical power analysis for the behavioral sciences: (revised edition), by Jacob Cohen. New York: Academic Press, 1977, xv + 474 pp., $24.50. , 1978 .