paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Random Testing via Runtime Abstract Interpretation

通过运行时抽象解释进行随机测试
OOPSLA 10(OOPSLA2)2026匹配度 3/10 · 论文属于程序分析与抽象解释/随机测试,提出运行时抽象解释来生成复杂前置条件的输入;但未涉及 LLM/Agent、浮点程序分析或贝叶斯程序分析,也未讨论静态分析在 ML/Agentic 程序中的应用,因此与画像的核心交叉方向仅有间接的 PL 技术关联。引用 1 inbox
Zain K Aamer, Benjamin C. Pierce
crossref: 2026-10-02

AI 速览

一句话:把随机输入生成重构为抽象域元素的迭代精化,用运行时抽象解释实现轻量约束求解与传播,从而对复杂前置条件的 C 程序做随机测试。

基于属性的 C 程序测试可由分离逻辑规范自动合成随机输入生成器,但现有工具 Bennet 的随机回溯搜索在指针算术等复杂约束下难以求解。本文把生成重构为抽象域元素的迭代精化,采样具体值即最后一步精化:运行时做抽象解释得到抽象元素,从而获得轻量的约束求解与传播。作者提出推测式精化、纠正式精化与级联传播三种策略,并在单子语义以抽象域为参数的生成器 DSL 中形式化,实现工具 Lucas。在十六个工作负载(Bennet 的六个案例、六个位置无关数据结构、四个空闲链表分配器)上,精化配置在四个分配器和两个位置无关数据结构中发现了 Bennet 式随机回溯遗漏的缺陷。

问题
如何从分离逻辑规范自动合成随机输入生成器,以对 C 程序进行基于属性的随机测试,尤其是当前置条件复杂、涉及指针算术(如各类专用存储分配器)时,现有随机回溯搜索难以满足约束。
方法
将生成视为抽象域元素的迭代精化,采样具体值是精化的最后一步;在运行时施加抽象解释以获得轻量的约束求解与信息传播,并提出推测式精化、纠正式精化与级联传播三种策略。这些思想被形式化在一个单子语义以抽象域为参数的生成器 DSL 中,并实现为工具 Lucas。
评估
在十六个工作负载(Bennet 原文的六个案例、六个位置无关数据结构、四个 free-list 分配器)上对比启用与不启用精化的配置,结果显示精化在全部四个分配器以及两个位置无关数据结构中发现了 Bennet 式随机回溯无法发现的缺陷。
原文摘要(Abstract)

Property-based testing of C programs can be automated by synthesizing random input generators from separation-logic specifications. Existing work in this space, such as the Bennet testing tool, uses randomized backtracking search, generating random values and checking them against constraints, backtracking on failure. Although this approach performs well on simple recursive heap structures, it struggles as constraints grow more complex, particularly when they involve pointer arithmetic—as, for example, in the many forms of specialized storage allocators that arise in low-level systems software. Existing work uses targeted optimizations and heuristics to satisfy specific classes of constraints, but this requires continual expansion as new special cases arise, resulting in complex tools. We reframe generation as the iterative refinement of abstract domain elements, where sampling a concrete value is the final refinement. By applying abstract interpretation at runtime to obtain an abstract element, we obtain a lightweight form of constraint solving and propagation that enables randomized testing of programs with complex preconditions. We identify three strategies for applying abstract interpretation: (1) speculative refinement, refining abstract elements before sampling based on immediately following constraints, (2) corrective refinement, calculating “desired” abstract elements from information gleaned from failed constraints, and (3) cascading propagation, propagating information from failures to components of compound expressions. We formalize these ideas in a generator DSL whose monadic semantics are parametric over abstract domains. We implement this DSL in a new tool called Lucas and evaluate it on sixteen workloads: the six original case studies from the Bennet paper, six position-independent data structures, and four free-list allocators. Comparing configurations with and without refinement, we find that refinement finds bugs in all four allocators and in two of the position-independent data structures that Bennet-style random backtracking fails to find.

链接与引用

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

BibTeX
@article{paperbot12099,
  title = {Random Testing via Runtime Abstract Interpretation},
  author = {Zain K Aamer and Benjamin C. Pierce},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {10},
  number = {OOPSLA2},
  year = {2026},
  doi = {10.1145/3839513}
}