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

自动学习测试用例故障诊断能力的精确度量

Automatically Learning a Precise Measurement for Fault Diagnosis Capability of Test Cases

Yifan Zhao, Zeyu Sun, Guoqing Wang, Qingyuan Liang, Yakun Zhang, Yiling Lou, Dan Hao, Lu Zhang

AI总结:

本文提出基于强化学习的结果无关度量RLFDC,利用故障定位反馈自动学习测试用例的故障诊断能力,并在Defects4J上验证其在测试选择与生成中优于现有结果无关度量。

摘要:

主流的故障定位(FL)技术依赖测试来定位有缺陷的程序元素。测试可被视为通过提供更多调试信息来进一步增强FL的燃料。因此,度量一个测试在诊断故障方面的故障诊断能力(FDC)具有很高价值,以便选择或生成测试来更好地辅助FL。为此,研究人员提出了许多FDC度量,它们作为面向FL的测试选择中的选择标准或面向FL的测试生成中的适应度函数。现有的FDC度量根据是否将测试结果(即通过或失败)作为输入,可分为结果无关度量和结果相关度量。尽管结果相关度量在测试选择中表现更好,但由于需要测试结果作为输入,其应用受到限制,例如它们无法用于指导测试生成。此外,所有现有的FDC度量都是基于一些预定义的启发式规则设计的,由于其不准确性,取得的FL性能有限。为了解决这些问题,在本文中,我们重新审视结果无关度量,并提出一种新颖的结果无关度量RLFDC,它通过强化学习预测测试的FDC值。具体而言,我们将FL结果视为奖励信号,并利用直接的FL反馈训练FDC预测模型,以自动学习更精确的度量,而不是基于预定义启发式规则来设计度量。最后,我们通过将所研究的度量应用于测试选择和生成,在Defects4J上评估了所提出的RLFDC。实验结果表明,所提出的RLFDC在测试选择和生成两方面均优于所有结果无关度量。

英文摘要:

Prevalent Fault Localization (FL) techniques rely on tests to localize buggy program elements. Tests could be treated as fuel to further boost FL by providing more debugging information. Therefore, it is highly valuable to measure the Fault Diagnosis Capability (FDC) of a test for diagnosing faults, so as to select or generate tests to better help FL. To this end, researchers have proposed many FDC metrics, which serve as the selection criterion in FL-oriented test selection or the fitness function in FL-oriented test generation. Existing FDC metrics can be classified into result-agnostic and result-aware metrics depending on whether they take test results (i.e., passing or failing) as input. Although result-aware metrics perform better in test selection, they have restricted applications due to the input of test results, e.g., they cannot be applied to guide test generation. Moreover, all the existing FDC metrics are designed based on some predefined heuristics and have achieved limited FL performance due to their inaccuracy. To address these issues, in this paper, we reconsider result-agnostic metrics, and propose a novel result-agnostic metric RLFDC which predicts FDC values of tests through reinforcement learning. In particular, we treat FL results as reward signals, and train an FDC prediction model with the direct FL feedback to automatically learn a more accurate measurement rather than design one based on predefined heuristics. Finally, we evaluate the proposed RLFDC on Defects4J by applying the studied metrics to test selection and generation. According to the experimental results, the proposed RLFDC outperforms all the result-agnostic metrics in both test selection and generation.

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

↑