paperbot · PL 论文追踪

全部论文 待读 收藏

TDRepro: A Neurosymbolic Approach to Reproducing Timing-Dependent Flaky Test Failures

TDRepro:一种复现时序相关不稳定测试失败的神经符号方法
ASE Proceedings of the 41st IEEE/ACM International Conference on Automated Software Engineering2026引用 0 inbox
Shanto Rahman, Talank Baral, August Shi, Wing Lam
crossref: 2026-10-09

AI 速览

一句话:结合LLM与程序分析,高效复现时序相关的不稳定测试失败,显著优于现有方法。

时序相关(TD)不稳定测试的失败依赖稀有的线程交错,即使在相同代码版本上多次运行也难以复现,现有基于延迟注入搜索的方法开销较大。TDRepro 将大语言模型与程序分析相结合:首先收集测试运行中执行的方法,筛选出与其他方法并发执行的相关方法;然后根据方法代码与观测失败日志的嵌入相似度对这些方法排序;最后由 LLM 在排名靠前的方法中识别候选延迟注入位置,并通过注入延迟、重跑测试来验证,根据失败尝试迭代精化候选位置,直到复现目标失败或达到最大迭代次数。作者在来自开源 Java Maven 项目的 25 个模块的 82 个 TD 测试上评估 TDRepro。结果显示,其复现失败数量比此前最先进的 FlakeRake 多 100%,复现更可靠:55 个测试的失败复现率超过 99%,而 FlakeRake 仅 30 个;反复复现失败所需时间分别比反复重跑测试和 FlakeRake 少 1482.1 倍和 10.4 倍,成本分别少 888.4 倍和 9.6 倍。

问题
时序相关的不稳定测试失败依赖稀有线程交错,难以稳定复现,现有延迟注入搜索方法代价高。
方法
TDRepro 结合程序分析与 LLM:筛选并发执行的相关方法,按代码与失败日志的嵌入相似度排序,再由 LLM 推荐延迟注入位置,并通过注入延迟、重跑测试迭代精化候选位置。
评估
在来自 25 个开源 Java Maven 模块的 82 个 TD 测试上评估,并与 FlakeRake 及反复重跑测试对比复现率、时间和成本。
原文摘要(Abstract)

Tests that nondeterministically pass or fail on the same version of code are known as flaky tests, and their failures substantially hinder regression testing and debugging. Reproducing failures from timing-dependent (TD) flaky tests is particularly challenging because these failures depend on rare thread interleavings that may not occur even after running the test many times. Prior approaches reproduce such failures by searching for locations at which to inject delays during execution, but this search process can be expensive. We present TDRepro, an automated approach that leverages large-language models (LLMs) and program analysis to efficiently reproduce TD-test failures. TDRepro first identifies relevant methods by collecting executed methods during the test run and identifying those that execute concurrently with other methods. It then ranks these methods by computing the embedding similarity between each method’s code and the observed failure log. Finally, TDRepro uses an LLM to identify candidate locations for delay injection within the top-ranked methods. TDRepro validates these candidates by injecting delays and rerunning the test, iteratively refining the candidate locations based on unsuccessful attempts until the target failure is reproduced or the maximum number of iterations is reached. We evaluate TDRepro on 82 TD tests across 25 modules from open-source Java Maven projects. TDRepro reproduces 100% more failures than the prior state-of-the-art approach, FlakeRake, and achieves more reliable reproduction, with 55 tests reaching a failure reproduction rate of >99%, compared with 30 tests for FlakeRake. Repeatedly reproducing failures with TDRepro requires 1482.1× and 10.4× less time and costs 888.4× and 9.6× less than repeatedly rerunning tests and using FlakeRake, respectively.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot12462,
  title = {TDRepro: A Neurosymbolic Approach to Reproducing Timing-Dependent Flaky Test Failures},
  author = {Shanto Rahman and Talank Baral and August Shi and Wing Lam},
  booktitle = {ASE},
  year = {2026},
  doi = {10.1145/3832783.3834384}
}