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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
Activities are the entry point of interactions between users and apps https://developer.android.com/guide/components/activities.
- 2.
onPause() is a callback method that is invoked by the Android framework every time an activity is paused.
- 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
Android Docs: Camera API (2020). https://developer.android.com/guide/topics/media/camera
Android Docs: App startup time (2022). https://developer.android.com/topic/performance/vitals/launch-time
Android Docs: dumpsys (2022). https://developer.android.com/studio/command-line/dumpsys
Android Docs: Profile your app performance (2022). https://developer.android.com/studio/profile
Android Docs: The Android Profiler (2022). https://developer.android.com/studio/profile/android-profiler
Android Docs: The Android Studio. https://developer.android.com/studio (2022)
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)
Chow, T.S.: Testing software design modeled by finite-state machines. IEEE Trans. Software Eng. 3, 178–187 (1978)
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)
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)
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)
Falcone, Y.: You should better enforce than verify. In: Proceedings of the International Conference on Runtime Verification (RV) (2010)
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)
Hort, M., Kechagia, M., Sarro, F., Harman, M.: A survey of performance optimization for mobile applications. IEEE Trans. Softw. Eng. (2021)
Khoury, R., Tawbi, N.: Which security policies are enforceable by runtime monitors? a survey. Comput. Sci. Rev. 6(1), 27–45 (2012)
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)
Lanotte, R., Merro, M., Munteanu, A.: Runtime enforcement for control system security. In: Proceedings of the Computer Security Foundations Symposium (CSF) (2020)
Lee, D., Yannakakis, M.: Principles and methods of testing finite state machines-a survey. Proc. IEEE 84(8), 1090–1123 (1996)
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)
Ligatti, J., Bauer, L., Walker, D.: Edit automata: enforcement mechanisms for run-time security policies. Int. J. Inf. Secur. 4, 2–16 (2005)
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)
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)
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)
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)
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)
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)
Molyneaux, I.: The art of application performance testing: from strategy to tools. “O’Reilly Media, Inc.” (2014)
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)
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)
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)
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)
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)
Riganelli, O., Micucci, D., Mariani, L., Falcone, Y.: Verifying policy enforcers. In: Proceedings of the International Conference on Runtime Verification (RV) (2017)
Sidhu, D.P., Leung, T.K.: Formal methods for protocol testing: a detailed study. IEEE Trans. Software Eng. 15(4), 413–426 (1989)
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)
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/
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)
Acknowledgements
We would like to thanks Alice Hoa Galli for her help with the experiments.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
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)