Automatic testing of higher order functions

10Citations
Citations of this article
10Readers
Mendeley users who have this article in their library.
Get full text

Abstract

This paper tackles a problem often overlooked in functional programming community: that of testing. Fully automatic test tools like Quickcheck and GVST 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. © Springer-Verlag Berlin Heidelberg 2006.

Cite

CITATION STYLE

APA

Koopman, P., & Plasmeijer, R. (2006). Automatic testing of higher order functions. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) (Vol. 4279 LNCS, pp. 148–164). Springer Verlag. https://doi.org/10.1007/11924661_9

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free