ASE

MSR Pex

MSeqGen: Object-Oriented Unit-Test Generation via Mining Source Code


[Summary]         [People]         [Evaluation Results]

PROJECT SUMMARY

An objective of unit testing is to achieve high structural coverage of the code under test. Achieving high structural coverage of object-oriented code requires desirable method-call sequences that create and mutate objects. These sequences help generate target object states such as argument or receiver object states (in short as target states) of a method under test. Automatic generation of sequences for achieving target states is often challenging due to a large search space of possible sequences. On the other hand, code bases that use object types (such as argument or receiver object types) include sequences that can be used to assist automatic test-generation approaches in achieving target states. In this paper, we propose a novel approach that mines code bases and extracts sequences related to receiver or argument object types of a method under test. Our approach uses these extracted sequences to enhance two state-of-the-art test-generation approaches: random testing and dynamic symbolic execution. We conduct two evaluations to show the effectiveness of our approach. Using sequences extracted by our approach, we show that a random testing approach achieves 8.69% (with a maximum of 20% for one namespace) higher branch coverage and a dynamic-symbolic-execution-based approach achieves 17.4% (with a maximum of 22.45% for one namespace) higher branch coverage than without using our approach. Such an improvement is significant as the branches that are not covered by these state-of-the-art approaches are generally quite difficult to cover.

The FSE 2009 paper can be found here.

PEOPLE

Faculty
    Tao Xie

Student
    Suresh Thummalapenta

Collaborators
    Nikolai Tillmann, Jonathan de Halleux, and Wolfram Schulte (Microsoft Research)


=====================

EVALUATION RESULTS

SUBJECTS

Subject: QuickGraph V2.0

Code bases used for mining:
Debug_Version_0.zip
jar2ikvmc-0.1.zip
Mbunit.zip
nant-0.86-beta1-bin.zip
NTS_1.7.zip
QuickGraphDLLs.zip
ReflectorAddins.zip

Subject: Facebook V2.0

Code bases used for mining:
FBMonkey
Mewe
Citiport

ASSISTING A RANDOM APPROACH

QuickGraph:
      Test Code Coverage
      Randoop Test Cases Coverage
      Randoop + MSeqGen Test Cases Coverage
Facebook:
      Test Code Coverage
      Randoop Test Cases Coverage
      Randoop + MSeqGen Test Cases Coverage

ASSISTING A DYNAMIC SYMBOLIC BASED APPROACH

QuickGraph:
      Pex Coverage
      Pex + MSeqGen Coverage

 

 

SPONSORS

Microsoft Research

ARO Grant Army Research Office Award Program (09/08/2008-08/30/2011)

NSF National Science Foundation Award CNS-0720641, Computer Systems Research (CSR) Program (08/01/2007-07/31/2008)


Please contact for any additional information.