Skip to main content

2017 | OriginalPaper | Buchkapitel

Detecting Energy Bugs in Android Apps Using Static Analysis

verfasst von : Hao Jiang, Hongli Yang, Shengchao Qin, Zhendong Su, Jian Zhang, Jun Yan

Erschienen in: Formal Methods and Software Engineering

Verlag: Springer International Publishing

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

search-config
loading …

Abstract

Energy bugs in Android apps are defects that can make Android systems waste much energy as a whole. Energy bugs detection in Android apps has become an important issue since smartphones usually operate on a limited amount of battery capacity and the existence of energy bugs may lead to serious drain in the battery power. This paper focuses on detecting two types of energy bugs, namely resource leak and layout defect, in Android apps. A resource leak is a particular type of energy wasting phenomena where an app does not release its acquired resources such as a sensor and GPS. A layout defect refers to a poor layout structure causing more energy consumption for measuring and drawing the layout. In this paper, we present a static analysis technique called SAAD, that can automatically detect energy bugs in a context-sensitive way. SAAD detects the energy bugs by taking an inter-procedural anaysis of an app. For resource leak analysis, SAAD decompiles APK file into Dalvik bytecodes files and then performs resource leak analysis by taking components call relationship analysis, inter-procedure and intra-procedure analysis. For detecting layout defect, SAAD firstly employs Lint to perform some traditional app analysis, then filters energy defects from reported issues. Our experimental result on 64 publicly-available Android apps shows that SAAD can detect energy bugs effectively. The accuracies of detecting resource leak and layout energy defect are \(87.5\%\) and \(78.1\%\) respectively.

