paperbot · PL 论文追踪

全部论文 待读 收藏

P2 PYURIFY: Purifying Python Tests for Precise Fault Localization

PYURIFY:净化 Python 测试以实现精确故障定位
FSE Proceedings of the 34th ACM International Conference on the Foundations of Software Engineering2026匹配度 2/10 · 该论文关注 Python 测试净化和统计故障定位,虽属于程序分析与调试领域,但不涉及用户核心关注的静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析。其动态切片仅作为测试净化手段,与用户研究画像中的 PL→AI 或 AI→PL 方向关联较弱。引用 0 inbox
Marius Smytzek, Andreas Zeller
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出 PYURIFY,通过原子化与动态切片净化 Python 测试,提升统计故障定位精度。

统计故障定位(SFL)利用测试覆盖来排序可疑程序元素,但当测试包含多个断言或与故障无关的代码时,测试结果与故障代码之间的关联会被掩盖,导致定位精度较低。测试用例净化通过将复杂测试转换为简化的单断言变体来缓解该问题。本文提出 PYURIFY,一个为 Python 实现测试用例净化的工具,包含两个步骤:首先,原子化将含多个断言的测试拆分为多个单断言测试;其次,动态程序切片移除与每个断言无关的代码。该净化过程产生更干净的测试谱,使 SFL 技术能更准确地定位故障代码。PYURIFY 同时提供命令行界面与 Python API,便于与现有测试及故障定位工作流集成。在真实 Python 缺陷上的评估表明,测试用例净化能持续提升故障定位的准确性。

问题
统计故障定位在测试包含多断言或大量无关代码时精度较低,因为测试结果与故障代码之间的关联被掩盖。
方法
PYURIFY 对 Python 测试执行两步净化:原子化把多断言测试拆成单断言测试,再用动态程序切片移除与各断言无关的代码,从而生成更干净的测试谱。
评估
在真实 Python 缺陷上进行评估,结果表明测试用例净化能持续提升故障定位的准确性。
原文摘要(Abstract)

Statistical fault localization (SFL) techniques use test coverage to rank suspicious program elements. However, they often suffer from low precision when tests contain multiple assertions or unrelated code that obscures the relationship between test outcomes and faulty code. Test case purification addresses this problem by transforming complex test cases into simplified, single-assertion variants. We present PYURIFY, a tool that implements test case purification for Python through two steps: first, atomization splits each test with multiple assertions into separate single-assertion tests; second, dynamic program slicing removes code irrelevant to each assertion. This purification process produces cleaner test spectra, enabling SFL techniques to pinpoint faulty code more accurately. PYURIFY provides both a command-line interface and a Python API for seamless integration with existing testing and fault localization workflows. Our evaluation of real Python bugs demonstrates that test case purification consistently improves fault localization accuracy.

链接与引用

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

BibTeX
@inproceedings{SmytzekZ26,
  title = {PYURIFY: Purifying Python Tests for Precise Fault Localization},
  author = {Marius Smytzek and Andreas Zeller},
  booktitle = {FSE},
  year = {2026},
  doi = {10.1145/3803437.3806433}
}