Skip to main content

Formal Derivation of Finite State Machines for Class Testing

  • Conference paper
ZUM ’98: The Z Formal Specification Notation (ZUM 1998)

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

Included in the following conference series:

Abstract

Previous work on generating state machines for the purpose of class testing has not been formally based. There has also been work on deriving state machines from formal specifications for testing non-object-oriented software. We build on this work by presenting a method for deriving a state machine for testing purposes from a formal specification of the class under test. We also show how the resulting state machine can be used as the basis for a test suite developed and executed using an existing framework for class testing.

To derive the state machine, we identify the states and possible interactions of the operations of the class under test. The Test Template Framework is used to formally derive the states from the Object-Z specification of the class under test. The transitions of the finite state machine are calculated from the derived states and the class’s operations. The formally derived finite state machine is transformed to a ClassBench testgraph, which is used as input to the ClassBench framework to test a C++ implementation of the class. The method is illustrated using a simple bounded queue example.

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 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.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. Bicarregui, J., Dick, J., Matthews, B., Woods, E.: Making the most of formal specification through animation, testing and proof. Science of Computer Programming 29, 53–78 (1997)

    Article  Google Scholar 

  2. Binder, R.: Testing object-oriented software: a survey. Software Testing, Verification and Reliability 6, 125–252 (1996)

    Article  Google Scholar 

  3. Bosman, O., Schmidt, H.: Object test coverage using finite state machines. In: Miggins, C., Duke, R., Meyer, B. (eds.) Technology of Object-Oriented Languages and Systems (TOOLS 18), pp. 171–178. Prentice Hall, Englewood Cliffs (1995)

    Google Scholar 

  4. Coleman, D., Hayes, F., Bear, S.: Introducing Objectcharts or how to use Statecharts in object-oriented design. IEEE Transactions on Software Engineering 18(1), 8–18 (1992)

    Article  Google Scholar 

  5. Dick, J., Faivre, A.: Automating the generation and sequencing of test cases from model-based specification. In: Larsen, P.G., Woodcock, J.C.P. (eds.) FME 1993. LNCS, vol. 670, pp. 268–284. Springer, Heidelberg (1993)

    Chapter  Google Scholar 

  6. Dong, J., Zucconi, L., Duke, R.: Specifying Parallel and Distributed Systems in Object-Z: The Lift Case Study. In: International Workshop on Software Engineering for Parallel and Distributed Systems, pp. 140–149. IEEE Computer Society Press, Los Alamitos (1997)

    Chapter  Google Scholar 

  7. Duke, R., Rose, G., Smith, G.: Object-Z: A specification language advocated for the description of standards. Computer Standards and Interfaces 17, 511–533 (1995)

    Article  Google Scholar 

  8. Duke, R., Rose, G.: Formal Object-Oriented Specification and Design Using Object-Z. Formal Methods Series. Academic Press, London (1998)

    Google Scholar 

  9. Gao, J.Z., Kung, D., Hsia, P., Toyoshima, Y., Chen, C.: Object State Testing for Object-Oriented Programs. In: Computer Software & Applications Conference (COMPSAC 1995), pp. 232–238 (1995)

    Google Scholar 

  10. Harel, D.: Statecharts: A visual formalism for complex systems. Science of Computer Programming 8(3), 231–274 (1987)

    Article  MATH  MathSciNet  Google Scholar 

  11. Hierons, R.: Testing from a Z Specification. Software Testing, Verification and Reliability 7, 19–33 (1997)

    Article  Google Scholar 

  12. Hoffman, D.M., Strooper, P.A.: The testgraph methodology: Automated testing of collection classes. Journal of Object-Oriented Programming 8(7), 35–41 (1995)

    Google Scholar 

  13. Hoffman, D.M., Strooper, P.A.: ClassBench: A methodology and framework for automated class testing. Software Practice and Experience 27(5), 573–597 (1997)

    Article  Google Scholar 

  14. Hong, H.S., Kwon, Y.R., Cha, S.D.: Testing of object-oriented programs based on finite state machines. In: Proc. Asia-Pacific Software Engineering Conference (APSEC 1995), pp. 234–241 (1995)

    Google Scholar 

  15. MacColl, I., Carrington, D., Stocks, P.: An experiment in specification-based testing. In: Proc. 19th Australasian Computer Science Conference (ACSC 1996), pp. 159–168 (1996)

    Google Scholar 

  16. MacColl, I., Murray, L., Strooper, P., Carrington, D.: Specification-based objectoriented testing: A case study. Technical Report 98-08, Software Verification Research Centre, The University of Queensland, Australia (1998), Submitted to ICFEM

    Google Scholar 

  17. McDonald, J., Strooper, P.A.: Testing inheritance hierarchies in the Class- Bench framework. In: Proc. Technology of Object-Oriented Languages and Systems, TOOLS USA 1996 (1996) (in press)

    Google Scholar 

  18. McDonald, J.: Translating Object-Z specifications to passive test oracles. Technical Report 98-04, Software Verification Research Centre, The University of Queensland, Australia, (1998), Submitted to ICFEM 1998

    Google Scholar 

  19. McGregor, J., Dyer, D.: A Note on Inheritance and State Machines. SIGSOFT Software Engineering Notes 18(4), 61–69 (1993)

    Article  Google Scholar 

  20. McGregor, J.: Constructing Functional Test Cases Using Incrementally Derived State Machines. In: 11th International Conference and Exposition on Testing Computer Software, pp. 377–386 (1994)

    Google Scholar 

  21. Murray, L., Carrington, D., MacColl, I., McDonald, J., Strooper, P.: Formal Derivation of Finite State Machines for Class Testing. Technical Report 98-03, Software Verification Research Centre, The University of Queensland, Australia (1998)

    Google Scholar 

  22. Murray, L., Carrington, D., MacColl, I., Strooper, P.: Extending Test Templates with Inheritance. In: Bailes, P. (ed.) Proc. 1997 Australian Software Engineering Conference (ASWEC 1997), pp. 80–87. IEEE Computer Society Press, Los Alamitos (1997), Available in extended form as Technical Report 97-18, Software Verification Research Centre, The University of Queensland, Australia, 1997. http://svrc.it.uq.edu.au/Bibliography/svrc-tr.html?97-18

  23. Murray, L., McDonald, J., Strooper, P.: Specification-based class testing with ClassBench. Technical Report 98-12, Software Verification Research Centre, The University of Queensland, Australia (1998) Submitted to APSEC 1998

    Google Scholar 

  24. Ostrand, T., Balcer, M.: The category-partition method for specifying and generating functional tests. Communications of the ACM 31(6), 676–686 (1988)

    Article  Google Scholar 

  25. Stocks, P., Carrington, D.: A framework for specification-based testing. IEEE Transactions on Software Engineering 22(11), 777–793 (1996)

    Article  Google Scholar 

  26. Stocks, P.: Applying formal methods to software testing. PhD Thesis. Department of Computer Science and Electrical Engineering, The University of Queensland, Australia (1993)

    Google Scholar 

  27. Turner, C., Robson, D.: State-Based Testing and Inheritance. Technical Report TR-1/93, Computer Science Division, University of Durham, UK (1993)

    Google Scholar 

  28. Turner, C., Robson, D.: A state-based approach to the testing of class-based programs. Software – Concepts and Tools 16, 106–112 (1995)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1998 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Murray, L., Carrington, D., MacColl, I., McDonald, J., Strooper, P. (1998). Formal Derivation of Finite State Machines for Class Testing. In: Bowen, J.P., Fett, A., Hinchey, M.G. (eds) ZUM ’98: The Z Formal Specification Notation. ZUM 1998. Lecture Notes in Computer Science, vol 1493. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-49676-2_4

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-49676-2_4

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-65070-6

  • Online ISBN: 978-3-540-49676-2

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics