Method-Sequence Exploration for Automated Unit Testing of Object-Oriented Programs

Tao Xie,Nikolai Tillmann,Jonathan de Halleux,Wolfram Schulte
2008-01-01
Abstract:A unit test for an object-oriented program involves a sequence of method calls, which create, mutate, or observe objects. Some method arguments may have primitive types. Recent advances in symbolic execution enable the effective generation of relevant primitive values, given a fixed sequence of method calls. However, there exists a challenge in test generation: determining a sequence of method calls that may bring an object into a desirable state if the right primitive values are chosen. A desirable state may be a state that causes a particular branch in a particular method to be exercised. Thus, a unit-test generation technique that aims at maximal code coverage (i.e., covering all reachable branches) must involve the selection of relevant method-call sequences. (In that sense, maximal code coverage includes the detection of possible assertion violations.) Existing major techniques for addressing this challenge include bounded-exhaustive testing, random testing, and evolutionary testing; sequence generation in these techniques are often not effective, not sufficiently guided by a test objective such as covering a particular branch or path. In this position paper, we present our recent techniques for method-sequence exploration and our ongoing and future work to address remaining challenges.
What problem does this paper attempt to address?