QuickCheck: a lightweight tool for random testing of Haskell programs
ICFP '00 Proceedings of the fifth ACM SIGPLAN international conference on Functional programming
Definitional Interpreters for Higher-Order Programming Languages
Higher-Order and Symbolic Computation
Monads for Functional Programming
Advanced Functional Programming, First International Spring School on Advanced Functional Programming Techniques-Tutorial Text
A Generic Programming Extension for Clean
IFL '02 Selected Papers from the 13th International Workshop on Implementation of Functional Languages
IFL '98 Selected Papers from the 10th International Workshop on 10th International Workshop
Proceedings of the 3rd ACM SIGPLAN international conference on Principles and practice of declarative programming
GAST: generic automated software testing
IFL'02 Proceedings of the 14th international conference on Implementation of functional languages
An effective methodology for defining consistent semantics of complex systems
CEFP'09 Proceedings of the Third summer school conference on Central European functional programming school
An executable and testable semantics for iTasks
IFL'08 Proceedings of the 20th international conference on Implementation and application of functional languages
Generic Executable Semantics for D-Clean
Electronic Notes in Theoretical Computer Science (ENTCS)
Hi-index | 0.00 |
This paper tackles a problem often overlooked in functional programming community: that of testing. Fully automatic test tools like Quickcheck and G∀ST can test first order functions successfully. Higher order functions, HOFs, are an essential and distinguishing part of functional languages. Testing HOFs automatically is still troublesome since it requires the generation of functions as test argument for the HOF to be tested. Also the functions that are the result of the higher order function needs to be identified. If a counter example is found, the generated and resulting functions should be printed, but that is impossible in most functional programming languages. Yet, bugs in HOFs do occur and are usually more subtle due to the high abstraction level. In this paper we present an effective and efficient technique to test higher order functions by using intermediate data types. Such a data type mimics and controls the structure of the function to be generated. A simple additional function transforms this data structure to the function needed. We use a continuation based parser library as main example of the tests. Our automatic testing method for HOFs reveals errors in the library that was used for a couple of years without problems.