Applying Evolutionary Techniques to Debug Functional Programs

  • Alberto de la Encina
  • Mercedes Hidalgo-Herrero
  • Pablo Rabanal
  • Fernando Rubio
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5517)


Selecting an appropriate test suite to detect faults in a program is a difficult task. In the case of functional languages, altough there are some additional difficulties (due to the lack of state, laziness and its higher-order nature), we can also take advantage of higher-order programming to allow defining generic ways of obtaining tests. In this paper we present a genetic algorithm to automatically select appropriate criteria to generate tests for Haskell programs. As a case study, we apply the algorithm to deal with a program using red-black trees.


Genetic Algorithm Test Suite Functional Program System Under Test Functional Language 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Bottaci, L., Mresa, E.S.: Efficiency of mutation operators and selective mutation strategies: An empirical study. Software Testing, Verification and Reliability 9(4), 205–232 (1999)CrossRefGoogle Scholar
  2. 2.
    Cheon, Y., Leavens, G.T.: A simple and practical approach to unit testing: The JML and JUnit way. In: Magnusson, B. (ed.) ECOOP 2002. LNCS, vol. 2374, pp. 231–255. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  3. 3.
    Davis, L. (ed.): Handbook of Genetic Algorithms. Van Nostrand Reinhold (1991)Google Scholar
  4. 4.
    Do, H., Rothermel, G., Kinneer, A.: Prioritizing JUnit test cases: An empirical assessment and cost-benefits analysis. Empirical Software Engineering 11(1), 33–70 (2006)CrossRefGoogle Scholar
  5. 5.
    Howden, W.E.: Weak mutation testing and completeness of test sets. IEEE Transactions on Software Engineering 8, 371–379 (1982)CrossRefGoogle Scholar
  6. 6.
    Lee, D., Yannakakis, M.: Principles and methods of testing finite state machines: A survey. Proceedings of the IEEE 84(8), 1090–1123 (1996)CrossRefGoogle Scholar
  7. 7.
    Petrenko, A.: Fault model-driven test derivation from finite state models: Annotated bibliography. In: Cassez, F., Jard, C., Rozoy, B., Dermot, M. (eds.) MOVEP 2000. LNCS, vol. 2067, pp. 196–205. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  8. 8.
    Peyton Jones, S.L., Hughes, J.: Report on the programming language Haskell 98. Technical report (February 1999),
  9. 9.
    Rabanal, P., Rodríguez, I., Rubio, F.: Finding minimum spanning/distances trees by using river formation dynamics. In: Dorigo, M., Birattari, M., Blum, C., Clerc, M., Stützle, T., Winfield, A.F.T. (eds.) ANTS 2008. LNCS, vol. 5217, pp. 60–71. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  10. 10.
    Reeves, C.R., Rowe, J.E.: Genetic Algorithms: Principles and Perspectives: a Guide to GA Theory. Kluwer Academic Publishers, Dordrecht (2002)zbMATHGoogle Scholar
  11. 11.
    Rodríguez, I., Merayo, M.G., Núñez, M.: \(\mathcal{HOTL}\): Hypotheses and observations testing logic. Journal of Logic and Algebraic Programming 74(2), 57–93 (2008)MathSciNetCrossRefzbMATHGoogle Scholar
  12. 12.
    Rothlauf, F., Goldberg, D.E.: Representations for Genetic and Evolutionary Algorithms. Physica-Verlag (2006)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2009

Authors and Affiliations

  • Alberto de la Encina
    • 1
  • Mercedes Hidalgo-Herrero
    • 1
  • Pablo Rabanal
    • 1
  • Fernando Rubio
    • 1
  1. 1.Universidad Complutense de MadridMadridSpain

Personalised recommendations