An Empirical Study on the Impact of Refactoring on Quality Metrics in Android Applications

Mobile applications must continuously evolve, sometimes under such time pressure that poor design or implementation choices are made, which inevitably result in structural software quality problems. Refactoring is the widely-accepted approach to ameliorating such quality problems. While the impact of refactoring on software quality has been widely studied in object-oriented software, its impact is still unclear in the context of mobile apps. This paper reports on the first empirical study that aims to address this gap. We conduct a large empirical study that analyses the evolution history of 300 open-source Android apps exhibiting a total of 42,181 refactoring operations. We analyze the impact of these refactoring operations on 10 common quality metrics using a causal inference method based on the Difference-in-Differences (DiD) model. Our results indicate that when refactoring affects the metrics it generally improves them. In many cases refactoring has no significant impact on the metrics, whereas one metric (LCOM) deteriorates overall as a result of refactoring. These findings provide practical insights into the current practice of refactoring in the context of Android app development.

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

[3]  Mark Harman,et al.  Experimental assessment of software metrics using automated refactoring , 2012, Proceedings of the 2012 ACM-IEEE International Symposium on Empirical Software Engineering and Measurement.

[4]  Eleni Stroulia,et al.  UMLDiff: an algorithm for object-oriented design differencing , 2005, ASE.

[5]  Chris F. Kemerer,et al.  A Metrics Suite for Object Oriented Design , 2015, IEEE Trans. Software Eng..

[6]  Witold Pedrycz,et al.  A Case Study on the Impact of Refactoring on Quality and Productivity in an Agile Team , 2008, CEE-SET.

[7]  Audris Mockus,et al.  Refactoring for changeability: a way to go? , 2005, 11th IEEE International Software Metrics Symposium (METRICS'05).

[8]  Victor R. Basili,et al.  A Validation of Object-Oriented Design Metrics as Quality Indicators , 1996, IEEE Trans. Software Eng..

[9]  Marco Tulio Valente,et al.  Why we refactor? confessions of GitHub contributors , 2016, SIGSOFT FSE.

[10]  Takeo Imai,et al.  A quantitative evaluation of maintainability enhancement by refactoring , 2002, International Conference on Software Maintenance, 2002. Proceedings..

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

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

[13]  Ladan Tahvildari,et al.  A metric-based approach to enhance design quality through meta-pattern transformations , 2003, Seventh European Conference onSoftware Maintenance and Reengineering, 2003. Proceedings..

[14]  Anas N. Al-Rabadi,et al.  A comparison of modified reconstructability analysis and Ashenhurst‐Curtis decomposition of Boolean functions , 2004 .

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

[16]  Gabriele Bavota,et al.  An experimental investigation on the innate relationship between quality and refactoring , 2015, J. Syst. Softw..

[17]  Bipin Joshi,et al.  Beginning SOLID Principles and Design Patterns for ASP.NET Developers , 2016, Apress.

[18]  Joshua D. Angrist,et al.  Mostly Harmless Econometrics: An Empiricist's Companion , 2008 .

[19]  Meir M. Lehman,et al.  Laws of Software Evolution Revisited , 1996, EWSPT.

[20]  Tibor Gyimóthy,et al.  Bulk Fixing Coding Issues and Its Effects on Software Quality: Is It Worth Refactoring? , 2014, 2014 IEEE 14th International Working Conference on Source Code Analysis and Manipulation.

[21]  Mark Harman,et al.  An Empirical Study of Cohesion and Coupling: Balancing Optimization and Disruption , 2018, IEEE Transactions on Evolutionary Computation.

[22]  Mohamed Wiem Mkaouer,et al.  On the Impact of Refactoring on the Relationship between Quality Attributes and Design Metrics , 2019, 2019 ACM/IEEE International Symposium on Empirical Software Engineering and Measurement (ESEM).

[23]  Mohammad Alshayeb,et al.  Automatic software refactoring: a systematic literature review , 2019, Software Quality Journal.

[24]  Magnus C. Ohlsson,et al.  Experimentation in Software Engineering , 2000, The Kluwer International Series in Software Engineering.

[25]  Claus Lewerentz,et al.  Metrics Based Refactoring , 2001, CSMR.

[26]  Mohamed Wiem Mkaouer,et al.  How Do Developers Refactor Code to Improve Code Reusability? , 2020, ICSR.

[27]  Alessandro F. Garcia,et al.  How Does Modern Code Review Impact Software Design Degradation? An In-depth Empirical Study , 2020, 2020 IEEE International Conference on Software Maintenance and Evolution (ICSME).

[28]  Gabriele Bavota,et al.  Improving Code: The (Mis) Perception of Quality Metrics , 2018, 2018 IEEE International Conference on Software Maintenance and Evolution (ICSME).

[29]  Massimiliano Di Penta,et al.  A Quantitative and Qualitative Investigation of Performance-Related Commits in Android Apps , 2016, 2016 IEEE International Conference on Software Maintenance and Evolution (ICSME).

[30]  Alessandro F. Garcia,et al.  How does refactoring affect internal quality attributes?: A multi-project study , 2017, SBES'17.

[31]  Mohammad Alshayeb,et al.  Empirical investigation of refactoring effect on software quality , 2009, Inf. Softw. Technol..

[32]  Adnan Shaout,et al.  Many-Objective Software Remodularization Using NSGA-III , 2015, TSEM.

[33]  Baldoino Fonseca dos Santos Neto,et al.  Understanding the impact of refactoring on smells: a longitudinal study of 23 software projects , 2017, ESEC/SIGSOFT FSE.

[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]  Tibor Gyimóthy,et al.  Modeling class cohesion as mixtures of latent topics , 2009, 2009 IEEE International Conference on Software Maintenance.

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

[37]  Danny Dig,et al.  Accurate and Efficient Refactoring Detection in Commit History , 2018, 2018 IEEE/ACM 40th International Conference on Software Engineering (ICSE).

[38]  Patricia Lago,et al.  How Maintainability Issues of Android Apps Evolve , 2018, 2018 IEEE International Conference on Software Maintenance and Evolution (ICSME).

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

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

[41]  Alessandro F. Garcia,et al.  Does refactoring improve software structural quality? A longitudinal study of 25 projects , 2016, SBES.

[42]  Alessandro F. Garcia,et al.  Refactoring effect on internal quality attributes: What haven't they told you yet? , 2020, Inf. Softw. Technol..

[43]  Andrew P. Black,et al.  How we refactor, and how we know it , 2009, 2009 IEEE 31st International Conference on Software Engineering.

[44]  Diomidis Spinellis,et al.  Refactoring--Does It Improve Software Quality? , 2007, Fifth International Workshop on Software Quality (WoSQ'07: ICSE Workshops 2007).