Fuzzing Class Specifications

01/26/2022
by   Facundo Molina, et al.
0

Expressing class specifications via executable constraints is important for various software engineering tasks such as test generation, bug finding and automated debugging, but developers rarely write them. Techniques that infer specifications from code exist to fill this gap, but they are designed to support specific kinds of assertions and are difficult to adapt to support different assertion languages, e.g., to add support for quantification, or additional comparison operators, such as membership or containment. To address the above issue, we present SpecFuzzer, a novel technique that combines grammar-based fuzzing, dynamic invariant detection, and mutation analysis, to automatically produce class specifications. SpecFuzzer uses: (i) a fuzzer as a generator of candidate assertions derived from a grammar that is automatically obtained from the class definition; (ii) a dynamic invariant detector – Daikon – to filter out assertions invalidated by a test suite; and (iii) a mutation-based mechanism to cluster and rank assertions, so that similar constraints are grouped and then the stronger prioritized. Grammar-based fuzzing enables SpecFuzzer to be straightforwardly adapted to support different specification languages, by manipulating the fuzzing grammar, e.g., to include additional operators. We evaluate our technique on a benchmark of 43 Java methods employed in the evaluation of the state-of-the-art techniques GAssert and EvoSpex. Our 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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
09/12/2023

Online Name-Based Navigation for Software Meta-languages

Software language design and implementation often involve specifications...
research
10/10/2018

Leveraging Textual Specifications for Grammar-based Fuzzing of Network Protocols

Grammar-based fuzzing is a technique used to find software vulnerabiliti...
research
02/26/2021

EvoSpex: An Evolutionary Algorithm for Learning Postconditions

Software reliability is a primary concern in the construction of softwar...
research
05/16/2019

Inferring Concise Specifications of APIs

Modern software relies on libraries and uses them via application progra...
research
12/15/2021

XCheck: a Simple, Effective and Extensible Bug Finder using micro-grammar

We propose a simple and effective bug finder, XCheck, which is a proof o...
research
11/15/2017

Can clone detection support quality assessments of requirements specifications?

Due to their pivotal role in software engineering, considerable effort i...
research
01/29/2023

Specification Inference for Evolving Systems

In this paper, we propose an assertion-based approach to capture softwar...

Please sign up or login with your details

Forgot password? Click here to reset