Non-functional Testing of Runtime Enforcers in Android

  • Conference paper
  • First Online:
Leveraging Applications of Formal Methods, Verification and Validation. Verification Principles (ISoLA 2022)

Abstract

Runtime enforcers can be used to ensure that running applications satisfy desired correctness properties. Although runtime enforcers that are correct-by-construction with respect to abstract behavioral models are relatively easy to specify, the concrete software enforcers generated from these specifications may easily introduce issues in the target application. Indeed developers can generate test suites to verify the functional behavior of the enforcers, for instance exploiting the same models used to specify them. However, it remains challenging and tedious to verify the behavior of enforcers in terms of non-functional performance characteristics. This paper describes a practical approach to reveal runtime enforcers that may introduce inefficiencies in the target application. The approach relies on a combination of automatic test generation and runtime monitoring of multiple key performance indicators. We designed our approach to reveal issues in four indicators for mobile systems: responsiveness, launch time, memory, and energy consumption. Experimental results show that our approach can detect performance issues that might be introduced by automatically generated enforcers.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
EUR 32.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or Ebook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 79.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 99.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free ship** worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    Activities are the entry point of interactions between users and apps https://developer.android.com/guide/components/activities.

  2. 2.

    onPause() is a callback method that is invoked by the Android framework every time an activity is paused.

  3. 3.

    fooCam is a HDR camera app that can take multiple shots with different exposure settings. The app is available on the Google Play Store at the following link: https://play.google.com/store/apps/details?id=net.phunehehe.foocam2 &hl=EN.

