kirancodes.me
To Proof Maintenance & Beyond!

Random unit-test generation with MUT-aware sequence recommendation

Wujie Zheng, Qirun Zhang, Michael R. Lyu, Tao Xie

Abstract

A key component of automated object-oriented unit-test generation is to find method-call sequences that generate desired inputs of a method under test (MUT). Previous work cannot find desired sequences effectively due to the large search space of possible sequences. To address this issue, we present a MUT-aware sequence recommendation approach called RecGen to improve the effectiveness of random object-oriented unit-test generation. Unlike existing random testing approaches that select sequences without considering how a MUT may use inputs generated from sequences, RecGen analyzes object fields accessed by a MUT and recommends a short sequence that mutates these fields. In addition, for MUTs whose test generation keeps failing, RecGen recommends a set of sequences to cover all the methods that mutate object fields accessed by the MUT. This technique further improves the chance of generating desired inputs. We have implemented RecGen and evaluated it on three libraries. Evaluation results show that RecGen improves code coverage over previous random testing tools.

BibTeX
@inproceedings{Zheng-al:ASE10,
  author    = {Wujie Zheng and
               Qirun Zhang and
               Michael R. Lyu and
               Tao Xie},
  title     = {Random unit-test generation with {MUT-aware} sequence recommendation},
  booktitle = {ASE},
  pages     = {293--296},
  publisher = {{ACM}},
  year      = {2010},
}

Related papers