Abstract
Unit testing has become a common step in software development. Although manually created unit tests are valuable, they are often insufficient; therefore, programmers can use an automatic unit-test-generation tool to produce a large number of additional tests for a class. However, without a priori specifications, programmers cannot practically inspect the execution of each automatically generated test. In this paper, we develop the observer abstraction approach for automatically extracting object-state-transition information of a class from unit-test executions, without requiring a priori specifications. Given a class and a set of its initial tests generated by a third-party tool, we generate new tests to augment the initial tests and produce the abstract state of an object based on the return values of a set of observers (public methods with non-void returns) invoked on the object. From the executions of both the new and initial tests, we automatically extract observer abstractions, each of which is an object state machine (OSM): a state in the OSM represents an abstract state and a transition in the OSM represents method calls. We have implemented the Obstra tool for the approach and have applied the approach on complex data structures; our experiences suggest that this approach provides useful object-state-transition information for programmers to inspect unit-test executions effectively.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Ammons, G., Bodik, R., Larus, J.R.: Mining specifications. In: Proc. the 29th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 4–16 (2002)
Arnold, K., Gosling, J., Holmes, D.: The Java Programming Language. Addison-Wesley Longman Publishing Co. Inc., Amsterdam (2000)
Ball, T., Majumdar, R., Millstein, T., Rajamani, S.K.: Automatic predicate abstraction of C programs. In: Proc. the ACM SIGPLAN 2001 Conference on Programming Language Design and Implementation, pp. 203–213 (2001)
Boyapati, C., Khurshid, S., Marinov, D.: Korat: automated testing based on Java predicates. In: Proc. the International Symposium on Software Testing and Analysis, pp. 123–133 (2002)
Csallner, C., Smaragdakis, Y.: JCrasher documents. Online manual (December 2003)
Dahm, M., van Zyl, J.: Byte Code Engineering Library (April 2003), http://jakarta.apache.org/bcel/
Ernst, M.D., Cockrell, J., Griswold, W.G., Notkin, D.: Dynamically discovering likely program invariants to support program evolution. IEEE Trans. Softw. Eng. 27(2), 99–123 (2001)
Gansner, E.R., North, S.C.: An open graph visualization system and its applications to software engineering. Software: Practice and Experience 30(11), 1203–1233 (2000)
Graf, S., Saidi, H.: Construction of abstract state graphs with PVS. In: Proc. the 9th International Conference on Computer Aided Verification, pp. 72–83 (1997)
Grieskamp, W., Gurevich, Y., Schulte, W., Veanes, M.: Generating finite state machines from abstract state machines. In: Proc. the International Symposium on Software Testing and Analysis, pp. 112–122 (2002)
Gupta, N., Mathur, A.P., Soffa, M.L.: Automated test data generation using an iterative relaxation method. In: Proc. the 6th ACM SIGSOFT International Symposium on Foundations of Software Engineering, pp. 231–244 (1998)
Henkel, J., Diwan, A.: Discovering algebraic specifications from Java classes. In: Proc. the 17th European Conference on Object-Oriented Programming, pp. 431–456 (2003)
JUnit (2003), http://www.junit.org
Kung, D., Suchak, N., Gao, J., Hsia, P.: On object state testing. In: Proc. the 18th Annual International Computer Software and Applications Conference, pp. 222–227 (1994)
Lee, D., Yannakakis, M.: Principles and methods of testing finite state machines - A survey. In: Proc. The IEEE, vol. 84, August 1996, pp. 1090–1123 (1996)
Liskov, B., Guttag, J.: Program Development in Java: Abstraction, Specification, and Object-Oriented Design. Addison-Wesley, Reading (2000)
Nguyen, D.: Design patterns for data structures. In: Proc. the 29th SIGCSE Technical Symposium on Computer Science Education, pp. 336–340 (1998)
Parasoft. Jtest manuals version 4.5. Online manual (April 2003), http://www.parasoft.com/
Sun Microsystems. Java 2 Platform, Standard Edition, v 1.4.2, API Specification. Online documentation (November 2003), http://java.sun.com/j2se/1.4.2/docs/api/
Turner, C.D., Robson, D.J.: The state-based testing of object-oriented programs. In: Proc. the Conference on Software Maintenance, pp. 302–310 (1993)
Whaley, J., Martin, M.C., Lam, M.S.: Automatic extraction of object-oriented component interfaces. In: Proc. the International Symposium on Software Testing and Analysis, pp. 218–228 (2002)
Xie, T., Marinov, D., Notkin, D.: Improving generation of object-oriented test suites by avoiding redundant tests. Technical Report UW-CSE-04-01-05, University of Washington Department of Computer Science and Engineering, Seattle, WA (January 2004)
Xie, T., Marinov, D., Notkin, D.: Rostra: A framework for detecting redundant object-oriented unit tests. In: Proc. 19th IEEE International Conference on Automated Software Engineering (2004)
Xie, T., Notkin, D.: Mutually enhancing test generation and specification inference. In: Petrenko, A., Ulrich, A. (eds.) FATES 2003. LNCS, vol. 2931, pp. 60–69. Springer, Heidelberg (2004)
Xie, T., Notkin, D.: Tool-assisted unit test selection based on operational violations. In: Proc. 18th IEEE International Conference on Automated Software Engineering, pp. 40–48 (2003)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2004 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Xie, T., Notkin, D. (2004). Automatic Extraction of Object-Oriented Observer Abstractions from Unit-Test Executions. In: Davies, J., Schulte, W., Barnett, M. (eds) Formal Methods and Software Engineering. ICFEM 2004. Lecture Notes in Computer Science, vol 3308. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-30482-1_27
Download citation
DOI: https://doi.org/10.1007/978-3-540-30482-1_27
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-23841-6
Online ISBN: 978-3-540-30482-1
eBook Packages: Springer Book Archive