EvoSpex: An Evolutionary Algorithm for Learning Postconditions
Facundo Molina,Pablo Ponzio,Nazareno Aguirre,Marcelo F. Frias +3 more
- 22 May 2021
- pp 1223-1235
TL;DR: In this paper, the authors propose a technique that, given a Java method, automatically produces a specification of the method's current behavior, in the form of postcondition assertions, which is based on generating executions of a 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.
read more
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.
read more
Chat with Paper
AI Agents for this Paper
Find similar papers on Google Scholar, PubMed and Arxiv
Write a critical review of this paper
Analyze citations of this paper to find unaddressed research gaps
Citations
Toga
21 May 2022
TL;DR: TOGA as discussed by the authors is a transformer-based neural approach to infer exceptional and assertion test oracles based on the context of the focal method, which can handle ambiguous or missing documentation, and even units with a missing implementation.
Fuzzing Class Specifications
F. Z. Molina,Marcelo d’Amorim,Nazareno Aguirre +2 more
- 26 Jan 2022
TL;DR: The results show that SPECFUZZER can easily support a more expressive assertion language, over which is more effective than GAssert and EvoSpex in inferring specifications, according to standard performance metrics.
Can Large Language Models Transform Natural Language Intent into Formal Method Postconditions?
Madeline Endres,Sarah Fakhoury,Saikat Chakraborty,Shuvendu K. Lahiri +3 more
- 12 Jul 2024
TL;DR: This study investigates the potential of Large Language Models (LLMs) to transform natural language intent into formal method postconditions, finding that LLMs can generate correct and discriminative postconditions, with potential to improve fault localization and code trustworthiness.
Survey of annotation generators for deductive verifiers
Sophie Lathouwers,Marieke Huisman +1 more
TL;DR: This paper surveys annotation generators for deductive verifiers, evaluating their approaches, advantages, and disadvantages, and identifying ideal features for specification inference tools to improve the deductive verification of Java programs.
4
References
•Book
An axiomatic basis for computer programming
C. A. R. Hoare
- 01 Jan 2002
TL;DR: In this article, the logical foundations of computer programming are explored by using techniques first applied in the study of geometry and later extended to other branches of mathematics, and a formal proof of a simple theorem is displayed.
3.3K
Applying 'design by contract'
TL;DR: Methodological guidelines for object-oriented software construction that improve the reliability of the resulting software systems are presented and the theory of contract design and the role of assertions in that theory are discussed.
•Book
Software Abstractions: Logic, Language, and Analysis
Daniel Jackson
- 01 Jan 2006
TL;DR: This revised edition of Software Abstractions updates the text, examples, and appendixes to be fully compatible with the latest version of Alloy, a language that captures the essence of software abstractions simply and succinctly, using a minimal toolkit of mathematical notions.
Assigning Meanings to Programs
Robert W. Floyd
- 01 Jan 1993
TL;DR: This paper attempts to provide an adequate basis for formal definitions of the meanings of programs in appropriately defined programming languages, in such a way that a rigorous standard is established for proofs about computer programs, including proofs of correctness, equivalence, and termination.
1.5K
Object-oriented software construction
Bertrand Meyer
- 01 Jan 1997
TL;DR: In this paper, the authors present a comprehensive reference on all aspects of object technology, from design principles to object-oriented techniques, Design by Contract, Object-Oriented analysis, concurrency, persistence, abstract data types and many more.
1.3K