Lune

ICSE2021Top-tier venue

EvoSpex: An Evolutionary Algorithm for Learning Postconditions

Facundo Molina, Pablo Ponzio, Nazareno Aguirre, Marcelo F. Frias

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.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

12 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • SpecGen: Automated Generation of Formal Program Specifications via Large Language Models cites Fuzzing Class Specifications
  • Can Large Language Models Transform Natural Language Intent into Formal Method Postconditions? cites TOGA: A Neural Method for Test Oracle Generation
  • AGORA: Automated Generation of Test Oracles for REST APIs cites TOGA: A Neural Method for Test Oracle Generation
  • AGORA: Automated Generation of Test Oracles for REST APIs cites Fuzzing Class Specifications
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers12

  1. TOGA: A Neural Method for Test Oracle GenerationElizabeth Dinella, Gabriel Ryan, Todd Mytkowicz, Shuvendu K. LahiriICSE 2022 · 92 citations
  2. Can Large Language Models Transform Natural Language Intent into Formal Method Postconditions?Madeline Endres, Sarah Fakhoury, Saikat Chakraborty, Shuvendu K. LahiriFSE 2024 · 27 citations
  3. Fuzzing Class SpecificationsFacundo Molina, Marcelo d'Amorim, Nazareno AguirreICSE 2022 · 25 citations
  4. SpecGen: Automated Generation of Formal Program Specifications via Large Language ModelsLezhi Ma, Shangqing Liu, Yi Li, Xiaofei Xie et al.ICSE 2025 · 25 citations
  5. AGORA: Automated Generation of Test Oracles for REST APIsJuan C. Alonso, Sergio Segura, Antonio Ruiz-CortésISSTA 2023 · 15 citations

Related papers

  1. Evolutionary improvement of assertion oraclesValerio Terragni, Gunel Jahangirova, Paolo Tonella, Mauro PezzèFSE 2020 · 50 citations
  2. Behavioral simulation for smart contractsSidi Mohamed Beillahi, Gabriela F. Ciocarlie, Michael Emmi, Constantin EneaPLDI 2020 · 15 citations
  3. C2S: translating natural language comments to formal program specificationsJuan Zhai, Yu Shi, Minxue Pan, Guian Zhou et al.FSE 2020 · 44 citations
  4. State Field Coverage: A Metric for Oracle QualityFacundo Molina, Nazareno Aguirre, Alessandra GorlaASE 2025 · 1 citation
  5. Abstraction-Aware Inference of Metamorphic RelationsAgustín Nolasco, Facundo Molina, Renzo Degiovanni, Alessandra Gorla et al.FSE 2024 · 4 citations
Dusk over the sea between two cliffs drawn in fine vertical lines