Several approaches exist to automatically derive test cases that check the conformance of the implementation of abstract data types (ADTs) with respect to their specification. However, they lack support for the testing of implementations of ADTs defined by generic classes. In this paper, we present a novel technique to automatically derive, from specifications, unit test cases for Java generic classes that, in addition to the usual testing data, encompass implementations for the type parameters. The proposed technique relies on the use of Alloy Analyzer to find model instances for each test goal. JUnit test cases and Java implementations of the parameters are extracted from these model instances.
novel technique,unit test case,junit test case,specification-driven unit test generation,generic class,derive test case,abstract data type,java generic class,test goal,java implementation,model instance
Abstract data type,Programming language,Computer science,Unit testing,Alloy Analyzer,Disjunctive normal form,Theoretical computer science,Implementation,Test data,Test case,Java