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

NeuroFlake:一种用于故障测试分类的神经符号LLM框架

NeuroFlake: A Neuro-Symbolic LLM Framework for Flaky Test Classification

Institute of Information Technology, University of Dhaka(达卡大学信息技术学院)

Khondaker Tasnia Hoque, Toukir Ahammed

AI总结:

本文提出NeuroFlake框架,通过结合神经网络与符号方法,提升故障测试分类的鲁棒性与泛化能力,实验表明其在F1-score上优于现有方法。

摘要:

flaky tests,即在相同代码版本下表现出非确定性通过/失败行为,对可靠的回归测试构成重大挑战。尽管大型语言模型(LLMs)被承诺用于自动flaky测试分类,但它们往往无法理解测试flakiness背后的实际逻辑,而是过度拟合表面文本特征(例如特定变量名)。这种语义脆弱性导致在现实世界不平衡数据集上的泛化能力差且易受扰动影响。本文我们引入NeuroFlake,一种新的神经符号框架,用于在高度不平衡、现实世界数据集(FlakeBench)上分类flaky tests。不同于以往依赖脆弱手动规则和黑盒学习的方法,NeuroFlake集成了判别性令牌挖掘(DTM)模块,以自动化发现高保真度、统计显著的源代码令牌(例如特定并发原语或异步等待)。通过将这些强潜在信号直接注入LLM的注意力机制中,我们弥合了神经直觉与符号精确性之间的差距。我们的实验表明,神经符号融合通过利用分类F1-score提升至69.34%,而先前最先进方法的最佳F1-score为65.79%。然而,我们通过对抗性压力测试严格评估NeuroFlake的鲁棒性,引入语义保持增强(例如死代码注入、变量重命名)。虽然基线模型在扰动测试上表现下降8-18个百分点(pp),但NeuroFlake在未见过的增强上保持性能稳定,仅下降4-7 pp。

英文摘要:

Flaky tests, which exhibit non-deterministic pass/fail behavior for the same version of code, pose significant challenges to reliable regression testing. While large language models (LLMs) promise for automated flaky test classification, they often fail to comprehend the actual logic behind test flakiness, instead overfitting to superficial textual artifacts (e.g., specific variable names). This semantic fragility leads to poor generalization on real-world imbalance dataset and vulnerability to perturbations. In this paper, we introduce NeuroFlake, a novel neuro-Symbolic framework for classifying flaky tests on highly imbalanced, real-world datasets (FlakeBench). Unlike prior approaches that rely on brittle manual rule and black box learning, NeuroFlake integrates a Discriminative Token Mining (DTM) module to automate the discovery of high-fidelity, statistically significant source code tokens (e.g., specific concurrency primitives or async waits). By injecting these strong latent signals directly into LLM's attention mechanism, we bridge the gap between neural intuition and symbolic precision. Our experiments demonstrate that neuro-symbolic fusion significantly improves classification performance by leveraging classification F1-score to 69.34% while prior state-of-art shows best F1-score 65.79%. However, we rigorously evaluate NeuroFlake's robustness through adversarial stress testing, introducing semantic preserving augmentations (e.g., dead code injection, variable renaming). While baseline models exhibit performance degradation of 8-18 percentage points (pp) on perturbed tests, NeuroFlake maintains performance stability on unseen augmentations dropping only 4-7 pp.

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

↑