On the Survival of Android Code Smells in the Wild

The success of smartphones and app stores have contributed to the explosion of the number of mobile apps proposed to end-users. In this very competitive market, developers are rushed to regularly release new versions of their apps in order to retain users. Under such pressure, app developers may be tempted to adopt bad design or implementation choices, leading to the introduction of code smells. Mobile-specific code smells represent a real concern in mobile software engineering. Many studies have proposed tools to automatically detect their presence and quantify their impact on performance. However, there remains—so far—no evidence about the lifespan of these code smells in the history of mobile apps. In this paper, we present the first large-scale empirical study that investigates the survival of Android code smells. This study covers 8 types of Android code smells, 324 Android apps, 255k commits, and the history of 180k code smell instances. Our study reports that while in terms of time Android code smells can remain in the codebase for years before being removed, it only takes 34 effective commits to remove 75% of them. Also, Android code smells disappear faster in bigger projects with higher releasing trends. Finally, we observed that code smells that are detected and prioritised by linters tend to disappear before other code smells.

[1]  Romain Rouvoy,et al.  On Adopting Linters to Deal with Performance Concerns in Android Apps , 2018, 2018 33rd IEEE/ACM International Conference on Automated Software Engineering (ASE).

[2]  Ahmed E. Hassan,et al.  Replicating and Re-Evaluating the Theory of Relative Defect-Proneness , 2015, IEEE Transactions on Software Engineering.

[3]  Gabriele Bavota,et al.  When and Why Your Code Starts to Smell Bad (and Whether the Smells Go Away) , 2015, IEEE Transactions on Software Engineering.

[4]  C. Matuchansky,et al.  Lifelines , 2016, The Lancet.

[5]  O. Aalen A linear regression model for the analysis of life times. , 1989, Statistics in medicine.

[6]  D.,et al.  Regression Models and Life-Tables , 2022 .

[7]  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).

[8]  Uwe Aßmann,et al.  On the reuse and recommendation of model refactoring specifications , 2012, Software & Systems Modeling.

[9]  Christian Bird,et al.  What developers want and need from program analysis: An empirical study , 2016, 2016 31st IEEE/ACM International Conference on Automated Software Engineering (ASE).

[10]  Geoffrey Hecht Détection et analyse de l'impact des défauts de code dans les applications mobiles. (Detection and analysis of impact of code smells in mobile applications) , 2016 .

[11]  Romain Rouvoy,et al.  An Empirical Study of the Performance Impacts of Android Code Smells , 2016, 2016 IEEE/ACM International Conference on Mobile Software Engineering and Systems (MOBILESoft).

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

[13]  Eduardo Figueiredo,et al.  Understanding the longevity of code smells: preliminary results of an explanatory survey , 2011, WRT '11.

[14]  Jared Smith,et al.  A Dataset of Open-Source Android Applications , 2015, 2015 IEEE/ACM 12th Working Conference on Mining Software Repositories.

[15]  Rupert G. Miller,et al.  Survival Analysis , 2022, The SAGE Encyclopedia of Research Design.

[16]  Andrea De Lucia,et al.  On the impact of code smells on the energy consumption of mobile applications , 2019, Inf. Softw. Technol..

[17]  D G Altman,et al.  Survival probabilities (the Kaplan-Meier method) , 1998, BMJ.

[18]  Renaud Pawlak Spoon: Compile-time Annotation Processing for Middleware , 2006, IEEE Distributed Systems Online.

[19]  Yann-Gaël Guéhéneuc,et al.  DECOR: A Method for the Specification and Detection of Code and Design Smells , 2010, IEEE Transactions on Software Engineering.

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

[21]  Foutse Khomh,et al.  EARMO: An Energy-Aware Refactoring Approach for Mobile Apps , 2018, IEEE Transactions on Software Engineering.

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

[23]  Robert W. Bowdidge,et al.  Why don't software developers use static analysis tools to find bugs? , 2013, 2013 35th International Conference on Software Engineering (ICSE).

[24]  Miryung Kim,et al.  Program element matching for multi-version program analyses , 2006, MSR '06.

[25]  Iftekhar Ahmed,et al.  Understanding Code Smells in Android Applications , 2016, 2016 IEEE/ACM International Conference on Mobile Software Engineering and Systems (MOBILESoft).

[26]  Andrea De Lucia,et al.  Lightweight detection of Android-specific code smells: The aDoctor project , 2017, 2017 IEEE 24th International Conference on Software Analysis, Evolution and Reengineering (SANER).

[27]  D. Harrington A class of rank test procedures for censored survival data , 1982 .

[28]  Romain Rouvoy,et al.  Investigating the energy impact of Android smells , 2017, 2017 IEEE 24th International Conference on Software Analysis, Evolution and Reengineering (SANER).

[29]  Ahmed E. Hassan,et al.  Fresh apps: an empirical study of frequently-updated mobile apps in the Google play store , 2015, Empirical Software Engineering.

[30]  Ciera Jaspan,et al.  Tricorder: Building a Program Analysis Ecosystem , 2015, 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering.

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

[32]  Foutse Khomh,et al.  An Exploratory Study of the Impact of Code Smells on Software Change-proneness , 2009, 2009 16th Working Conference on Reverse Engineering.

[33]  Miryung Kim,et al.  An empirical study of code clone genealogies , 2005, ESEC/FSE-13.

[34]  Marouane Kessentini,et al.  Detecting Android Smells Using Multi-Objective Genetic Programming , 2017, 2017 IEEE/ACM 4th International Conference on Mobile Software Engineering and Systems (MOBILESoft).

[35]  Andy Zaidman,et al.  Evaluating the Lifespan of Code Smells using Software Repository Mining , 2012, 2012 16th European Conference on Software Maintenance and Reengineering.

[36]  M. Pagano,et al.  Survival analysis. , 1996, Nutrition.

[37]  Andy Zaidman,et al.  Analyzing the State of Static Analysis: A Large-Scale Evaluation in Open Source Software , 2016, 2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER).

[38]  Katrina D. Maxwell,et al.  Applied Statistics for Software Managers , 2002 .

[39]  Fabio Palomba,et al.  A Graph-Based Dataset of Commit History of Real-World Android apps , 2018, 2018 IEEE/ACM 15th International Conference on Mining Software Repositories (MSR).

[40]  Romain Rouvoy,et al.  Code Smells in iOS Apps: How Do They Compare to Android? , 2017, 2017 IEEE/ACM 4th International Conference on Mobile Software Engineering and Systems (MOBILESoft).

[41]  Yu Lin,et al.  Refactorings for Android Asynchronous Programming , 2015, 2015 30th IEEE/ACM International Conference on Automated Software Engineering (ASE).