Sie haben noch keine Lizenz? Dann Informieren Sie sich jetzt über unsere Produkte:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Literatur
1.
Zurück zum Zitat Pathak, A., Hu, Y.C., Zhang, M.: Bootstrapping energy debugging on smartphones: a first look at energy bugs in mobile devices. In: Proceeding of The 10th ACM Workshop on Hot Topics in Networks, HotNets-X (2011) Pathak, A., Hu, Y.C., Zhang, M.: Bootstrapping energy debugging on smartphones: a first look at energy bugs in mobile devices. In: Proceeding of The 10th ACM Workshop on Hot Topics in Networks, HotNets-X (2011)
2.
Zurück zum Zitat Banerjee, A., Chong, L.K., Chattopadhyay, S., et al.: Detecting energy bugs and hotspots in mobile apps. In: Proceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering, pp. 588–598. ACM (2014) Banerjee, A., Chong, L.K., Chattopadhyay, S., et al.: Detecting energy bugs and hotspots in mobile apps. In: Proceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering, pp. 588–598. ACM (2014)
3.
Zurück zum Zitat Zhang, J., Musa, A., Le, W.: A comparison of energy bugs for smartphone platforms. In: Engineering of Mobile-Enabled Systems (MOBS), pp. 25–30. IEEE (2013) Zhang, J., Musa, A., Le, W.: A comparison of energy bugs for smartphone platforms. In: Engineering of Mobile-Enabled Systems (MOBS), pp. 25–30. IEEE (2013)
6.
Zurück zum Zitat Hoffmann, J., Ussath, M., Holz, T., et al.: Slicing droids: program slicing for smali code. Automated Software Engineering (ASE), Coimbra, Portugal, 18–22 March 2013, pp. 1844–1851. IEEE (2013) Hoffmann, J., Ussath, M., Holz, T., et al.: Slicing droids: program slicing for smali code. Automated Software Engineering (ASE), Coimbra, Portugal, 18–22 March 2013, pp. 1844–1851. IEEE (2013)
9.
Zurück zum Zitat Ferrari, A., Gallucci, D., Puccinelli, D., et al.: Detecting energy leaks in Android app with POEM. In: Pervasive Computing and Communication Workshops (PerCom Workshops). IEEE (2015) Ferrari, A., Gallucci, D., Puccinelli, D., et al.: Detecting energy leaks in Android app with POEM. In: Pervasive Computing and Communication Workshops (PerCom Workshops). IEEE (2015)
10.
Zurück zum Zitat Liu, Y., Xu, C., Cheung, S.C.: Where has my battery gone? Finding sensor related energy black holes in smartphone applications. In: Pervasive Computing and Communications (PerCom), pp. 2–10. IEEE (2013) Liu, Y., Xu, C., Cheung, S.C.: Where has my battery gone? Finding sensor related energy black holes in smartphone applications. In: Pervasive Computing and Communications (PerCom), pp. 2–10. IEEE (2013)
11.
Zurück zum Zitat Liu, Y., Xu, C., Cheung, S.C.: Characterizing and detecting performance bugs for smartphone applications. In: Proceedings of the 36th International Conference on Software Engineering, pp. 1013–1024 (2014) Liu, Y., Xu, C., Cheung, S.C.: Characterizing and detecting performance bugs for smartphone applications. In: Proceedings of the 36th International Conference on Software Engineering, pp. 1013–1024 (2014)
12.
Zurück zum Zitat Wu, H., Yang, S., Rountev, A.: Static detection of energy defect patterns in Android applications. In: Proceedings of the 25th International Conference on Compiler Construction, pp. 185–195. ACM (2016) Wu, H., Yang, S., Rountev, A.: Static detection of energy defect patterns in Android applications. In: Proceedings of the 25th International Conference on Compiler Construction, pp. 185–195. ACM (2016)
13.
Zurück zum Zitat Kim, P., Kroening, D., Kwiatkowska, M.: Static program analysis for identifying energy bugs in graphics-intensive mobile apps. In: Proceedings of the 24th IEEE International Conference on Modelling, Analysis and Simulation of Computer and Telecommunication Systems, MASCOTS 2016. IEEE CS Press (2016) Kim, P., Kroening, D., Kwiatkowska, M.: Static program analysis for identifying energy bugs in graphics-intensive mobile apps. In: Proceedings of the 24th IEEE International Conference on Modelling, Analysis and Simulation of Computer and Telecommunication Systems, MASCOTS 2016. IEEE CS Press (2016)
14.
Zurück zum Zitat Hao, S., Li, D., Halfond, W.G.J., Govindan, R.: Estimating mobile application energy consumption using program analysis. In: Proceedings of the 35th International Conference on Software Engineering (ICSE), May 2013 Hao, S., Li, D., Halfond, W.G.J., Govindan, R.: Estimating mobile application energy consumption using program analysis. In: Proceedings of the 35th International Conference on Software Engineering (ICSE), May 2013
15.
Zurück zum Zitat Li, D., Hao, S., Halfond, W.G.J., Govindan, R.: Calculating source line level energy information for Android applications. In: ISSTA (2013) Li, D., Hao, S., Halfond, W.G.J., Govindan, R.: Calculating source line level energy information for Android applications. In: ISSTA (2013)
16.
Zurück zum Zitat Li, D., Tran, A.H., Halfond, W.G.J.: Making web applications more energy efficient for OLED smartphones. In: Proceedings of the International Conference on Software Engineering (ICSE), June 2014 Li, D., Tran, A.H., Halfond, W.G.J.: Making web applications more energy efficient for OLED smartphones. In: Proceedings of the International Conference on Software Engineering (ICSE), June 2014
17.
Zurück zum Zitat Li, D., Lyu, Y., Gui, J., Halfond, W.G.J.: Automated energy optimization of HTTP requests for mobile applications. In: Proceedings of the 38th International Conference on Software Engineering (ICSE), May 2016 Li, D., Lyu, Y., Gui, J., Halfond, W.G.J.: Automated energy optimization of HTTP requests for mobile applications. In: Proceedings of the 38th International Conference on Software Engineering (ICSE), May 2016
18.
Zurück zum Zitat Liu, Y., Chang, X., Cheung, S.C., Lu, J.: GreenDroid: automated diagnosis of energy inefficiency for smartphone applications. IEEE Trans. Software Eng. 40(9), 911–940 (2014)CrossRef Liu, Y., Chang, X., Cheung, S.C., Lu, J.: GreenDroid: automated diagnosis of energy inefficiency for smartphone applications. IEEE Trans. Software Eng. 40(9), 911–940 (2014)CrossRef
19.
Zurück zum Zitat Wan, M., Jin, Y., Li, D., Halfond, W.G.J.: Detecting display energy hotspots in Android apps. In: Proceedings of the 8th IEEE International Conference on Software Testing, Verification and Validation (ICST), April 2015 Wan, M., Jin, Y., Li, D., Halfond, W.G.J.: Detecting display energy hotspots in Android apps. In: Proceedings of the 8th IEEE International Conference on Software Testing, Verification and Validation (ICST), April 2015
20.
Zurück zum Zitat Vsquez, M.L., Bavota, G., Bernal-Crdenas, C., et al.: Mining energy-greedy API usage patterns in Android apps: an empirical study. In: 11th Working Conference on Mining Software Repositories, MSR 2014, pp. 2–11 (2014) Vsquez, M.L., Bavota, G., Bernal-Crdenas, C., et al.: Mining energy-greedy API usage patterns in Android apps: an empirical study. In: 11th Working Conference on Mining Software Repositories, MSR 2014, pp. 2–11 (2014)
21.
Zurück zum Zitat Tianyong, W., Liu, J., Zhenbo, X., Guo, C., Zhang, Y., Yan, J., Zhang, J.: Light-weight, inter-procedural and callback-aware resource leak detection for Android apps. IEEE Trans. Software Eng. 42(11), 1054–1076 (2016)CrossRef Tianyong, W., Liu, J., Zhenbo, X., Guo, C., Zhang, Y., Yan, J., Zhang, J.: Light-weight, inter-procedural and callback-aware resource leak detection for Android apps. IEEE Trans. Software Eng. 42(11), 1054–1076 (2016)CrossRef
22.
Zurück zum Zitat Lu, Q., Wu, T., Yan, J., Yan, J., Ma, F., Zhang, F.: Lightweight method-level energy consumption estimation for Android applications. In: TASE 2016, pp. 144–151 (2016) Lu, Q., Wu, T., Yan, J., Yan, J., Ma, F., Zhang, F.: Lightweight method-level energy consumption estimation for Android applications. In: TASE 2016, pp. 144–151 (2016)
23.
Zurück zum Zitat Wu, T., Liu, J., Deng, X., Yan, J., Zhang, J.: Relda2: an effective static analysis tool for resource leak detection in Android apps. In: ASE 2016, pp. 762–767 (2016) Wu, T., Liu, J., Deng, X., Yan, J., Zhang, J.: Relda2: an effective static analysis tool for resource leak detection in Android apps. In: ASE 2016, pp. 762–767 (2016)
24.
Zurück zum Zitat Banerjee, A., Chong, L.K., Chattopadhyay, S., Roychoudhury, A.: Detecting energy bugs and hotspots in mobile apps. In: SIGSOFT FSE 2014, pp. 588–598 (2014) Banerjee, A., Chong, L.K., Chattopadhyay, S., Roychoudhury, A.: Detecting energy bugs and hotspots in mobile apps. In: SIGSOFT FSE 2014, pp. 588–598 (2014)
25.
Zurück zum Zitat Pathak, A., Hu, Y.C., Zhang, M.: Where is the energy spent inside my app?: Fine grained energy accounting on smartphones with Eprof. In: Proceedings of the 7th ACM European Conference on Computer Systems, EuroSys 2012, pp. 29–42 (2012) Pathak, A., Hu, Y.C., Zhang, M.: Where is the energy spent inside my app?: Fine grained energy accounting on smartphones with Eprof. In: Proceedings of the 7th ACM European Conference on Computer Systems, EuroSys 2012, pp. 29–42 (2012)
26.
Zurück zum Zitat Guo, C., Zhang, J., Yan, J., Zhang, Z., Zhang, Y.: Characterizing and detecting resource leaks in Android applications. In: IEEE/ACM 28th International Conference on Automated Software Engineering, ASE 2013, pp. 389–398 (2013) Guo, C., Zhang, J., Yan, J., Zhang, Z., Zhang, Y.: Characterizing and detecting resource leaks in Android applications. In: IEEE/ACM 28th International Conference on Automated Software Engineering, ASE 2013, pp. 389–398 (2013)
Metadaten
Titel
Detecting Energy Bugs in Android Apps Using Static Analysis
verfasst von
Hao Jiang
Hongli Yang
Shengchao Qin
Zhendong Su
Jian Zhang
Jun Yan
Copyright-Jahr
2017
DOI
https://doi.org/10.1007/978-3-319-68690-5_12

Premium Partner