Test Case Prioritization Technique in Continuous Integration Based on Reinforcement Learning

被引:0
作者
Zhao Y.-F. [1 ,2 ]
Hao D. [1 ,2 ]
机构
[1] Key Laboratory of High Confidence Software Technologies of Ministry of Education, Peking University, Beijing
[2] School of Computer Science, Peking University, Beijing
来源
Ruan Jian Xue Bao/Journal of Software | 2023年 / 34卷 / 06期
关键词
continuous integration (CI); reinforcement learning; test case prioritization;
D O I
10.13328/j.cnki.jos.006506
中图分类号
学科分类号
摘要
As software delivery increasingly emphasizes speed and reliability, continuous integration (CI) has attracted more and more attention these years. Developers continue to integrate working copies into the mainline to realize software evolution. Each integration involves automated tests to verify whether the update introduces faults. However, as the scale of software increases, test suites contain more and more test cases. As software evolves, the coverage and fault detection ability of test cases also change among different CI cycles. As a result, the traditional test case prioritization techniques may be inapplicable. Techniques based on reinforcement learning can adjust prioritization strategies dynamically according to test feedback. But the existing techniques based on reinforcement learning proposed in recent years do not comprehensively consider information in the test suite during prioritization, which limits their effectiveness. This study proposes a new test case prioritization method in CI, called pointer ranking method. The method uses features like history information of test cases as inputs. In each CI cycle, the agent uses the attention mechanism to gain attention to all candidate test cases, and then obtains a prioritization result. After test execution, it obtains the updating direction from the feedback. It constantly adjusts its prioritization strategy in the process “prioritization, test execution, test feedback” and finally achieves satisfied prioritization performance. This study verifies the effectiveness of the proposed method on five large-scale datasets, and explores the impact of history length on method performance. Besides, it explores the model’s effectiveness on datasets which only contain regression test cases and the model’s execution efficiency. Finally, the study comes to the following conclusions. First, compared to existing techniques, pointer ranking method can adjust its strategy along with the evolution of the software, and effectively enhance the fault detection ability of test sequence in CI. Second, pointer ranking method has good robustness to history length. A small amount of history information can make it achieve the optimal performance. Third, pointer ranking method can handle regression test cases and newly-added test cases well. Finally, pointer ranking method has little time overhead. Considering its better and more stable prioritization performance, pointer ranking method is a very competitive method. © 2023 Chinese Academy of Sciences. All rights reserved.
引用
收藏
页码:2708 / 2726
页数:18
相关论文
共 45 条
[1]  
Travis CI., (2018)
[2]  
Circle CI., (2018)
[3]  
(2018)
[4]  
(2018)
[5]  
Liang JJ, Elbaum S, Rothermel G., Redefining prioritization: Continuous prioritization for continuous integration, Proc. of the 40th IEEE/ACM Int’l Conf. on Software Engineering (ICSE), pp. 688-698, (2018)
[6]  
Memon A, Gao ZB, Nguyen B, Dhanda S, Nickell E, Siemborski R, Micco J., Taming Google-scale continuous testing, Proc. of the 39th IEEE/ACM Int’l Conf. on Software Engineering: Software Engineering in Practice Track (ICSE-SEIP), pp. 233-242, (2017)
[7]  
Fowler M., Continuous integration, (2006)
[8]  
Henard C, Papadakis M, Harman M, Jia M, Traon YL., Comparing white-box and black-box test prioritization, Proc. of the 38th IEEE/ACM Int’l Conf. on Software Engineering (ICSE), pp. 523-534, (2016)
[9]  
Zhang L, Hao D, Zhang L, Rothermel G, Mei H., Bridging the gap between the total and additional test-case prioritization strategies, Proc. of the 35th Int’l Conf. on Software Engineering (ICSE), pp. 192-201, (2013)
[10]  
Hao D, Zhang LM, Zhang L, Rothermel G, Mei H., A unified test case prioritization approach, ACM Trans. on Software Engineering and Methodology, 24, 2, (2014)