arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.15232cs.SE
收藏

方法级变更敏感性:一种更优的黑盒测试套件最小化指标

Method-level Change-proneness: A Better Metric for Black-box Test Suite Minimization

University of Dhaka(达卡大学)

Md Siam, Kazi Sakib

AI总结:

本文提出方法级变更敏感性指标,用于改进黑盒测试套件最小化,通过分析版本控制元数据和测试代码调用图,提升测试用例选择的准确性和效率。

摘要:

测试套件最小化(TSM)在保持故障检测能力的同时减少测试套件的规模。在黑盒TSM中,减少过程不分析生产代码。尽管已有几种黑盒TSM方法探索了测试日志或测试相似性等指标,但这些方法常面临可扩展性和效率问题。另一方面,变更敏感性(CP)作为一种高效且可扩展的替代指标,仅在类级别应用。为了准确识别揭示故障的测试用例,本文提出在更细粒度的方法级别应用CP,并实现基于方法级变更敏感性的测试套件最小化(MCTM)。MCTM首先从版本控制元数据中计算每个方法的CP,然后通过分析测试代码调用图确定测试用例与方法之间的依赖关系。接下来,使用统计措施如平均值、几何平均等对测试用例与其调用方法之间的关联性进行评分。最后,选择评分最高的测试用例形成缩减的测试套件。在15个开源Java项目(635个有缺陷的版本)上的评估显示,MCTM在平均上实现了0.93的准确性及0.94的故障检测率,显著优于类级别CP和基于相似性的方法,同时保持了优越的效率。

英文摘要:

Test Suite Minimization (TSM) reduces the size of test suites while preserving their fault detection capability. In black-box TSM, reduction is performed without analyzing production code. While several black-box TSM approaches have explored metrics like test logs or test similarity, those often suffer from scalability and efficiency issues. On the other hand, change-proneness (CP), recently emerged as an efficient and scalable alternative metric, has only been applied at class level. To accurately identify fault-revealing test cases, we propose CP at finer-grained method-level and implement Method-level Change-proneness based Test-suite Minimization (MCTM). MCTM first calculates CP for each method from version control metadata, then determines the dependency between test cases and methods by analyzing the test-code call-graph. Next, it scores the association between test cases and their invoked methods using statistical measures such as Average, Geometric Mean etc. Finally, test cases with the highest scores are selected to form the reduced suite. Evaluation on 15 open-source Java projects with 635 buggy versions shows MCTM achieves 0.93 accuracy and 0.94 fault detection rate on average, significantly outperforming class-level CP and similarity-based approaches while maintaining superior efficiency.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