Symbolic Test Case Generation for Primitive Recursive Functions

  • Achim D. Brucker
  • Burkhart Wolff
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3395)


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.


symbolic test case generations black box testing theorem proving Isabelle/HOL 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
  2. 2.
    SML of New Jersey:
  3. 3.
    Adelson-Velskiĭ, G.M., Landis, E.M.: An algorithm for the organization of information. Soviet Mathematics Doklady 3, 1259–1263 (1962)Google Scholar
  4. 4.
    Bayer, R.: Symmetric binary B-trees: Data structure and maintenance algorithms. Acta Informatica 1(4), 290–306 (1972)MathSciNetCrossRefMATHGoogle Scholar
  5. 5.
    Biere, A., Cimatti, A., Clarke, E., Strichman, O., Zhu, Y.: Bounded Model Checking. In: Computers Advance, vol. 58 (2003)Google Scholar
  6. 6.
    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)CrossRefGoogle Scholar
  7. 7.
    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)Google Scholar
  8. 8.
    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)CrossRefGoogle Scholar
  9. 9.
    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)Google Scholar
  10. 10.
    DAgostino, M., Gabbay, D., Hähnle, R., Posegga, J. (eds.): Handbook of Tableau Methods. Kluwer, Dordrecht (1996)Google Scholar
  11. 11.
    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)Google Scholar
  12. 12.
    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)CrossRefGoogle Scholar
  13. 13.
    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)CrossRefGoogle Scholar
  14. 14.
    Hayashi, S.: Towards the animation of proofs—testing proofs by examples. Theoretical Computer Science 272(1-2), 177–195 (2002)MathSciNetCrossRefMATHGoogle Scholar
  15. 15.
    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)CrossRefGoogle Scholar
  16. 16.
    Kimmig, A.: Red-black trees of smlnj. Studienarbeit, Universität Freiburg (2003)Google Scholar
  17. 17.
    Nipkow, T., Paulson, L.C., Wenzel, M.: Isabelle/HOL — A Proof Assistant for Higher-Order Logic. LNCS, vol. 2283. Springer, Heidelberg (2002)MATHGoogle Scholar
  18. 18.
    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)Google Scholar
  19. 19.
    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)CrossRefGoogle Scholar
  20. 20.
    Visser, W., Păsăreanu, C.S., Khurshid, S.: Test input generation with Java PathFinder. SIGSOFT Softw. Eng. Notes 29(4), 97–107 (2004)CrossRefGoogle Scholar
  21. 21.
    Zhu, H., Hall, P.A., May, J.H.R.: Software unit test coverage and adequacy. ACM Computing Surveys 29(4), 366–427 (1997)CrossRefGoogle Scholar

Copyright information

© IFIP International Federation for Information Processing 2005

Authors and Affiliations

  • Achim D. Brucker
    • 1
  • Burkhart Wolff
    • 1
  1. 1.Information SecurityETH Zürich, ETH ZentrumZürichSwitzerland

Personalised recommendations