A Framework for Guided Test Case Generation in Constraint Logic Programming

  • José Miguel Rojas
  • Miguel Gómez-Zamalloa
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7844)


Performing test case generation by symbolic execution on large programs becomes quickly impracticable due to the path explosion problem. A common limitation that this problem poses is the generation of unnecessarily large number of possibly irrelevant or redundant test cases even for medium-size programs. Tackling the path explosion problem and selecting high quality test cases are considered major challenges in the software testing community. In this paper we propose a constraint logic programming-based framework to guide symbolic execution and thus test case generation towards a more relevant and potentially smaller subset of paths in the program under test. The framework is realized as a tool and empirical results demonstrate its applicability and effectiveness. We show how the framework can help to obtain high quality test cases and to alleviate the scalability issues that limit most symbolic execution-based test generation approaches.


Constraint Logic Programming Guided Test Case Generation Software Testing Symbolic Execution Trace-abstraction 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Albert, E., Gómez-Zamalloa, M., Puebla, G.: Test Data Generation of Bytecode by CLP Partial Evaluation. In: Hanus, M. (ed.) LOPSTR 2008. LNCS, vol. 5438, pp. 4–23. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  2. 2.
    Albert, E., Cabañas, I., Flores-Montoya, A., Gómez-Zamalloa, M., Gutiérrez, S.: jPET: an Automatic Test-Case Generator for Java. In: Proc. of WCRE 2011. IEEE Computer Society (2011)Google Scholar
  3. 3.
    Ball, T.: Abstraction-guided test generation: A case study. Technical Report MSR-TR-2003-86, Microsoft Research (2003)Google Scholar
  4. 4.
    Cadar, C., Godefroid, P., Khurshid, S., Pǎsǎreanu, C., Sen, K., Tillmann, N., Visser, W.: Symbolic execution for software testing in practice: preliminary assessment. In: Proc. of ICSE 2011. ACM (2011)Google Scholar
  5. 5.
    Craig, S.-J., Gallagher, J.P., Leuschel, M., Henriksen, K.S.: Fully Automatic Binding-Time Analysis for Prolog. In: Etalle, S. (ed.) LOPSTR 2004. LNCS, vol. 3573, pp. 53–68. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  6. 6.
    Debray, S.K.: Static inference of modes and data dependencies in logic programs. ACM Trans. Program. Lang. Syst. 11(3), 418–450 (1989)CrossRefGoogle Scholar
  7. 7.
    Gómez-Zamalloa, M., Albert, E., Puebla, G.: Decompilation of Java Bytecode to Prolog by Partial Evaluation. Information and Software Technology 51(10), 1409–1427 (2009)CrossRefGoogle Scholar
  8. 8.
    Gómez-Zamalloa, M., Albert, E., Puebla, G.: Test Case Generation for Object-Oriented Imperative Languages in CLP. Theory and Practice of Logic Programming, ICLP 2010 Special Issue 10(4-6) (2010)Google Scholar
  9. 9.
    Goodrich, M., Tamassia, R., Zamore, E.: The net.datastructures package,
  10. 10.
    King, J.C.: Symbolic Execution and Program Testing. Communications of the ACM 19(7), 385–394 (1976)zbMATHCrossRefGoogle Scholar
  11. 11.
    Lakhnech, Y., Bensalem, S., Berezin, S., Owre, S.: Incremental verification by abstraction. In: Margaria, T., Yi, W. (eds.) TACAS 2001. LNCS, vol. 2031, pp. 98–112. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  12. 12.
    Pǎsǎreanu, C.S., Visser, W.: A survey of new trends in symbolic execution for software testing and analysis. Int. J. Softw. Tools Technol. Transf. 11(4), 339–353 (2009)CrossRefGoogle Scholar
  13. 13.
    Rungta, N., Mercer, E.G., Visser, W.: Efficient testing of concurrent programs with abstraction-guided symbolic execution. In: Păsăreanu, C.S. (ed.) SPIN 2009. LNCS, vol. 5578, pp. 174–191. Springer, Heidelberg (2009) CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2013

Authors and Affiliations

  • José Miguel Rojas
    • 1
  • Miguel Gómez-Zamalloa
    • 2
  1. 1.Technical University of MadridSpain
  2. 2.DSICComplutense University of MadridSpain

Personalised recommendations