一句话:提出首个混合粒度回归测试选择方法 HyRTS,结合方法级与文件级分析以提升测试选择效果并降低测试时间。
回归测试至关重要但成本极高。回归测试选择(RTS)通过只运行可能受代码变更影响的测试来降低开销。现有 RTS 在不同粒度上分析:细粒度选择更精确但开销高,粗粒度开销低但精度差。本文提出首个混合 RTS 方法 HyRTS,在多个粒度上分析,结合方法级与文件级 RTS 的优势。作者实现基础版本并在 32 个项目、2707 个修订版、总计超过 1.24 亿行代码上评估,结果显示 HyRTS 在选中测试比例与离线测试时间上显著优于当前最佳的文件级 RTS(FRTS)。论文还研究各类方法级变更的影响,设计两个新变体;实验表明,将实例方法新增/删除转换为文件级变更的变体在离线与在线测试时间上均显著优于 FRTS。
Regression testing is crucial but can be extremely costly. Regression Test Selection (RTS) aims to reduce regression testing cost by only selecting and running the tests that may be affected by code changes. To date, various RTS techniques analyzing at different granularities (e.g., at the basic-block, method, and file levels) have been proposed. RTS techniques working on finer granularities may be more precise in selecting tests, while techniques working on coarser granularities may have lower overhead. According to a recent study, RTS at the file level (FRTS) can have less overall testing time compared with a finer grained technique at the method level, and represents state-of-the-art RTS. In this paper, we present the first hybrid RTS approach, HyRTS, that analyzes at multiple granularities to combine the strengths of traditional RTS techniques at different granularities. We implemented the basic HyRTS technique by combining the method and file granularity RTS. The experimental results on 2707 revisions of 32 projects, totalling over 124 Million LoC, demonstrate that HyRTS outperforms state-of-the-art FRTS significantly in terms of selected test ratio and the offline testing time. We also studied the impacts of each type of method-level changes, and further designed two new HyRTS variants based on the study results. Our additional experiments show that transforming instance method additions/deletions into file-level changes produces an even more effective HyRTS variant that can significantly outperform FRTS in both offline and online testing time.