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.
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
Glass, R.: Software runaways: lessons learned from massive software project failures. Prentice-Hall, Englewood Cliffs (1997)
Kaner, C., Falk, J., Nguyen, H.Q.: Testing computer software. John Wiley and Sons, Chichester (1993)
Zhu, H., Hall, P., May, J.: Software unit test coverage and adequacy. ACM Computing Surveys 29(4) (1997)
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)
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)
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)
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)
Sy, N.T., Deville, Y.: Automatic test data generation for programs with integer and float variables. In: Proceedings of ASE 2001 (2001)
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)
Gupta, N., Mathur, A.P., Soffa, M.L.: Generating test data for branch coverage. In: Automated Software Engineering, pp. 219–228 (2000)
Visser, W., Pasareanu, C.S., Khurshid, S.: Test input generation with Java pathfinder. SIGSOFT Softw. Eng. Notes 29(4), 97–107 (2004)
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)
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)
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)
Mycroft, A., O’Keefe, R.: A polymorphic type system for Prolog. Artificial Intelligence 23, 295–307 (1984)
Degrave, F., Vanhoof, W.: A control flow graph for Mercury. In: Proceedings of CICLOPS 2007 (2007)
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)
Leuschel, M.: The dppd library of benchmarks, http://www.ecs.soton.ac.uk/~mal/systems/dppd.html
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)