paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Systematically Producing Test Orders to Detect Order-Dependent Flaky Tests

系统化生成测试顺序以检测顺序依赖的 flaky 测试
ISSTA Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis2023匹配度 1/10 · 该论文研究软件测试中顺序依赖 flaky 测试的检测与测试顺序生成,属于软件工程/测试领域,与用户关注的 PL 与 AI 交叉、静态分析、浮点程序分析、贝叶斯程序分析以及 LLM/Agent 等方向没有直接关联。引用 14 inbox
Chengpeng Li, M. Mahdi Khosravi, Wing Lam, August Shi
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出三种系统化生成测试顺序的技术,以更完整地检测顺序依赖的 flaky 测试,最高效技术可检出 97.2% 的已知用例。

顺序依赖测试(OD 测试)的通过或失败取决于执行顺序,随机重跑无法保证检测所有此类 flaky 测试。本文提出三种系统化生成测试顺序的技术:基于 Tuscan squares 在最少测试顺序中覆盖测试对,同时遵守测试类对测试位置的约束;并针对指定测试对集合生成专门顺序。作者在 47 个开源项目测试套件、289 个已知 OD 测试上评估。最具成本效益的技术平均每个对象使用 104.7 个测试顺序,可检出 97.2% 的已知 OD 测试;分析还表明检测所需的最小测试顺序集合远小于实际使用量,为后续优先级排序提供机会。

问题
顺序依赖的 flaky 测试仅在特定前置测试执行或不执行时表现出不同结果,随机顺序重跑不能保证检测全部 OD 测试,现有系统化方法也未充分考虑测试套件中所有测试间的关系。
方法
利用 Tuscan squares 在满足测试类位置约束的前提下覆盖测试对并生成最小测试顺序,并支持根据给定测试对集合定向生成测试顺序。
评估
在 47 个开源项目测试套件的 289 个已知 OD 测试上评估;最具成本效益的技术平均每对象使用 104.7 个测试顺序并检出 97.2% 的已知 OD 测试,同时分析了检测所需的最小测试顺序集合。
原文摘要(Abstract)

Software testing suffers from the presence of flaky tests, which can pass or fail when run on the same version of code. Order- dependent tests (OD tests) are flaky tests whose outcome depends on the order in which they are run. An OD test can be detected if specific tests are run or not run before it, resulting in a difference in test outcome. While prior work has proposed rerunning tests in different random test orders, this approach does not provide guarantees toward detecting all OD tests. Later work that proposed a more systematic approach to ordering tests still fails to account for the relationships between all tests in the test suite. We propose three new techniques to detect OD tests through a more systematic means of producing test orders. Our techniques build upon prior work in Tuscan squares to cover test pairs in a minimal set of test orders while also obeying the constraints of how tests can be positioned in a test order w.r.t. their test classes. Further, as there are many test pairs that need to be covered, we develop a technique that can take a specified set of test pairs to cover and produce test orders that aim to cover just those test pairs. Our evaluation with 289 known OD tests across 47 test suites from open-source projects shows that our most cost-effective technique can detect 97.2% of the known OD tests with 104.7 test orders, on average, per subject. While all techniques produce a relatively large number of test orders, our analysis of the minimal set of test orders needed to detect OD tests shows a tremendous reduction in the test orders needed to detect OD tests – representing an opportunity for future work to prioritize test orders.

链接与引用

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

BibTeX
@inproceedings{LiKLS23,
  title = {Systematically Producing Test Orders to Detect Order-Dependent Flaky Tests},
  author = {Chengpeng Li and M. Mahdi Khosravi and Wing Lam and August Shi},
  booktitle = {ISSTA},
  year = {2023},
  doi = {10.1145/3597926.3598083}
}