Specification-Driven unit test generation for java generic classes

  • Authors:
  • Francisco Rebello de Andrade;João P. Faria;Antónia Lopes;Ana C. R. Paiva

  • Affiliations:
  • Faculdade de Engenharia, Universidade do Porto, Portugal;Faculdade de Engenharia, Universidade do Porto, Portugal,INESC Porto, Portugal;Faculdade de Ciências, Universidade de Lisboa, Portugal;Faculdade de Engenharia, Universidade do Porto, Portugal

  • Venue:
  • IFM'12 Proceedings of the 9th international conference on Integrated Formal Methods
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

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.