This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Automatic Extraction of Abstract-Object-State Machines Based on Branch Coverage Hai Yuan Department of Computer Science North Carolina State University Raleigh, NC 27695 firstname.lastname@example.org Tao Xie Department of Computer Science North Carolina State University Raleigh, NC 27695 email@example.com Abstract Some requirement modelling languages such as UMLs statechart diagrams allow developers to specify require- ments of state-transition behavior in a visual way. These requirement specifications are useful in many ways, includ- ing helping program understanding and specification-based testing. However, there are a large number of legacy sys- tems that are not equipped with these requirement specifica- tions. This paper proposes a new approach, called Brastra, for extracting object state machines (OSM) from unit-test executions. An OSM describes how a method call transits an object from one state to another. When the state of an object is represented with concrete-state information (the values of fields transitively reachable from the object), the extracted OSMs are simply too complex to be useful. Our Brastra approach abstracts an objects concrete state to an abstract state based on the branch coverage information ex- ercised by methods invoked on the object. We have proto- typed our Brastra approach and shown the utility of the ap- proach with an illustrating example. Our initial experience shows that Brastra can extract compact OSMs that pro- vide useful information for understanding state-transition behavior. 1 Introduction The Unified Modelling Languages (UML)  provides a set of notations for describing requirements of artifacts in software systems. Among these notations, statechart dia- grams capture state-transition behavior of a class or multi- ple classes. After requirements specifications are specified, developers can write source code to implement the specified behavior. Later when developers want to understand and maintain the source code, they can refer to requirements specifications besides directly inspecting the source code. In addition, developers can use specification-based testing tools [6, 8, 12, 17] to generate test inputs from the specifi- cations and check the behavior of implementation with the behavior specified in requirements specifications. However, a number of legacy systems are not equipped with speci- fications. Understanding and testing these legacy systems present a challenge for developers. To address this chal- lenge, researchers have developed various reverse engineer- ing techniques  to infer various types of information from legacy systems. This paper proposes Brastra, a new approach for auto- matically extracting object state machines (OSM)  for a class from unit-test executions. These OSMs describe state- transition behavior exhibited by invoking methods on ob- jects of a class. An OSM is similar to a UML statechart diagram. In an OSM for a class, a state represents the state of an object at runtime. A transition represents method callsof an object at runtime....
View Full Document
This note was uploaded on 02/24/2012 for the course CSE 503 taught by Professor Davidnotikin during the Spring '11 term at University of Washington.
- Spring '11
- Computer Science