paperbot · PL 论文追踪

全部论文 待读 收藏

P2 EvoSpex: An Evolutionary Algorithm for Learning Postconditions

EvoSpex:一种学习后置条件的进化算法
ICSE 2021 IEEE/ACM 43rd International Conference on Software Engineering (ICSE)2021匹配度 3/10 · 该论文属于自动推断后置条件/程序规约的程序合成工作,与形式化验证和程序分析有间接关联;但它使用遗传算法而非 LLM/Agent,也不涉及浮点程序分析或贝叶斯程序分析,未命中研究画像的核心交叉方向。因此匹配度较低,仅可存档。引用 40 inbox
Facundo Molina, Pablo Ponzio, Nazareno Aguirre, Marcelo Frias
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出 EvoSpex,用遗传算法从方法执行与变异的前后状态对中自动学习 Java 方法后置条件断言。

软件可靠性依赖对预期行为的规约,但许多 Java 方法缺少断言式规约,或仅有测试附带的场景特定断言。本文提出 EvoSpex:针对参考式类实现的方法,先执行方法获得合法前/后状态对,再变异这些状态对以产生疑似非法对,然后用遗传算法合成后置条件断言,使其满足合法对并排除非法对。作者在开源 Java 项目基准上评估,并用自动 oracle 评估工具与相关方法比较。结果表明,EvoSpex 生成的后置条件更强、更准确,还能推断已验证类中人工编写丰富后置条件的重要部分,并为由规约自动合成实现的方法重现契约。

问题
许多 Java 方法缺少后置条件规约,现有断言多只覆盖测试中的特定场景,削弱了软件可靠性分析能力。
方法
执行待分析 Java 方法收集合法前/后状态对,变异得到疑似非法对,再用遗传算法学习满足合法对并排除非法对的后置条件断言,主要面向参考式类实现。
评估
在开源 Java 项目基准上,使用自动 oracle 评估工具与相关自动方法比较,并通过推断人工后置条件和自动合成实现契约来评估效果。
原文摘要(Abstract)

Software reliability is a primary concern in the construction of software, and thus a fundamental component in the definition of software quality. Analyzing software reliability requires a specification of the intended behavior of the software under analysis, and at the source code level, such specifications typically take the form of assertions. Unfortunately, software many times lacks such specifications, or only provides them for scenario-specific behaviors, as assertions accompanying tests. This issue seriously diminishes the analyzability of software with respect to its reliability. In this paper, we tackle this problem by proposing a technique that, given a Java method, automatically produces a specification of the method's current behavior, in the form of postcondition assertions. This mechanism is based on generating executions of the method under analysis to obtain valid pre/post state pairs, mutating these pairs to obtain (allegedly) invalid ones, and then using a genetic algorithm to produce an assertion that is satisfied by the valid pre/post pairs, while leaving out the invalid ones. The technique, which targets in particular methods of reference-based class implementations, is assessed on a benchmark of open source Java projects, showing that our genetic algorithm is able to generate post-conditions that are stronger and more accurate, than those generated by related automated approaches, as evaluated by an automated oracle assessment tool. Moreover, our technique is also able to infer an important part of manually written rich postconditions in verified classes, and reproduce contracts for methods whose class implementations were automatically synthesized from specifications.

链接与引用

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

BibTeX
@inproceedings{abs-2102-13569,
  title = {EvoSpex: An Evolutionary Algorithm for Learning Postconditions},
  author = {Facundo Molina and Pablo Ponzio and Nazareno Aguirre and Marcelo Frias},
  booktitle = {ICSE},
  year = {2021},
  doi = {10.1109/icse43902.2021.00112}
}