Automatic Extraction of Abstract-Object-State Machines Based on Branch Coverage

Some requirement modelling languages such as UML’s statechart diagrams allow developers to specify requirements of state-transition behavior in a visual way. These requirement specifications are useful in many ways, including helping program understanding and specification-based testing. However, there are a large number of legacy systems that are not equipped with these requirement specifications. 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 object’s concrete state to an abstract state based on the branch coverage information exercised by methods invoked on the object. We have prototyped our Brastra approach and shown the utility of the approach with an illustrating example. Our initial experience shows that Brastra can extract compact OSMs that provide useful information for understanding state-transition behavior.

[1]  William G. Griswold,et al.  Dynamically discovering likely program invariants to support program evolution , 1999, Proceedings of the 1999 International Conference on Software Engineering (IEEE Cat. No.99CB37002).

[2]  Doo-Hwan Bae,et al.  Test cases generation from UML state diagrams , 1999, IEE Proc. Softw..

[3]  Yannis Smaragdakis,et al.  JCrasher: an automatic robustness tester for Java , 2004, Softw. Pract. Exp..

[4]  Ivar Jacobson,et al.  The unified modeling language reference manual , 2010 .

[5]  James R. Larus,et al.  Mining specifications , 2002, POPL '02.

[6]  Emden R. Gansner,et al.  An open graph visualization system and its applications to software engineering , 2000 .

[7]  Massimiliano Di Penta,et al.  Assessing and improving state-based class testing: a series of experiments , 2004, IEEE Transactions on Software Engineering.

[8]  Hausi A. Müller,et al.  Reverse engineering: a roadmap , 2000, ICSE '00.

[9]  Barbara Liskov,et al.  Program Development in Java - Abstraction, Specification, and Object-Oriented Design , 1986 .

[10]  Emden R. Gansner,et al.  An open graph visualization system and its applications to software engineering , 2000, Softw. Pract. Exp..

[11]  David Lee,et al.  Principles and methods of testing finite state machines-a survey , 1996, Proc. IEEE.

[12]  David Chenho Kung,et al.  On object state testing , 1994, Proceedings Eighteenth Annual International Computer Software and Applications Conference (COMPSAC 94).

[13]  David Notkin,et al.  Rostra: a framework for detecting redundant object-oriented unit tests , 2004, Proceedings. 19th International Conference on Automated Software Engineering, 2004..

[14]  P. David Stotts,et al.  An Informal Formal Method for Systematic JUnit Test Case Generation , 2002, XP/Agile Universe.

[15]  David Notkin,et al.  Mutually Enhancing Test Generation and Specification Inference , 2003, FATES.

[16]  Tao Xie,et al.  Automatic Extraction of Sliced Object State Machines for Component Interfaces , 2004 .

[17]  A. Jefferson Offutt,et al.  Generating Tests from UML Specifications , 1999, UML.

[18]  Michal Young,et al.  Residual test coverage monitoring , 1999, Proceedings of the 1999 International Conference on Software Engineering (IEEE Cat. No.99CB37002).

[19]  Monica S. Lam,et al.  Automatic extraction of object-oriented component interfaces , 2002, ISSTA '02.

[20]  David Notkin,et al.  Tool-assisted unit-test generation and selection based on operational abstractions , 2006, Automated Software Engineering.

[21]  David Notkin,et al.  Automatic Extraction of Object-Oriented Observer Abstractions from Unit-Test Executions , 2004, ICFEM.

[22]  Yijun Yu,et al.  Reverse engineering goal models from legacy code , 2005, 13th IEEE International Conference on Requirements Engineering (RE'05).