SpecFuzzer: A Tool for Inferring Class Specifications via Grammar-based Fuzzing
In object-oriented design, class specifications are primarily used to express properties describing the intended behavior of the class methods and constraints on class’ objects. Although the presence of these specifications is important for various software engineering tasks such as test generation, bug finding and automated debugging, developers rarely write them.
In this tool demo we present the details of SpecFuzzer, a tool that aims at alleviating the problem of writing class specifications by using a combination of grammar-based fuzzing, dynamic invariant detection and mutation analysis to automatically infer specifications for Java classes. Given a class under analysis, SpecFuzzer uses (i) a generator of candidate assertions derived from a grammar automatically extracted from the class; (ii) a dynamic invariant detector –Daikon– in order to discard the assertions invalidated by a test suite; and (iii) a mutation-based mechanism to cluster and rank assertions, so that similar constraints are grouped and the stronger ones prioritized.
Pre-print File Attached