# Attention Transfer Reinforcement Learning for Test Case Prioritization in Continuous Integration
## 3 Related Work  
TCP is the sorting of a given set of test cases to improve the efficiency of error detection in the test case set. The most classic sorting techniques are designed based on greedy algorithms, including Total and Additional [11, 12, 13, 14, 15, 16, 17]. When the coverage area of test cases is larger, they are more likely to detect errors, so these greedy strategies prioritize executing test cases with more coverage program statements. The Total strategy prioritizes the selection of the test case with the highest total number of coverage statements, while the Additional strategy prioritizes the selection of the test case with the highest number of coverage statements that are currently not covered. Test case sorting in CI is more frequent and continuous. Code instrumentation and other methods of collecting data have a high time cost and are not enough to quickly respond to high-frequency code changes. The research on test case selection and ranking in CI environment can be divided into two categories: ML-based and non-ML-based. Non-ML-based Methods: [PERSON] et al. [18] proposed a genetic-algorithm-based TCP method, which leverages genetic algorithms to prioritize test cases with the objective of maximizing fault detection rates. In [19], [PERSON] et al. proposed a parallel  
Figure 1: Reinforcement-learning-integrated CI testing. testing priority ranking method to generate multiple test sequences by considering test coverage and execution time, and allocates them to various computing resources for parallel execution, aiming to accelerate fault detection. Another work [20] introduced a set of seed selection strategies for search-based test case selection problems. Their proposed solution are integrated with four latest multi-objective search algorithms and applied to CI environments. [PERSON] et al. used theoretical analysis method for the priority of random regression test cases [21], which is innovative in that the method derives probability quality functions and expected values for commonly used indicators and schemes in RTP research. [PERSON] et al. proposed a regression TCP method based on code coverage, which is innovative in that it takes into account the position of changed (delta) code elements (basic blocks) on the acyclic execution path of regression test cases [22]. [PERSON] et al. proposed a method to make the latest analysis-based RTS (Test Case Selection) technology more precise. The method lies in the fact that the article manually checks for code changes to discover changes that do not require re-running tests, which are only affected by these changes. A regression TCP method based on code coverage (Colosseum) [23] takes into account the position of changed (delta) code elements (basic blocks) on the acyclic execution path of regression test cases. However, the majority of these methods depend on code instrumentation or similar techniques to gather information, such as test case coverage. This approach is time-consuming and is generally suited for relatively fixed and small-scale test case sets. In contrast, TCP within CI environments occurs more frequently and continuously, where the overhead associated with data collection methods like code instrumentation becomes prohibitively high, making it difficult to swiftly adapt to the rapid pace of code changes. ML-based Methods: [PERSON] et al. proposed a test case ranking technique using ML algorithms [24] and conducted experiments in a large-scale CI environment. They extracted useful test case features and assigned priority to test cases using an SVM classifier. However, their technique obtained a fixed strategy after training and cannot adjust the ranking strategy with changes in the code in the integration environment. [PERSON] et al. [25] investigated cross-project TCP based on transfer learning, which is suitable for projects with limited data and exhibits strong transferability. However, the effectiveness of the transfer largely depends on the similarity between the datasets, and the training process tends to be time-consuming.