变更历史的时序建模用于黑盒测试套件最小化
Temporal Modeling of Change History for Black-Box Test Suite Minimization
AI总结:
提出 Temporal Risk-driven Test Suite Minimization (TRTM),通过指数时间衰减对变更历史加权,结合静态调用图计算测试用例风险分数,选择高风险用例实现黑盒测试套件最小化。
摘要:
测试套件最小化(TSM)在保持故障检测能力的同时减小测试套件规模。在黑盒TSM中,缩减过程不依赖生产代码插桩。虽然已有多种黑盒TSM方法探索了测试日志或测试相似度等指标,但这些方法常面临可扩展性和效率问题。最近,变更历史被探索作为轻量级且可扩展的指标来指导黑盒TSM。然而,现有方法统一处理历史修改,忽略了软件演化的时间动态性(近期修改的代码更易出错)。为解决此限制,我们将时序建模引入黑盒TSM,并提出时序风险驱动的测试套件最小化(TRTM)。TRTM从版本控制元数据中提取修改历史,并应用指数时间衰减根据修改的新近程度对变更进行加权,生成反映故障倾向性的时间加权类级风险分数。接着,它通过仅从测试代码构建静态调用图来确定测试用例与生产类之间的依赖关系,保持黑盒设置。然后,使用平均值和几何均值等统计量聚合每个测试用例所执行类的风险分数,计算测试用例的风险分数。最后,选择风险分数最高的测试用例构成缩减后的测试套件。在包含14个项目、631个版本的大型数据集上的评估表明,TRTM始终优于最先进的基线方法,平均准确率达到0.72(对比0.66),故障检测率(FDR)达到0.75(对比0.69),同时减少了执行时间。
英文摘要:
Test Suite Minimization (TSM) reduces the size of test suites while preserving their fault detection capability. In black-box TSM, reduction is performed without relying on production-code instrumentation. While several black-box TSM approaches have explored metrics like test logs or test similarity, these often suffer from scalability and efficiency issues. Recently, change history has been explored as a lightweight and scalable indicator for guiding black-box TSM. However, existing approaches treat historical modifications uniformly, ignoring the temporal dynamics of software evolution where recently modified code tends to be more fault-prone. To address this limitation, we introduce temporal modeling into black-box TSM and propose Temporal Risk-driven Test Suite Minimization (TRTM). TRTM extracts modification history from version-control metadata and applies exponential temporal attenuation to weight changes based on recency, producing time-weighted class-level risk scores that reflect fault-proneness. Next, it determines dependencies between test cases and production classes by constructing static call graphs derived solely from test code, preserving the black-box setting. The risk scores of the classes exercised by each test case are then aggregated using statistical measures such as Average and Geometric Mean to compute a risk score for the test case. Finally, test cases with the highest risk scores are selected to construct the reduced suite. Evaluation on a large dataset containing 14 projects with 631 versions shows that TRTM consistently outperforms the state-of-the-art baseline, achieving a mean Accuracy of 0.72 (vs. 0.66) and Fault Detection Rate (FDR) of 0.75 (vs. 0.69), while also reducing execution time.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。