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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
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)
Binder, R.: Testing object-oriented software: a survey. Software Testing, Verification and Reliability 6, 125–252 (1996)
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)
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)
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)
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)
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)
Duke, R., Rose, G.: Formal Object-Oriented Specification and Design Using Object-Z. Formal Methods Series. Academic Press, London (1998)
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)
Harel, D.: Statecharts: A visual formalism for complex systems. Science of Computer Programming 8(3), 231–274 (1987)
Hierons, R.: Testing from a Z Specification. Software Testing, Verification and Reliability 7, 19–33 (1997)
Hoffman, D.M., Strooper, P.A.: The testgraph methodology: Automated testing of collection classes. Journal of Object-Oriented Programming 8(7), 35–41 (1995)
Hoffman, D.M., Strooper, P.A.: ClassBench: A methodology and framework for automated class testing. Software Practice and Experience 27(5), 573–597 (1997)
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)
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)
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
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)
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
McGregor, J., Dyer, D.: A Note on Inheritance and State Machines. SIGSOFT Software Engineering Notes 18(4), 61–69 (1993)
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)
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)
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
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
Ostrand, T., Balcer, M.: The category-partition method for specifying and generating functional tests. Communications of the ACM 31(6), 676–686 (1988)
Stocks, P., Carrington, D.: A framework for specification-based testing. IEEE Transactions on Software Engineering 22(11), 777–793 (1996)
Stocks, P.: Applying formal methods to software testing. PhD Thesis. Department of Computer Science and Electrical Engineering, The University of Queensland, Australia (1993)
Turner, C., Robson, D.: State-Based Testing and Inheritance. Technical Report TR-1/93, Computer Science Division, University of Durham, UK (1993)
Turner, C., Robson, D.: A state-based approach to the testing of class-based programs. Software – Concepts and Tools 16, 106–112 (1995)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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