# Attention Transfer Reinforcement Learning for Test Case Prioritization in Continuous Integration
## 7 Discussion  
The proposed ATRL-TCP method performs well on four public datasets. As shown in Figure 5, compared to RETECS, ATRL-TCP can achieve good sorting results even when test case feature information is insufficient. It sorts test cases based on their relative relationships from a global perspective, leading to better performance. In particular, on the GSDTSR and Apach Drill datasets, RETECS performs much worse than our method. This is mainly due to the low average execution count of test cases in these datasets, which prevents RETECS from receiving effective reward feedback. In contrast, ATRL-TCP leverages the relative sorting relationships between test cases to design the execution queue, achieving better testing results. Compared to PRM, ATRL-TCP can fully utilize both test case feature information and relative relationships for sorting. The rewards available to the model are more comprehensive and stable, and the model's performance improves overall as the CI cycles increase. On the Apach Drill dataset, PRM's performance decreases as the cycle count increases. This may be due to underfitting or unclear reward signals, which misleads the model's updates. Furthermore, as shown in Tables 4 and 5, ATRL-TCP can detect errors earlier and find more errors compared to RETECS and PRM.  
By evaluating the richness of historical information and defect detection ability of the test cases, ATRL-TCP can dynamically shift the model's focus. When test cases have been executed in many cycles, their rich historical information can be used for evaluation. At this point, ATRL-TCP focuses on the defect detection ability of each test case and sorts accordingly. If the execution of a test case is more dispersed, there will be less information available. In such cases, ATRL-TCP shifts its focus to the relative relationships between test cases, designing the test sequence based on the relative order of execution. This global sorting approach leads to better testing results. Thus, ATRL-TCP adapts to various sorting scenarios, enhancing its generalization ability.  
However, ATRL-TCP still has areas for improvement.  
* **Reward Function:** The reward function used in this paper only considers the position of the test case that detects an error within the entire execution sequence. It does not account for the execution time of test cases. In real-world scenarios, developers expect to detect errors and provide feedback in the shortest time possible. Time is an important factor and should be incorporated into the reward mechanism in future research.  
* **Parameter Sensitivity:** ATRL-TCP needs to adjust its focus based on the length of historical information and error rate. As shown in Figure 7, these parameters have a noticeable impact on model performance. These parameter designs should be validated on more CI datasets.
* **Time Overhead:** In RQ3, we evaluated ATRL-TCP's execution efficiency. The experimental results are acceptable for offline TCP tasks. To perform sorting tasks online, the model should be further optimized to reduce sorting time and speed up feedback.