paperbot · PL 论文追踪

全部论文 待读 收藏

P2 EvoSpex: A Search-Based Tool for Postcondition Inference

EvoSpex:一种基于搜索的后置条件推断工具
ISSTA Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis2023匹配度 3/10 · 该论文属于基于进化算法的后置条件推断与程序合成,虽与形式化验证/规约推断有间接关联,但不涉及用户核心关注的 LLM/Agent 与静态分析交叉、浮点程序分析或贝叶斯程序分析。引用 1 inbox
Facundo Molina, Pablo Ponzio, Nazareno Aguirre, Marcelo F. Frias
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出基于进化算法的工具 EvoSpex,从测试用例自动推断 Java 方法的后置条件。

后置条件刻画程序终止时的状态性质,能提升多种软件可靠性分析,但源码中往往缺失。针对这一问题,本文以工具演示形式提出 EvoSpex:给定目标 Java 方法及其测试套件,先执行测试获得有效的前/后状态对,再对这些状态对进行变异以得到(假定的)无效状态对;随后用经典遗传算法在类 JML 规约语言空间中搜索候选后置条件断言,使其接受有效状态对、排除无效状态对。适应度函数同时衡量对有效状态对的精确刻画、对无效状态对的拒绝能力,并偏好更简洁的断言。该工具实现了后置条件的自动推断,可辅助开发者编写规约。

问题
程序的后置条件对可靠性分析很有价值,但开发者很少在源码中提供,缺乏自动化推断手段。
方法
执行测试得到有效前/后状态对,并将其变异为无效状态对;用遗传算法在类 JML 规约语言中搜索兼顾有效状态对、拒绝无效状态对且更简洁的后置条件断言。
评估
以工具演示形式呈现,通过针对目标 Java 方法及其测试套件执行推断流程来展示 EvoSpex 的能力。
原文摘要(Abstract)

Postconditions are predicates that specify the intended behavior of a program by capturing properties about the program state when the program finishes its execution. Although postconditions can help to improve many software reliability analyses, they are seldom found accompanying source code. Thus, tools that assist developers in specifying postconditions are useful. This tool demo paper presents EvoSpex, a tool based on evolutionary computation that automatically infers postconditions of Java methods. Given a target Java method and a test suite for it, our tool executes the test suite to obtain valid pre/post state pairs for the method under analysis. Then, these pairs are mutated to obtain (allegedly) invalid ones, and finally a postcondition assertion characterizing the current method behavior is produced, by using an evolutionary algorithm that searches for an assertion that is satisfied by the valid pre/post state pairs and leaves out the invalid ones. EvoSpex implements a classic genetic algorithm that explores the space of candidate postconditions over a JML-like specification language. The algorithm is guided by a fitness function that aims at precisely capturing the valid state pairs, rejecting the invalid ones, and that also favors more succinct assertions.

链接与引用

DOI 原文 · DBLP

BibTeX
@inproceedings{MolinaPAF23,
  title = {EvoSpex: A Search-Based Tool for Postcondition Inference},
  author = {Facundo Molina and Pablo Ponzio and Nazareno Aguirre and Marcelo F. Frias},
  booktitle = {ISSTA},
  year = {2023},
  doi = {10.1145/3597926.3604928}
}