Skip to main content

Automatic Generation of Test Inputs for Mercury

  • Conference paper
Logic-Based Program Synthesis and Transformation (LOPSTR 2008)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 5438))

Abstract

In this work, we consider the automatic generation of test inputs for Mercury programs. We use an abstract representation of a program that allows to reason about program executions as paths in a control-flow graph. Next, we define how such a path corresponds to a set of constraints whose solution defines input values for the predicate under test such that when the predicate is called with respect to these input values, the execution is guaranteed to follow the given path. The approach is similar to existing work for imperative languages, but has been considerably adapted to deal with the specificities of Mercury, such as symbolic data representation, predicate failure and non-determinism.

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. Glass, R.: Software runaways: lessons learned from massive software project failures. Prentice-Hall, Englewood Cliffs (1997)

    Google Scholar 

  2. Kaner, C., Falk, J., Nguyen, H.Q.: Testing computer software. John Wiley and Sons, Chichester (1993)

    MATH  Google Scholar 

  3. Zhu, H., Hall, P., May, J.: Software unit test coverage and adequacy. ACM Computing Surveys 29(4) (1997)

    Google Scholar 

  4. Fischer, S., Kuchen, H.: Systematic generation of glass-box test cases for functional logic programs. In: PPDP 2007: Proceedings of the 9th ACM SIGPLAN international conference on Principles and practice of declarative programming, pp. 63–74. ACM, New York (2007)

    Google Scholar 

  5. Claessen, K., Hughes, J.: Quickcheck: a lightweight tool for random testing of haskell programs. In: ICFP 2000: Proceedings of the fifth ACM SIGPLAN international conference on Functional programming, pp. 268–279. ACM, New York (2000)

    Chapter  Google Scholar 

  6. Luo, G., von Bochmann, G., Sarikaya, B., Boyer, M.: Control-flow based testing of prolog programs. In: Proceedings of the Third International Symposium on Software Reliability Engineering, pp. 104–113 (1992)

    Google Scholar 

  7. Belli, B., Jack, O.: Implementation-based analysis and testing of prolog programs. In: ISSTA 1993: Proceedings of the 1993 ACM SIGSOFT international symposium on Software testing and analysis, pp. 70–80. ACM Press, New York (1993)

    Google Scholar 

  8. Sy, N.T., Deville, Y.: Automatic test data generation for programs with integer and float variables. In: Proceedings of ASE 2001 (2001)

    Google Scholar 

  9. Gotlieb, A., Botella, B., Rueher, M.: Automatic test data generation using constraint solving techniques. In: ISSTA 1998: Proceedings of the 1998 ACM SIGSOFT international symposium on Software testing and analysis, pp. 53–62. ACM Press, New York (1998)

    Chapter  Google Scholar 

  10. Gupta, N., Mathur, A.P., Soffa, M.L.: Generating test data for branch coverage. In: Automated Software Engineering, pp. 219–228 (2000)

    Google Scholar 

  11. Visser, W., Pasareanu, C.S., Khurshid, S.: Test input generation with Java pathfinder. SIGSOFT Softw. Eng. Notes 29(4), 97–107 (2004)

    Article  Google Scholar 

  12. Müller, R.A., Lembeck, C., Kuchen, H.: A symbolic java virtual machine for test case generation. In: IASTED International Conference on Software Engineering, part of the 22nd Multi-Conference on Applied Informatics, Innsbruck, Austria, February 17-19, pp. 365–371 (2004)

    Google Scholar 

  13. Somogyi, Z., Henderson, H., Conway, T.: The execution algorithm of Mercury, an efficient purely declarative logic programming language. Journal of Logic Programming 29(4) (1997)

    Google Scholar 

  14. Mweze, N., Vanhoof, W.: Automatic generation of test inputs for Mercury programs (extended abstract). In: Puebla, G. (ed.) LOPSTR 2006. LNCS, vol. 4407. Springer, Heidelberg (2007)

    Google Scholar 

  15. Mycroft, A., O’Keefe, R.: A polymorphic type system for Prolog. Artificial Intelligence 23, 295–307 (1984)

    Article  MathSciNet  MATH  Google Scholar 

  16. Degrave, F., Vanhoof, W.: A control flow graph for Mercury. In: Proceedings of CICLOPS 2007 (2007)

    Google Scholar 

  17. Demoen, B., de la Banda, M.G., Stuckey, P.: Type constraint solving for parametric and ad-hoc polymorphism. In: Edwards, J. (ed.) The 22nd Australian Computer Science Conference, pp. 217–228. Springer, Heidelberg (1999)

    Google Scholar 

  18. Leuschel, M.: The dppd library of benchmarks, http://www.ecs.soton.ac.uk/~mal/systems/dppd.html

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2009 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Degrave, F., Schrijvers, T., Vanhoof, W. (2009). Automatic Generation of Test Inputs for Mercury. In: Hanus, M. (eds) Logic-Based Program Synthesis and Transformation. LOPSTR 2008. Lecture Notes in Computer Science, vol 5438. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-00515-2_6

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-00515-2_6

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-00514-5

  • Online ISBN: 978-3-642-00515-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics