Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Do Energy-oriented Changes Hinder Maintainability?

Luis Cruz
October 02, 2019

Do Energy-oriented Changes Hinder Maintainability?

However, improving energy efficiency is far from trivial as developers lack the knowledge and tools to aid in this activity. In this paper we study the impact of changes to improve energy efficiency on the maintainability of Android applications. Using a dataset containing 539 energy efficiency- oriented commits, we measure maintainability – as computed by the Software Improvement Group’s web-based source code analysis service Better Code Hub (BCH) – before and after energy efficiency-related code changes. Results show that in general improving energy efficiency comes with a significant decrease in maintainability. This is particularly evident in code changes to accommodate the Power Save Mode and Wakelock Addition energy patterns. In addition, we perform manual analysis to assess how real examples of energy-oriented changes affect maintainability. Our results help mobile app developers to 1) avoid common maintainability issues when improving the energy efficiency of their apps; and 2) adopt development processes to build maintainable and energy-efficient code. We also support researchers by identifying challenges in mobile app development that still need to be addressed.

Luis Cruz

October 02, 2019
Tweet

More Decks by Luis Cruz

Other Decks in Research

Transcript

  1. @luismcruz | ICSME 2019 Motivation • If users lose connectivity

    they might be unable to accomplish important tasks • Users tend to remove apps that drain the phone battery • Developers need to build energy-efficient mobile apps • Improving energy-efficiency is not trivial: requires specialised knowledge and implementing code changes !3
  2. @luismcruz | ICSME 2019 Do Energy-oriented Changes Hinder Maintainability? Maintainability

    of Energy Changes • What is the impact of making energy-oriented code changes on the maintainability of mobile apps? Maintainability Difference v E-2 v E-1 v E Energy Commit v E+1 M(v E-1 ) M(v E ) Parent Commit ∆M !4
  3. @luismcruz | ICSME 2019 Do Energy-oriented Changes Hinder Maintainability? Measuring

    Maintainability • According to ISO/IEC 25010, Maintainability is “the degree of effectiveness and efficiency with which a software product or system can be modified to improve it, correct it or adapt it to changes in environment, and in requirements” • We use the code analysis tool Better Code Hub to assess maintainability • Better Code Hub maps the ISO/IEC 25010 standard on maintainability into a set of guidelines derived from static analysis !5
  4. Do Energy-oriented Changes Hinder Maintainability? @luismcruz | ICSME 2019 Numerical

    Score of Maintainability for a Software Version Maintainability = 1 3 ✓ SLOCgreen 1 Tyellow Tyellow (SLOCyellow + SLOCorange + SLOCred)+ +SLOCgreen + SLOCyellow 1 Torange Torange (SLOCorange + SLOCred)+ +SLOCgreen + SLOCyellow + SLOCorange 1 Tred Tred SLOCred ◆ <latexit sha1_base64="dF35OmSKBlyFYJGGI8VIhR9IMU4=">AAADIXicpVJNa9RAGJ6kftT1a1uPXgYXYcvSklShXoTSXjwoVuy2hc0SJrNv0qGTmTAzUULIX+nFv+LFgyK9iX/G2ewEd1tvvjDwPO/H80zeTFJwpk0Q/PL8tVu379xdv9e7/+Dho8f9jc0TLUtFYUwll+osIRo4EzA2zHA4KxSQPOFwmlwczuunn0BpJsWxqQqY5iQTLGWUGJuKN7y9d4QJYw9JGGemwq9xlCpC67CpXzRRwrKM4+HHt+8P4zpTAKLB213H9nFcV8C5/Nw09RJ27Y6OFkwqIjLomIJZszWKot4IL2t3zI2uWjmF1qrDw/8Q77gbXjWba7ROLfir225E4a24Pwh2gjbwTRA6MEAujuL+VTSTtMxBGMqJ1pMwKMy0JsowyqHpRaWGgtALksHEQkFy0NO6/cMNfm4zM5xKZY8wuM0uT9Qk17rKE9uZE3Our9fmyX/VJqVJX01rJorSgKALo7Tk2Eg8fy54xhRQwysLCFXM3hXTc2K3ZOyj6tklhNc/+SY42d0JLf7wcrB/4Naxjp6iZ2iIQrSH9tEbdITGiHqX3lfvu/fD/+J/83/6V4tW33MzT9BK+L//AHNaABY=</latexit> <latexit sha1_base64="dF35OmSKBlyFYJGGI8VIhR9IMU4=">AAADIXicpVJNa9RAGJ6kftT1a1uPXgYXYcvSklShXoTSXjwoVuy2hc0SJrNv0qGTmTAzUULIX+nFv+LFgyK9iX/G2ewEd1tvvjDwPO/H80zeTFJwpk0Q/PL8tVu379xdv9e7/+Dho8f9jc0TLUtFYUwll+osIRo4EzA2zHA4KxSQPOFwmlwczuunn0BpJsWxqQqY5iQTLGWUGJuKN7y9d4QJYw9JGGemwq9xlCpC67CpXzRRwrKM4+HHt+8P4zpTAKLB213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woVuy2hc0SJrNv0qGTmTAzUULIX+nFv+LFgyK9iX/G2ewEd1tvvjDwPO/H80zeTFJwpk0Q/PL8tVu379xdv9e7/+Dho8f9jc0TLUtFYUwll+osIRo4EzA2zHA4KxSQPOFwmlwczuunn0BpJsWxqQqY5iQTLGWUGJuKN7y9d4QJYw9JGGemwq9xlCpC67CpXzRRwrKM4+HHt+8P4zpTAKLB213H9nFcV8C5/Nw09RJ27Y6OFkwqIjLomIJZszWKot4IL2t3zI2uWjmF1qrDw/8Q77gbXjWba7ROLfir225E4a24Pwh2gjbwTRA6MEAujuL+VTSTtMxBGMqJ1pMwKMy0JsowyqHpRaWGgtALksHEQkFy0NO6/cMNfm4zM5xKZY8wuM0uT9Qk17rKE9uZE3Our9fmyX/VJqVJX01rJorSgKALo7Tk2Eg8fy54xhRQwysLCFXM3hXTc2K3ZOyj6tklhNc/+SY42d0JLf7wcrB/4Naxjp6iZ2iIQrSH9tEbdITGiHqX3lfvu/fD/+J/83/6V4tW33MzT9BK+L//AHNaABY=</latexit> !7 Explained in the paper @luismcruz | ICSME 2019
  5. Do Energy-oriented Changes Hinder Maintainability? Better Code Hub Maintainability Combine

    datasets Energy Commits Baseline Commits Bao et al. (2015) Moura et al. (2016) Cruz et al. (2018) Cruz et al. (2019) @luismcruz | ICSME 2019 Energy Code Changes Dataset !8 Moura Bao
  6. Do Energy-oriented Changes Hinder Maintainability? Better Code Hub Maintainability Combine

    datasets Energy Commits Baseline Commits Bao et al. (2015) Moura et al. (2016) Cruz et al. (2018) Cruz et al. (2019) @luismcruz | ICSME 2019 Energy Code Changes Dataset 539 commits
 from 306 mobile apps !8 Moura Bao
  7. Do Energy-oriented Changes Hinder Maintainability? Better Code Hub Maintainability Combine

    datasets Energy Commits Baseline Commits Bao et al. (2015) Moura et al. (2016) Cruz et al. (2018) Cruz et al. (2019) @luismcruz | ICSME 2019 Energy Code Changes Dataset 539 commits
 from 306 mobile apps 539 baseline commits
 from 306 mobile apps !8 Moura Bao
  8. @luismcruz | ICSME 2019 Do Energy-oriented Changes Hinder Maintainability? Which

    energy patterns are more likely to affect maintainability? !10
  9. @luismcruz | ICSME 2019 Do Energy-oriented Changes Hinder Maintainability? Which

    energy patterns are more likely to affect maintainability? !10
  10. Do Energy-oriented Changes Hinder Maintainability? @luismcruz | ICSME 2019 Typical

    maintainability issue I https://github.com/einmalfel/PodListen/commit/2ed5a65 4 changed files with 28 additions and 0 deletions. … …
  11. Do Energy-oriented Changes Hinder Maintainability? @luismcruz | ICSME 2019 Typical

    maintainability issue II https://github.com/mozilla/MozStumbler/commit/6ea0268 5 changed files with 66 additions and 14 deletions. @luismcruz | ICSME 2019
  12. Do Energy-oriented Changes Hinder Maintainability? Conclusions • Energy-oriented commits significantly

    decrease software maintainability. • Particularly concerning Power Save Mode and Wakelock Addition patterns: maintainability decreases in 78% and 66% of the cases. • Mobile development frameworks should provide mechanisms to implement energy patterns !13 @luismcruz | ICSME 2019