# Test Suite Prioritization Based on Optimization Approach Using Reinforcement Learning
This paper presents a novel TSP technique based on the RL method named Q-learning. The first step of the proposed mechanism is data preparation and storing it in the database system. For this purpose, an interaction recording system is developed to record users' and testers' interactions with the application. For example, test cases are written in natural language, and the tester needs to follow these test cases to test the software system. Therefore, the tester's interaction with the system during system testing is imperative for prioritizing the test cases. Similarly, recording the user interaction with the application after its beta releases is needed. For instance, when any user wants to use the application, the user interacts with the view part, which is the graphical user interface (GUI). Each activity and button of the GUI application has a unique name or ID. For example, when a user clicks on a button, its activity name and the ID of the clicked button are added to the list. The list ends when the user logs out from the application, or the application is forcefully terminated. It gives a complete user interaction path from the log-in state to the log-out state. After using applications, many user interaction logs are recorded. Similarly, the testers' log is recorded when the tester interacts with the applications to execute the test cases. A conceptual model of the proposed test suite prioritization technique is presented in Figure 1.  
The RL model is used to train the agent to interact with the environment and maximize reward from state actions. The policy tells the agent which action to take in various circumstances. The policy is based on the finite Markov decision process (FMDP). [PERSON]'s decision process calculates the reward value based on the current and the next state. After learning the environment, the agent follows that sequence of states to maximize its reward from starting state to the final state. The proposed model is evaluated on datasets from the five case study applications. The case studies include the health care case study, intelligent vehicle assistance system (IVAS), real estate case study, mobile shop POS app, and jobs portal case study. For evaluation, the fault seeding [27; 28; 29; 30] mechanism is used to measure the fault detection after employing the prioritization algorithm. In summary, the main contributions of this study are as follows:  
* A four-fold methodology of test suite prioritization based on reinforcement learning. * Regression testing tool for android applications based on the real-time interaction of users and testers with the application. * Automatic test suite prioritization based on Q-Agent. * Five case study applications, including health care, intelligent vehicle assistance system (IVAS), real estate case study, mobile shop POS, and jobs portal. * Fault seeding-based approach for the validation of the proposed RL model. The rest of the paper is organized as follows: Section 2 presents the literature review. The proposed methodology is discussed in Section 3. Section 4 presents the results, proof of concept, and performance evaluation. Finally, the conclusions and future work directions are presented in Section 5.