Tratto: A Neuro-Symbolic Approach to Deriving Axiomatic Test Oracles

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Molinelli, Davide, Martin-Lopez, Alberto, Zackrone, Elliott, Eken, Beyza, Ernst, Michael D., Pezzè, Mauro
Formato: Preprint
Publicado: 2025
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866917994030956544
author Molinelli, Davide
Martin-Lopez, Alberto
Zackrone, Elliott
Eken, Beyza
Ernst, Michael D.
Pezzè, Mauro
author_facet Molinelli, Davide
Martin-Lopez, Alberto
Zackrone, Elliott
Eken, Beyza
Ernst, Michael D.
Pezzè, Mauro
contents This paper presents Tratto, a neuro-symbolic approach that generates assertions (boolean expressions) that can serve as axiomatic oracles, from source code and documentation. The symbolic module of Tratto takes advantage of the grammar of the programming language, the unit under test, and the context of the unit (its class and available APIs) to restrict the search space of the tokens that can be successfully used to generate valid oracles. The neural module of Tratto uses transformers fine-tuned for both deciding whether to output an oracle or not and selecting the next lexical token to incrementally build the oracle from the set of tokens returned by the symbolic module. Our experiments show that Tratto outperforms the state-of-the-art axiomatic oracle generation approaches, with 73% accuracy, 72% precision, and 61% F1-score, largely higher than the best results of the symbolic and neural approaches considered in our study (61%, 62%, and 37%, respectively). Tratto can generate three times more axiomatic oracles than current symbolic approaches, while generating 10 times less false positives than GPT4 complemented with few-shot learning and Chain-of-Thought prompting.
format Preprint
id arxiv_https___arxiv_org_abs_2504_04251
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Tratto: A Neuro-Symbolic Approach to Deriving Axiomatic Test Oracles
Molinelli, Davide
Martin-Lopez, Alberto
Zackrone, Elliott
Eken, Beyza
Ernst, Michael D.
Pezzè, Mauro
Software Engineering
This paper presents Tratto, a neuro-symbolic approach that generates assertions (boolean expressions) that can serve as axiomatic oracles, from source code and documentation. The symbolic module of Tratto takes advantage of the grammar of the programming language, the unit under test, and the context of the unit (its class and available APIs) to restrict the search space of the tokens that can be successfully used to generate valid oracles. The neural module of Tratto uses transformers fine-tuned for both deciding whether to output an oracle or not and selecting the next lexical token to incrementally build the oracle from the set of tokens returned by the symbolic module. Our experiments show that Tratto outperforms the state-of-the-art axiomatic oracle generation approaches, with 73% accuracy, 72% precision, and 61% F1-score, largely higher than the best results of the symbolic and neural approaches considered in our study (61%, 62%, and 37%, respectively). Tratto can generate three times more axiomatic oracles than current symbolic approaches, while generating 10 times less false positives than GPT4 complemented with few-shot learning and Chain-of-Thought prompting.
title Tratto: A Neuro-Symbolic Approach to Deriving Axiomatic Test Oracles
topic Software Engineering
url https://arxiv.org/abs/2504.04251