计算机科学 ›› 2025, Vol. 52 ›› Issue (12): 40-47.doi: 10.11896/jsjkx.241100054
宋日荣, 陈钦文, 陈星
SONG Rirong, CHEN Qinwen, CHEN Xing
摘要: Android应用程序已经深深融入人们日常生活的方方面面,确保这些应用的正确性是一个极具挑战性的任务。传统测试方法主要依赖于手工操作,自动化测试技术尽管有所发展但仍有待改进。Android应用程序不断迭代以完善性能和功能需求,导致了应用程序复杂性的增加和状态组合的爆炸性增长。测试Android应用的核心在于探索复杂的用户交互下的深层故障,但是这些故障的搜索空间是巨大的,需要花费大量的时间来进行测试。近年来,研究人员开始使用强化学习来测试Android应用,利用智能体与Android应用交互过程中获得的奖励来调整探索策略。然而,现有工作仅利用单台设备进行测试,测试效率十分有限。为了应对上述挑战,提出了一种基于强化学习的分布式Android应用自动化测试框架DistributedAndroidExplore(DAE),利用多个智能体同时对应用程序进行基于强化学习的测试,并定期迭代地聚合每个智能体累积的学习经验,以此提高测试效率。在10个真实世界的Android应用程序上对DAE进行了评估,结果表明,在大多数情况下,DAE的故障检测率、代码覆盖率均优于所对比的基准算法。同时测试效率明显优于其他方法,性能提高了16.5%~34.3%。
中图分类号:
| [1]TANG W H,TANG S H,LIAO C L.China’s Mobile Internet in the 5G Era——Release of the “Development Report of China’s Mobile Internet(2020)”[J].China Newspaper Industry,2020(17):32-35. [2]ZELENCHUK D,ZELENCHUK D.Supervised monkey testswith espresso and UI automator[M]//Android Espresso Revealed:Writing Automated UI Tests.Berkeley,CA:Apress,2019:255-269. [3]PAYDAR S.An empirical study on the effectiveness of monkey testing for android applications[J].Iranian Journal of Science and Technology,Transactions of Electrical Engineering,2020,44(2):1013-1029. [4]KALYSCH A,DEUTEL M,MÜLLER T.Template-based Android inter process communication fuzzing[C]//Proceedings of the 15th International Conference on Availability,Reliability and Security.2020:1-6. [5]SU T,MENG G,CHEN Y,et al.Guided,stochastic model-based GUI testing of Android apps[C]//Proceedings of the 2017 11th Joint Meeting on Foundations of Software Engineering.2017:245-256. [6]AMALFITANO D,FASOLINO A R,TRAMONTANA P,et al.Using GUI ripping for automated testing of Android applications[C]//Proceedings of the 27th IEEE/ACM International Conference on Automated Software Engineering.2012:258-261. [7]AMALFITANO D,FASOLINO A R,TRAMONTANA P,et al.MobiGUITAR:Automated model-based testing of mobile apps[J].IEEE Software,2014,32(5):53-59. [8]NGUYEN B N,ROBBINS B,BANERJEE I,et al.GUITAR:an innovative tool for automated testing of GUI-driven software[J].Automated Software Engineering,2014,21:65-105. [9]MAO K,HARMAN M,JIA Y.Sapienz:Multi-objective automated testing for android applications[C]//Proceedings of the 25th International Symposium on Software Testing and Analysis.2016:94-105. [10]MAHMOOD R,MIRZAEI N,MALEK S.Evodroid:Segmented evolutionary testing of android apps[C]//Proceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering.2014:599-609. [11]GAO X,TAN S H,DONG Z,et al.Android testing via synthetic symbolic execution[C]//Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering.2018:419-429. [12]PAN M,HUANG A,WANG G,et al.Reinforcement learning based curiosity-driven testing of Android applications[C]//Proceedings of the 29th ACM SIGSOFT International Symposium on Software Testing and Analysis.2020:153-164. [13]ROMDHANA A,MERLO A,CECCATO M,et al.Deep rein-forcement learning for black-box testing of android apps[J].ACM Transactions on Software Engineering and Methodology,2022,31(4):1-29. [14]GAO Y,TAO C,GUO H,et al.A Deep Reinforcement Learning-Based Approach for Android GUI Testing[C]//Asia-Pacific Web(APWeb) and Web-Age Information Management(WAIM) Joint International Conference on Web and Big Data.Cham:Springer,2023:262-276. [15]LÓPEZ Y P,COLONNA J G,SILVA E D A,et al.Q-funcT:A Reinforcement Learning Approach for Automated Black Box Functionality Testing[C]//2022 IEEE 2nd International Conference on Software Engineering and Artificial Intelligence(SEAI).IEEE,2022:119-123. [16]COLLINS E,NETO A,VINCENZI A,et al.Deep reinforcement learning based Android application GUI testing[C]//Proceedings of the XXXV Brazilian Symposium on Software Engineering.2021:186-194. [17]LU P,YANG C Z,YOU Z J.DiLAD:A Distributed Layout Testing Framework for Android Applications[C]//2020 the 3rd International Conference on Computing and Big Data.2020:24-29. [18]BORGES JR N P,GÓMEZ M,ZELLER A.Guiding app testing with mined interaction models[C]//Proceedings of the 5th International Conference on Mobile Software Engineering and Systems.2018:133-143. [19]KOROGLU Y,SEN A,MUSLU O,et al.QBE:QLearning-based exploration of android applications[C]//2018 IEEE 11thInternational Conference on Software Testing,Verification and Validation(ICST).IEEE,2018:105-115. [20]WANG Y,CHEN Y R,CHEN X,et al.Automating Release of Android APIs via Computational Reflection [J].Computer Science,2022,49(12):136-145. [21]ESKONEN J,KAHLES J,REIJONEN J.Automating gui testing with image-based deep reinforcement learning[C]//2020 IEEE International Conference on Autonomic Computing and Self-Organizing Systems(ACSOS).IEEE,2020:160-167. [22]Android Uiautomator2 Python Wrapper[EB/OL].https://github.com/openatx/uiautomator2. [23]Eclemma.JaCoCo Java Code Coverage Library[EB/OL](2020).https://www.eclemma.org/jacoco/index.html. |
|
||