Skip to main content

Automatic Extraction of Object-Oriented Observer Abstractions from Unit-Test Executions

  • Conference paper
Formal Methods and Software Engineering (ICFEM 2004)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 3308))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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)

    Google Scholar 

  2. Arnold, K., Gosling, J., Holmes, D.: The Java Programming Language. Addison-Wesley Longman Publishing Co. Inc., Amsterdam (2000)

    Google Scholar 

  3. 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)

    Google Scholar 

  4. 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)

    Google Scholar 

  5. Csallner, C., Smaragdakis, Y.: JCrasher documents. Online manual (December 2003)

    Google Scholar 

  6. Dahm, M., van Zyl, J.: Byte Code Engineering Library (April 2003), http://jakarta.apache.org/bcel/

  7. 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)

    Article  Google Scholar 

  8. 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)

    Article  MATH  Google Scholar 

  9. 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)

    Google Scholar 

  10. 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)

    Google Scholar 

  11. 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)

    Google Scholar 

  12. Henkel, J., Diwan, A.: Discovering algebraic specifications from Java classes. In: Proc. the 17th European Conference on Object-Oriented Programming, pp. 431–456 (2003)

    Google Scholar 

  13. JUnit (2003), http://www.junit.org

  14. 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)

    Google Scholar 

  15. 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)

    Google Scholar 

  16. Liskov, B., Guttag, J.: Program Development in Java: Abstraction, Specification, and Object-Oriented Design. Addison-Wesley, Reading (2000)

    Google Scholar 

  17. Nguyen, D.: Design patterns for data structures. In: Proc. the 29th SIGCSE Technical Symposium on Computer Science Education, pp. 336–340 (1998)

    Google Scholar 

  18. Parasoft. Jtest manuals version 4.5. Online manual (April 2003), http://www.parasoft.com/

  19. 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/

  20. 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)

    Google Scholar 

  21. 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)

    Google Scholar 

  22. 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)

    Google Scholar 

  23. 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)

    Google Scholar 

  24. 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)

    Chapter  Google Scholar 

  25. 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)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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

Publish with us

Policies and ethics