References

  1. Android Docs: Camera API (2020). https://developer.android.com/guide/topics/media/camera

  2. Android Docs: App startup time (2022). https://developer.android.com/topic/performance/vitals/launch-time

  3. Android Docs: dumpsys (2022). https://developer.android.com/studio/command-line/dumpsys

  4. Android Docs: Profile your app performance (2022). https://developer.android.com/studio/profile

  5. Android Docs: The Android Profiler (2022). https://developer.android.com/studio/profile/android-profiler

  6. Android Docs: The Android Studio. https://developer.android.com/studio (2022)

  7. Belli, F., Beyazıt, M., Endo, A.T., Mathur, A., Simao, A.: Fault domain-based testing in imperfect situations: a heuristic approach and case studies. Software Qual. J. 23(3), 423–452 (2015)

    Article  Google Scholar 

  8. Chow, T.S.: Testing software design modeled by finite-state machines. IEEE Trans. Software Eng. 3, 178–187 (1978)

    Article  Google Scholar 

  9. Dai, Y., **ang, Y., Zhang, G.: Self-healing and hybrid diagnosis in cloud computing. In: Proceedings of the International Conference on Cloud Computing (CloudCom) (2009)

    Google Scholar 

  10. Daian, P., Falcone, Y., Meredith, P.O., Serbanuta, T., Shiriashi, S., Iwai, A., Rosu, G.: Rv-android: Efficient parametric android runtime verification, a brief tutorial. In: Proceedings of the International Conference on Runtime Verification (RV) (2015)

    Google Scholar 

  11. Falcone, Y., Currea, S., Jaber, M.: Runtime verification and enforcement for android applications with RV-Droid. In: Proceedings of the International Conference on Runtime Verification (RV) (2012)

    Google Scholar 

  12. Falcone, Y.: You should better enforce than verify. In: Proceedings of the International Conference on Runtime Verification (RV) (2010)

    Google Scholar 

  13. Guzman, M., Riganelli, O., Micucci, D., Mariani, L.: Test4enforcers: Test case generation for software enforcers. In: Proceedings of the International Conference on Runtime Verification (RV) (2020)

    Google Scholar 

  14. Hort, M., Kechagia, M., Sarro, F., Harman, M.: A survey of performance optimization for mobile applications. IEEE Trans. Softw. Eng. (2021)

    Google Scholar 

  15. Khoury, R., Tawbi, N.: Which security policies are enforceable by runtime monitors? a survey. Comput. Sci. Rev. 6(1), 27–45 (2012)

    Article  Google Scholar 

  16. Kong, P., Li, L., Gao, J., Liu, K., Bissyandé, T.F., Klein, J.: Automated testing of android apps: a systematic literature review. IEEE Trans. Reliability (2019)

    Google Scholar 

  17. Lanotte, R., Merro, M., Munteanu, A.: Runtime enforcement for control system security. In: Proceedings of the Computer Security Foundations Symposium (CSF) (2020)

    Google Scholar 

  18. Lee, D., Yannakakis, M.: Principles and methods of testing finite state machines-a survey. Proc. IEEE 84(8), 1090–1123 (1996)

    Article  Google Scholar 

  19. Li, Y., Ziyue, Y., Yao, G., **angqun, C.: Droidbot: a lightweight ui-guided test input generator for android. In: Proceedings of the International Conference on Software Engineering Companion (ICSE) (2017)

    Google Scholar 

  20. Ligatti, J., Bauer, L., Walker, D.: Edit automata: enforcement mechanisms for run-time security policies. Int. J. Inf. Secur. 4, 2–16 (2005)

    Article  Google Scholar 

  21. Linares-Vasquez, M., Vendome, C., Luo, Q., Poshyvanyk, D.: How developers detect and fix performance bottlenecks in android apps. In: Proceedings of the International Conference on Software Maintenance and Evolution (ICSME) (2015)

    Google Scholar 

  22. Linares-Vásquez, M., Moran, K., Poshyvanyk, D.: Continuous, evolutionary and large-scale: a new perspective for automated mobile app testing. In: Proceedings of the International Conference on Software Maintenance and Evolution (ICSME) (2017)

    Google Scholar 

  23. Liu, J., Wu, T., Yan, J., Zhang, J.: Fixing resource leaks in android apps with light-weight static analysis and low-overhead instrumentation. In: Proceedings of the International Symposium on Software Reliability Engineering (ISSRE) (2016)

    Google Scholar 

  24. Luo, G., Petrenko, A., Bochmann, G.V.: Selecting test sequences for partially-specified nondeterministic finite state machines. In: Proceedings of the IFIP WG 6.1 International Workshop on Protocol Text Systems (1995)

    Google Scholar 

  25. Magalhães, J.a.P., Silva, L.M.: Shõwa: A self-healing framework for web-based applications. ACM Trans. Autonomous Adaptive Syst. 10(1), 4:1–4:28 (2015)

    Google Scholar 

  26. Memon, A.M., Banerjee, I., Nguyen, B.N., Robbins, B.: The first decade of gui rip**: Extensions, applications, and broader impacts. In: Proceedings of the Working Conference on Reverse Engineering (WCRE) (2013)

    Google Scholar 

  27. Molyneaux, I.: The art of application performance testing: from strategy to tools. “O’Reilly Media, Inc.” (2014)

    Google Scholar 

  28. Muccini, H., Di Francesco, A., Esposito, P.: Software testing of mobile applications: challenges and future research directions. In: Proceedings of the International Workshop on Automation of Software Test (AST) (2012)

    Google Scholar 

  29. Riganelli, O., Micucci, D., Mariani, L.: Healing data loss problems in android apps. In: Proceedings of the International Workshop on Software Faults (IWSF), co-located with the International Symposium on Software Reliability Engineering (ISSRE) (2016)

    Google Scholar 

  30. Riganelli, O., Micucci, D., Mariani, L.: Increasing the reusability of enforcers with lifecycle events. In: Proceedings of the International Symposium on Leveraging Applications of Formal Methods, Verification and Validation (ISOLA) (2018)

    Google Scholar 

  31. Riganelli, O., Micucci, D., Mariani, L.: Policy enforcement with proactive libraries. In: Proceedings of the IEEE/ACM International Symposium on Software Engineering for Adaptive and Self-Managing Systems (SEAMS) (2017)

    Google Scholar 

  32. Riganelli, O., Micucci, D., Mariani, L.: Controlling interactions with libraries in android apps through runtime enforcement. ACM Trans. Autonomous Adaptive Syst. 14(2), 8:1–8:29 (2019)

    Google Scholar 

  33. Riganelli, O., Micucci, D., Mariani, L., Falcone, Y.: Verifying policy enforcers. In: Proceedings of the International Conference on Runtime Verification (RV) (2017)

    Google Scholar 

  34. Sidhu, D.P., Leung, T.K.: Formal methods for protocol testing: a detailed study. IEEE Trans. Software Eng. 15(4), 413–426 (1989)

    Article  Google Scholar 

  35. Sidiroglou, S., Laadan, O., Perez, C., Viennot, N., Nieh, J., Keromytis, A.D.: ASSURE: automatic software self-healing using rescue points. In: Proceedings of the International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (2009)

    Google Scholar 

  36. Statista: Number of apps available in leading app stores as of 2022 (2022). https://www.statista.com/statistics/276623/number-of-apps-available-in-leading-app-stores/

  37. Yang, S., Yan, D., Rountev, A.: Testing for poor responsiveness in android applications. In: Proceedings of the International Workshop on the Engineering of Mobile-Enabled Systems (MOBS) (2013)

    Google Scholar 

Download references

Acknowledgements

We would like to thanks Alice Hoa Galli for her help with the experiments.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Oliviero Riganelli .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Riganelli, O., Micucci, D., Mariani, L. (2022). Non-functional Testing of Runtime Enforcers in Android. In: Margaria, T., Steffen, B. (eds) Leveraging Applications of Formal Methods, Verification and Validation. Verification Principles. ISoLA 2022. Lecture Notes in Computer Science, vol 13701. Springer, Cham. https://doi.org/10.1007/978-3-031-19849-6_19

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-19849-6_19

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-19848-9

  • Online ISBN: 978-3-031-19849-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics

Navigation