Report Open Access
Valerio Terragni; Gunel Jahangirova; Mauro Pezzè; Paolo Tonella
Assertion oracles are executable boolean expression placed inside the program. A perfect assertion oracle should pass (return true) for all correct executions and fail (return false) for all incorrect executions. The difficulty of manually design or automatically generate perfect oracles often leads to assertions that fail to distinguish between correct and incorrect executions. In other words, they have false positives and false negatives that we call oracle deficiencies.
In this paper, we propose GAssert (Genetic ASSERTion improvement), the first technique to automatically improve assertions oracles. Given an assertion oracle and its oracle deficiencies, GAssert uses a novel evolutionary algorithm that explores the space of possible assertions to identify a new assertion with fewer oracle deficiencies than the original assertion.
Our empirical evaluation on 34 Java methods from 7 Java code bases shows that GAssert effectively improves assertion oracles. Moreover, GAssert outperforms two baselines (unguided-random and invariant-based oracle improvement) and was competitive with and in some cases even outperformed human improved assertions.
Name | Size | |
---|---|---|
TR-Precrime-2020-02.pdf
md5:312d00438004cd2d453a866c4519238c |
776.6 kB | Download |
All versions | This version | |
---|---|---|
Views | 26 | 26 |
Downloads | 48 | 48 |
Data volume | 37.3 MB | 37.3 MB |
Unique views | 22 | 22 |
Unique downloads | 44 | 44 |