# Test Suite Prioritization Based on Optimization Approach Using Reinforcement Learning
## 4 Results and Discussion
### Performance Analysis  
In this section, the proposed methodology of TSP is validated using five android application case studies. The list of these case studies is presented and described below:  
* Health care case study. * Intelligent vehicle assistance system (IVAS). * Real estate case study. * Mobile shop POS app. * Jobs portal case study. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Test Case No.** & **Sequence** & **Similarity** \\ \hline
5 & S0, S1, S5, S10. & 1.0 \\
4 & S0, S1, S4, S10. & 0.6 \\
2 & S0, S1, S5. & 0.6 \\
6 & S0, S3, S8, S10. & 0.4 \\
1 & S0, S1. & 0.4 \\
3 & S0, S2, S6. & 0.2 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Prioritize tester logs with similarity. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**State/Actions** & **0** & **1** & **2** & **3** & **4** \\ \hline S0 & 0 & 74.6889 & 0 & 83.6889 & 65.9511 \\ S1 & 0 & 92.1111 & 67.9511 & 76.3111 & 72.6889 \\ S2 & 0 & 82.8889 & 74.6889 & 69.1111 & 65.3111 \\ S3 & 0 & 73.8889 & 67.3111 & 0 & 58.1111 \\ S4 & 67.9511 & 61.1111 & 0 & 92.1111 & 72.6889 \\ S5 & 83.6889 & 113.889 & 74.6889 & 82.8889 & 90.1111 \\ S6 & 76.3111 & 141.111 & 92.1111 & 73.8889 & 111.889 \\ S7 & 60.1111 & 0 & 0 & 91.1111 & 71.8889 \\ S8 & 74.6889 & 0 & 0 & 113.889 & 90.1111 \\ S9 & 92.1111 & 0 & 61.1111 & 141.111 & 111.889 \\ S10 & 82.8889 & 0 & 113.889 & 0 & 90.1111 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Updated Q-Table. The evaluation of each application is done in four steps; In the first step, the testers' and users' log datasets are prepared for the application. The second step uses the Q-learning model to predict the highest future reward sequence. In the third step, the prioritization algorithm predicts the prioritized test suite. Lastly, the fault seeding approach is used to validate the results from software engineering experts. For this purpose, two datasets are prepared to evaluate each application's case study. Firstly, the dataset is generated from the test-suite execution sequences. In contrast, the second dataset is generated from the sequence of the interaction of users with the application. The details about all the apps datasets are shown in Table 7.  
The validation of the proposed prioritization technique is performed using fault seeding-based performance analysis. Fault seeding is a technique for injecting faults into the application. Then it identifies in a given test suite how many top test cases can detect the seeded faults into the program, based on the confidence level. Fault injection can be classified on different assumptions, such as fault type, test environment, test objective, and level of faults, to name a few [30]. In this study, for evaluation of this study, two types of faults were considered, namely computational and domain faults [27]. The fault injection mechanism is based on the literature, as presented in Table 8[13; 27]. Each type of fault is seeded into specified percentage and based on the seeded percentage. After seeding faults in the application, the top 30 percent of test cases are executed to evaluate the prioritized test cases. This shows how many faults are detected because the primary goal of TSP is to reorder the test cases so that maximum faults can be detected in the minimum number of test cases. When the top 30 percent of the health care case study test cases were executed using the random approach, only 41 percent of faults were detected from the total seeded faults. Implementing the top 30 percent of test cases from t-SANT prioritize test suite, so it detects 82 percent of faults from total seeded faults. By executing the top 30 percent of test cases from Q-Learning, prioritize the test suite, and detects 85 percent faults from total seeded faults, and the total seeded faults in the health care case study are 35. The comparative fault detection percentage analysis of the proposed and baseline techniques is presented in Figure 4. Health care case study results are graphically shown in Figure 4a.