Abstract
We present a method for the automatic generation of test cases for HOL formulae containing primitive recursive predicates. These test cases can be used for the animation of specifications as well as for black-box testing of external programs.
Our method is two-staged: first, the original formula is partitioned into test cases by transformation into a Horn-clause normal form (HCNF). Second, the test cases are analyzed for instances with constant terms satisfying the premises of the clauses. Particular emphasis is put on the control of test hypotheses and test hierarchies to avoid intractability. We applied our method to several examples, including AVL-trees and the red-black tree implementation in the standard library from SML/NJ.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
QCheck/SML: http://contrapunctus.net/league/haques/qcheck/
SML of New Jersey: http://www.smlnj.org/
Adelson-Velskiĭ, G.M., Landis, E.M.: An algorithm for the organization of information. Soviet Mathematics Doklady 3, 1259–1263 (1962)
Bayer, R.: Symmetric binary B-trees: Data structure and maintenance algorithms. Acta Informatica 1(4), 290–306 (1972)
Biere, A., Cimatti, A., Clarke, E., Strichman, O., Zhu, Y.: Bounded Model Checking. In: Computers Advance, vol. 58 (2003)
Brucker, A.D., Wolff, B.: A proposal for a formal OCL semantics in Isabelle/HOL. In: Carreño, V.A., Muñoz, C.A., Tahar, S. (eds.) TPHOLs 2002. LNCS, vol. 2410, pp. 99–114. Springer, Heidelberg (2002)
Brucker, A.D., Wolff, B.: A case study of a formalized security architecture. In: Arts, T., Fokkink, W. (eds.) FMICS 2003, Roros. Electronic Notes in Theoretical Computer Science, vol. 80. Elsevier Science Publishers, Amsterdam (2003)
Claessen, K., Hughes, J.: QuickCheck: a lightweight tool for random testing of Haskell programs. In: Proceedings of the fifth ACM SIGPLAN international conference on Functional programming, pp. 268–279. ACM Press, New York (2000)
Cousot, P., Cousot, R.: Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In: Proceedings of the 4th ACM SIGACT-SIGPLAN symposium on Principles of programming languages, pp. 238–252. ACM Press, New York (1977)
DAgostino, M., Gabbay, D., Hähnle, R., Posegga, J. (eds.): Handbook of Tableau Methods. Kluwer, Dordrecht (1996)
Dahl, O.-J., Dijkstra, E.W., Hoare, C.A.R.: Structured Programming. In: A.P.I.C. Studies in Data Processing, vol. 8. Academic Press, London (1972)
Dick, J., Faivre, A.: Automating the generation and sequencing of test cases from model-based specications. In: Larsen, P.G., Woodcock, J.C.P. (eds.) FME 1993. LNCS, vol. 670, pp. 268–284. Springer, Heidelberg (1993)
Gaudel, M.-C.: Testing can be formal, too. In: Mosses, P.D., Schwartzbach, M.I., Nielsen, M. (eds.) CAAP 1995, FASE 1995, and TAPSOFT 1995. LNCS, vol. 915, pp. 82–96. Springer, Heidelberg (1995)
Hayashi, S.: Towards the animation of proofs—testing proofs by examples. Theoretical Computer Science 272(1-2), 177–195 (2002)
Huber, F., Schätz, B., Schmidt, A., Spies, K.: AutoFocus - a tool for distributed systems specification. In: Jonsson, B., Parrow, J. (eds.) FTRTFT 1996. LNCS, vol. 1135, pp. 467–470. Springer, Heidelberg (1996)
Kimmig, A.: Red-black trees of smlnj. Studienarbeit, Universität Freiburg (2003)
Nipkow, T., Paulson, L.C., Wenzel, M.: Isabelle/HOL — A Proof Assistant for Higher-Order Logic. LNCS, vol. 2283. Springer, Heidelberg (2002)
Pretschner, A.: Classical search strategies for test case generation with constraint logic programming. In: Brinksma, E., Tretmans, J. (eds.) Proc. Formal approaches to testing of software, pp. 47–60. BRICS (2001)
Slind, K., Hurd, J.: Applications of polytypism in theorem proving. In: Basin, D., Wolff, B. (eds.) TPHOLs 2003. LNCS, vol. 2758, pp. 103–119. Springer, Heidelberg (2003)
Visser, W., Păsăreanu, C.S., Khurshid, S.: Test input generation with Java PathFinder. SIGSOFT Softw. Eng. Notes 29(4), 97–107 (2004)
Zhu, H., Hall, P.A., May, J.H.R.: Software unit test coverage and adequacy. ACM Computing Surveys 29(4), 366–427 (1997)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2005 IFIP International Federation for Information Processing
About this paper
Cite this paper
Brucker, A.D., Wolff, B. (2005). Symbolic Test Case Generation for Primitive Recursive Functions. In: Grabowski, J., Nielsen, B. (eds) Formal Approaches to Software Testing. FATES 2004. Lecture Notes in Computer Science, vol 3395. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-31848-4_2
Download citation
DOI: https://doi.org/10.1007/978-3-540-31848-4_2
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-25109-5
Online ISBN: 978-3-540-31848-4
eBook Packages: Computer ScienceComputer Science (R0)