| Mobile applications have brought great convenience to people’s lives.Due to the open source feature of Android operating system,the quality of application development is uneven.In addition,the number of new types and new versions of applications is increasing day by day,which makes the traditional manual testing methods unable to load.Therefore,it is a research trend to propose automated testing methods that can effectively guarantee the quality of applications.Most of the existing automated testing work of Android applications use machine learning algorithms to complete the exploration of application states.However,most machine learning algorithms need to train data in advance,input the trained data into the model,and finally execute the corresponding tasks,which increases the workload.The reinforcement learning algorithm can dynamically learn the strategy of the scene in the process of executing the task without training the data set,which greatly reduces the workload of testers in preparing data.Therefore,the research of this paper focuses on automated testing methods for Android applications based on reinforcement learning.The main work and innovations are as follows:(1)This paper proposes an automated testing method for Android applications based on reinforcement learning: SA-UCB.Sarsa algorithm is used to guide the test process,and Q table is took as the reference for action strategy selection.In view of the strong randomness of the-greedy strategy used by the classical Sarsa algorithm,the upper confidence bound algorithm is introduced to balance the "exploration-exploitation dilemma" in the testing process,so as to improve the Sarsa algorithm,make action decisions more decentralized.And it is applied to the Android automated testing process to improve the testing efficiency.(2)This paper proposes an automated testing method for Android applications based on backward Q-learning: BQSA-UCB.Aiming at the problem that the overestimation of the classical Sarsa algorithm may cause the test process to fall into the local optimum,the idea of backward Q-learning is introduced.After each round of test iteration,the Q-value function is updated back,so as to alleviate the overestimation problem caused by the classical Sarsa algorithm.The idea of backward Q-learning is applied to Sarsa algorithm to guide the exploration process,UCB strategy is used to balance the exploration and exploitation in testing,and Sarsa algorithm is further optimized.For Android applications that support third-party login of We Chat accounts,a We Chat automated login method is proposed,which can guide the testing tool to achieve automatic login of accounts without adding manual intervention.(3)Based on the above SA-UCB and BQSA-UCB algorithms,a prototype system based on Droidbot is built,and the Droidbot framework is redeveloped.The above two test methods are integrated on the framework for implementation.Compared with other test frameworks,the above test methods have achieved the expected test coverage and can effectively detect application bugs. |