Finding the needles in the haystack: Generating legal test inputs for object-oriented programs
Author(s)
Artzi, Shay; Ernst, Michael D.; Kiezun, Adam; Pacheco, Carlos; Perkins, Jeff H.![Thumbnail](/bitstream/handle/1721.1/33959/MIT-CSAIL-TR-2006-056.pdf.jpg?sequence=4&isAllowed=y)
DownloadMIT-CSAIL-TR-2006-056.pdf (402.6Kb)
Additional downloads
Other Contributors
Program Analysis
Advisor
Michael Ernst
Metadata
Show full item recordAbstract
A test input for an object-oriented program typically consists of asequence of method calls that use the API defined by the programunder test. Generating legal test inputs can be challenging because,for some programs, the set of legal method sequences is much smallerthan the set of all possible sequences; without a formalspecification of legal sequences, an input generator is bound toproduce mostly illegal sequences.We propose a scalable technique that combines dynamic analysis withrandom testing to help an input generator create legal test inputswithout a formal specification, even for programs in whichmost sequences are illegal. The technique uses an example executionof the program to infer a model of legal call sequences, and usesthe model to guide a random input generator towards legal butbehaviorally-diverse sequences.We have implemented our technique for Java, in a tool calledPalulu, and evaluated its effectiveness in creating legal inputsfor real programs. Our experimental results indicate that thetechnique is effective and scalable. Our preliminary evaluationindicates that the technique can quickly generate legal sequencesfor complex inputs: in a case study, Palulu created legal testinputs in seconds for a set of complex classes, for which it took anexpert thirty minutes to generate a single legal input.
Date issued
2006-08-31Other identifiers
MIT-CSAIL-TR-2006-056
Series/Report no.
Massachusetts Institute of Technology Computer Science and Artificial Intelligence Laboratory