Evaluating the Impact of Code Smell Refactoring on the Energy Consumption of Android Applications

Energy consumption of mobile apps is receiving a lot of attention from researchers. Recent studies indicate that energy consumption of mobile devices could be lowered by improving the quality of mobile apps. Frequent refactoring is one way of achieving this goal. We explore the performance and energy impact of several common code refactorings in Android apps. Experimental results indicate that some code smell refactorings positively impact the energy consumption of Android apps. Refactoring of the code smells 'Duplicated code' and 'Type checking' reduce energy consumption by up to 10.8%. Significant reduction in energy consumption, however, does not seem to be directly related to the increase or decrease of execution time. In addition, the energy impact over permutations of code smell refactorings in the selected Android apps was small. When analyzing the order in which refactorings were made across code smell types, it turned out that some permutations resulted in a reduction and some in an increase of energy consumption for the analyzed apps.

[1]  Steve Counsell,et al.  Code smells as system-level indicators of maintainability: An empirical study , 2013, J. Syst. Softw..

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

[3]  Daniela Cruzes,et al.  The evolution and impact of code smells: A case study of two open source systems , 2009, 2009 3rd International Symposium on Empirical Software Engineering and Measurement.

[4]  Andrea De Lucia,et al.  PETrA: A Software-Based Tool for Estimating the Energy Profile of Android Applications , 2017, 2017 IEEE/ACM 39th International Conference on Software Engineering Companion (ICSE-C).

[5]  Luca Ardito,et al.  Definition, implementation and validation of energy code smells: an exploratory study on an embedded system , 2013 .

[6]  Lori L. Pollock,et al.  How do code refactorings affect energy usage? , 2014, ESEM '14.

[7]  Alexander Chatzigeorgiou,et al.  Ten years of JDeodorant: Lessons learned from the hunt for smells , 2018, 2018 IEEE 25th International Conference on Software Analysis, Evolution and Reengineering (SANER).

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

[9]  Francesca Arcelli Fontana,et al.  On experimenting refactoring tools to remove code smells , 2015, XP Workshops.

[10]  Alejandro Zunino,et al.  Using bad smell-driven code refactorings in mobile applications to reduce battery usage , 2015 .

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

[12]  Giuseppe Procaccianti,et al.  Empirical Evaluation of the Energy Impact of Refactoring Code Smells , 2018, ICT4S.

[13]  Andreas Winter,et al.  Saving Energy on Mobile Devices by Refactoring , 2014, EnviroInfo.

[14]  Alexander Chatzigeorgiou,et al.  JDeodorant: Identification and Removal of Type-Checking Bad Smells , 2008, 2008 12th European Conference on Software Maintenance and Reengineering.

[15]  Fernando Kamei,et al.  What programmers say about refactoring tools?: an empirical investigation of stack overflow , 2013, WRT '13.

[16]  Eduardo Figueiredo,et al.  On the evaluation of code smells and detection tools , 2017, Journal of Software Engineering Research and Development.

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

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

[19]  Jose Pereira dos Reis,et al.  Code Smells Incidence: Does It Depend on the Application Domain? , 2016, 2016 10th International Conference on the Quality of Information and Communications Technology (QUATIC).

[20]  Mario Piattini,et al.  Analyzing the Harmful Effect of God Class Refactoring on Power Consumption , 2014, IEEE Software.

[21]  Aiko Fallas Yamashita,et al.  Do developers care about code smells? An exploratory survey , 2013, 2013 20th Working Conference on Reverse Engineering (WCRE).

[22]  Tomi Lämsä,et al.  Comparison of GUI testing tools for Android applications , 2017 .

[23]  Tom Mens,et al.  A survey of software refactoring , 2004, IEEE Transactions on Software Engineering.

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

[25]  L. Tippett Statistical Tables: For Biological, Agricultural and Medical Research , 1954 .

[26]  R. A. Fisher,et al.  Statistical Tables for Biological, Agricultural and Medical Research , 1956 .