Test input generation for java containers using state matching

  • Authors:
  • Willem Visser;Corina S. Pǎsǎreanu;Radek Pelánek

  • Affiliations:
  • RIACS/NASA Ames, Moffett Field, CA;RIACS/NASA Ames, Moffett Field, CA;Masaryk University, Brno, Czech Republic

  • Venue:
  • Proceedings of the 2006 international symposium on Software testing and analysis
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

The popularity of object-oriented programming has led to the wide use of container libraries. It is important for the reliability of these containers that they are tested adequately. We describe techniques for automated test input generation of Java container classes. Test inputs are sequences of method calls from the container interface. The techniques rely on state matching to avoid generation of redundant tests. Exhaustive techniques use model checking with explicit or symbolic execution to explore all the possible test sequences up to predefined input sizes. Lossy techniques rely on abstraction mappings to compute and store abstract versions of the concrete states; they explore underapproximations of all the possible test sequences.We have implemented the techniques on top of the Java PathFinder model checker and we evaluate them using four Java container classes. We compare state matching based techniques and random selection for generating test inputs, in terms of testing coverage. We consider basic block coverage and a form of predicate coverage - that measures whether all combinations of a predetermined set of predicates are covered at each basic block. The exhaustive techniques can easily obtain basic block coverage, but cannot obtain good predicate coverage before running out of memory. On the other hand, abstract matching turns out to be a powerful approach for generating test inputs to obtain high predicate coverage. Random selection performed well except on the examples that contained complex input spaces, where the lossy abstraction techniques performed better.