一句话:提出 DEFACC,以扩散生成和 MMD 特征对齐缓解 CC 样本稀疏与不平衡,提升检测与故障定位。
巧合正确性(CC)指测试用例执行故障代码却仍产生预期输出,会给测试套件约简、优先级排序、故障定位和自动程序修复引入噪声。但单个程序内 CC 样本通常稀疏,Defects4J V1.4 中仅占 3.27%–31.74%,类别高度不平衡,检测困难。论文提出 DEFACC:先用扩散生成模块从原始样本合成新 CC 样本,缓解不平衡并增强多样性;再用基于最大均值差异(MMD)损失的特征对齐模块,约束生成样本与真实 CC 样本分布一致,使增强样本既数量平衡又语义可信。实验表明,DEFACC 显著提升现有 CC 检测方法性能,并为准确故障定位提供更强表示基础。
Coincidental correctness (CC) refers to test cases that execute faulty code but still produce excepted outputs. This phenomenon introduces noise into the data of software testing-related tasks. As demonstrated in the literature, CC has negative impact on test suite reduction, test case prioritization, fault localization, and automated program repair. Thus, it is essential to detect and mitigate the impact of CC. Although CC is commonly observed across a large number of programs, CC test cases are typically sparse within each program’s test suite. In other words, CC test cases generally make up merely a small portion of the passing test cases. The proportions vary from 3.27% to 31.74% within Defects4J V1.4. This results in a highly imbalanced distribution of CC versus non-CC test cases, posing challenges for accurate detection.To address this issue, we propose a Diffusion-Enhanced and Feature-Aligned Framework for Coincidental Correctness detection, named DEFACC, to obtain more structured representations of test cases. Specifically, DEFACC first introduces a diffusion-based generation module. This module generates new CC samples from original samples to alleviate class imbalance issue and enhance the diversity of CC samples. However, generated feature samples may deviate from the distribution of real CC samples. Such shifts can hurt model reliability and generalization. To resolve this, DEFACC integrates a feature alignment module that is founded on the Maximum Mean Discrepancy (MMD) loss. This module enforces distributional consistency between generated and original CC samples during training. Together, these components ensure that the augmented samples are from sparse to structured, which is not only quantitatively balanced but also semantically faithful. Experimental results show that the DEFACC significantly improves the performance of existing CC detection methods and provides a stronger representation foundation for accurate fault localization.
DOI 原文 ·
@inproceedings{paperbot9468,
title = {From Sparse to Structured: A Diffusion-Enhanced and Feature-Aligned Framework for Coincidental Correctness Detection},
author = {Huan Xie and Chunyan Liu and Yan Lei and Zhenyu Wu and Jinping Wang},
booktitle = {ASE},
year = {2025},
doi = {10.1109/ase63991.2025.00041}
}