Random unit-test generation with MUT-aware sequence recommendation

  • Authors:
  • Wujie Zheng;Qirun Zhang;Michael Lyu;Tao Xie

  • Affiliations:
  • The Chinese University of Hong Kong, Hong Kong, China;The Chinese University of Hong Kong, Hong Kong, China;The Chinese University of Hong Kong, Hong Kong, China;North Carolina State University, North Carolina, USA

  • Venue:
  • Proceedings of the IEEE/ACM international conference on Automated software engineering
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

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.