Abstract
As Android apps get more complicated, current automated testing techniques are not sufficient for discovering deep-hidden bugs. The deep-hidden bugs are triggered by sequential Data Manipulation Functions(DMFs), which often represents functional semantics (Create, Read, Update, Delete and Search). The Data Manipulation Function Sequence (DMFSQ) is composed of DMFs. Testing by DMFSQs can closely mirror real user interactions, and provide a more in-depth evaluation of the app’s functions. Therefore, to find the deep-hidden bugs, we propose a novel functional semantics guided exploration strategy based on DMFs and DMFSQs. Our idea is that we can (1) extract DMFs from the apps, and (2) use functional semantics of DMFs in the execution trace to guide the test exploration. To achieve this idea, we conducted a study on the GUI of various apps’ DMFs to identify accurate and universal GUI patterns as the extraction rule. With the rule, an algorithm is developed to extract DMFs from apps while detecting regular bugs during depth-first test exploration. Based on extracted DMFs, we design a exploration strategy based on Q-learning, a classic reinforcement learning algorithm for detecting deep-hidden bugs. We have implemented our idea as an automated testing tool \({\textsc {DmsDroid}}\). \({\textsc {DmsDroid}}\) can not only discover regular bugs, but also generate meaningful DMFSQs to detect deep-hidden bugs. The evaluation results of \({\textsc {DmsDroid}}\) on 16 real-world apps shows that \({\textsc {DmsDroid}}\) outperforms the state-of-practice Android testing techniques in terms of code coverage and bug detection. So far, 7 of our reported bugs have been confirmed.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
Ui/application exerciser monkey (2022). https://developer.android.com/studio/test/monkey
Android debug bridge (2023). https://developer.android.com/studio/command-line/adb
Logcat command-line tool (2023). https://developer.android.com/studio/command-line/logcat
Adamo, D., Khan, M.K., Koppula, S., Bryce, R.: Reinforcement learning for android GUI testing. In: Proceedings of the 9th ACM SIGSOFT International Workshop on Automating TEST Case Design, Selection, and Evaluation, pp. 2–8 (2018)
Amalfitano, D., Amatucci, N., Fasolino, A.R., Tramontana, P.: Agrippin: a novel search based testing technique for android applications. In: Proceedings of the 3rd International Workshop on Software Development Lifecycle for Mobile, pp. 5–12 (2015)
Amalfitano, D., Fasolino, A.R., Tramontana, P., De Carmine, S., Memon, A.M.: Using GUI ripping for automated testing of android applications. In: Proceedings of the 27th IEEE/ACM International Conference on Automated Software Engineering, pp. 258–261 (2012)
Amalfitano, D., Fasolino, A.R., Tramontana, P., Ta, B.D., Memon, A.M.: Mobiguitar: automated model-based testing of mobile apps. IEEE Softw. 32(5), 53–59 (2015). https://doi.org/10.1109/MS.2014.55
Arcuri, A., Briand, L.: A hitchhiker’s guide to statistical tests for assessing randomized algorithms in software engineering. Softw. Test. Verif. Reliab. 24(3), 219–250 (2014)
Azim, T., Neamtiu, I.: Targeted and depth-first exploration for systematic testing of android apps. In: Proceedings of the 2013 ACM SIGPLAN International Conference on Object Oriented Programming Systems Languages & Applications, pp. 641–660 (2013)
Baek, Y.M., Bae, D.H.: Automated model-based android GUI testing using multi-level GUI comparison criteria. In: Proceedings of the 31st IEEE/ACM International Conference on Automated Software Engineering, pp. 238–249 (2016)
Cai, T., Zhang, Z., Yang, P.: Fastbot: a multi-agent model-based test generation system Beijing Bytedance network technology co., ltd. In: Proceedings of the IEEE/ACM 1st International Conference on Automation of Software Test, pp. 93–96 (2020)
Dong, Z., Böhme, M., Cojocaru, L., Roychoudhury, A.: Time-travel testing of android apps. In: Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering, pp. 481–492 (2020)
Gu, T., et al.: Practical GUI testing of android applications via model abstraction and refinement. In: 2019 IEEE/ACM 41st International Conference on Software Engineering (ICSE), pp. 269–280. IEEE (2019)
Guo, H., Liu, X., Li, B., Cai, L., Hu, Y., Cao, J.: Sqdroid: a semantic-driven testing for android apps via q-learning. In: 2021 IEEE 21st International Conference on Software Quality, Reliability and Security (QRS), pp. 301–310. IEEE (2021)
Guo, H., Su, T., Liu, X., Gu, S., Sun, J.: Effectively finding ICC-related bugs in android apps via reinforcement learning. In: 34th IEEE International Symposium on Software Reliability Engineering (ISSRE) (2023)
Hu, C., Neamtiu, I.: Automating GUI testing for android applications. In: Proceedings of the 6th International Workshop on Automation of Software Test, pp. 77–83 (2011)
KG, M.G..C., Contributors: Jacoco - java code coverage library (2019). https://www.jacoco.org/jacoco/trunk/index.html. Accessed 7 Aug 2019
Kong, P., Li, L., Gao, J., Liu, K., Bissyandé, T.F., Klein, J.: Automated testing of android apps: a systematic literature review. IEEE Trans. Reliab. 68(1), 45–66 (2018)
Koroglu, Y., Sen, A.: Reinforcement learning-driven test generation for android GUI applications using formal specifications. arXiv preprint arXiv:1911.05403 (2019)
Koroglu, Y., et al.: QBE: qlearning-based exploration of android applications. In: 2018 IEEE 11th International Conference on Software Testing, Verification and Validation (ICST), pp. 105–115. IEEE (2018)
Lan, Y., et al.: Deeply reinforcing android GUI testing with deep reinforcement learning. In: Proceedings of the 46th IEEE/ACM International Conference on Software Engineering, pp. 1–13 (2024)
Li, Y., Yang, Z., Guo, Y., Chen, X.: Droidbot: a lightweight UI-guided test input generator for android. In: 2017 IEEE/ACM 39th International Conference on Software Engineering Companion (ICSE-C), pp. 23–26. IEEE (2017)
Li, Y., Yang, Z., Guo, Y., Chen, X.: Humanoid: a deep learning-based approach to automated black-box android app testing. In: 2019 34th IEEE/ACM International Conference on Automated Software Engineering (ASE), pp. 1070–1073. IEEE (2019)
Lv, Z., Peng, C., Zhang, Z., Su, T., Liu, K., Yang, P.: Fastbot2: reusable automated model-based GUI testing for android enhanced by reinforcement learning. In: Proceedings of the 37th IEEE/ACM International Conference on Automated Software Engineering, pp. 1–5 (2022)
Machiry, A., Tahiliani, R., Naik, M.: Dynodroid: an input generation system for android apps. In: Proceedings of the 2013 9th Joint Meeting on Foundations of Software Engineering, pp. 224–234 (2013)
Mahmood, R., Mirzaei, N., Malek, S.: Evodroid: segmented evolutionary testing of android apps. In: Proceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering, pp. 599–609 (2014)
Mao, K., Harman, M., Jia, Y.: Sapienz: multi-objective automated testing for android applications. In: Proceedings of the 25th International Symposium on Software Testing and Analysis, pp. 94–105 (2016)
Mariani, L., Pezzè, M., Zuddas, D.: Augusto: exploiting popular functionalities for the generation of semantic GUI tests with oracles. In: Proceedings of the 40th International Conference on Software Engineering, pp. 280–290 (2018)
Nguyen, C.D., Marchetto, A., Tonella, P.: Combining model-based and combinatorial testing for effective test case generation. In: Proceedings of the 2012 International Symposium on Software Testing and Analysis, pp. 100–110 (2012)
Pan, M., Huang, A., Wang, G., Zhang, T., Li, X.: Reinforcement learning based curiosity-driven testing of android applications. In: Proceedings of the 29th ACM SIGSOFT International Symposium on Software Testing and Analysis, pp. 153–164 (2020)
Romdhana, A., Merlo, A., Ceccato, M., Tonella, P.: Deep reinforcement learning for black-box testing of android apps. ACM Trans. Softw. Eng. Methodol. (TOSEM) 31(4), 1–29 (2022)
Su, T., et al.: Guided, stochastic model-based GUI testing of android apps. In: Proceedings of the 2017 11th Joint Meeting on Foundations of Software Engineering, pp. 245–256 (2017)
Sun, J., Su, T., Jiang, J., Wang, J., Pu, G., Su, Z.: Property-based fuzzing for finding data manipulation errors in android apps. In: Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE ’23). ACM (2023)
Sutton, R.S., Barto, A.G.: Reinforcement Learning: An Introduction. MIT Press, Cambridge (2018)
Vuong, T.A.T., Takada, S.: A reinforcement learning based approach to automated testing of android applications. In: Proceedings of the 9th ACM SIGSOFT International Workshop on Automating TEST Case Design, Selection, and Evaluation, pp. 31–37 (2018)
Wang, J., Jiang, Y., Xu, C., Cao, C., Ma, X., Lu, J.: Combodroid: generating high-quality test inputs for android apps via use case combinations. In: Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering, pp. 469–480 (2020)
Watkins, C.J., Dayan, P.: Q-learning. Mach. Learn. 8, 279–292 (1992)
Zhang, J., Sagar, S., Shihab, E.: The evolution of mobile apps: an exploratory study. In: Proceedings of the 2013 International Workshop on Software Development Lifecycle for Mobile, pp. 1–8 (2013)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2024 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Gu, S. et al. (2024). Finding Deep-Hidden Bugs in Android Apps via Functional Semantics Guided Exploration. In: Chin, WN., Xu, Z. (eds) Theoretical Aspects of Software Engineering. TASE 2024. Lecture Notes in Computer Science, vol 14777. Springer, Cham. https://doi.org/10.1007/978-3-031-64626-3_9
Download citation
DOI: https://doi.org/10.1007/978-3-031-64626-3_9
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-64625-6
Online ISBN: 978-3-031-64626-3
eBook Packages: Computer ScienceComputer Science (R0)