Automatic testing of higher order functions

被引:0
|
作者
Koopman, Pieter [1 ]
Plasmeijer, Rinus [1 ]
机构
[1] Nijmegen Inst Comp & Informat Sci, Nijmegen, Netherlands
关键词
D O I
暂无
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
This paper tackles a problem often overlooked in functional programming community: that of testing. Fully automatic test tools like Quickcheck and G for all 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.
引用
收藏
页码:148 / +
页数:3
相关论文
共 50 条
  • [1] HIGHER ORDER AUTOMATIC DIFFERENTIATION OF HIGHER ORDER FUNCTIONS
    Huot, Mathieu
    Staton, Sam
    Vakar, Matthijs
    [J]. LOGICAL METHODS IN COMPUTER SCIENCE, 2022, 18 (01) : 41:1 - 41:34
  • [2] Higher-order automatic differentiation of mathematical functions
    Charpentier, Isabelle
    Dal Cappello, Claude
    [J]. COMPUTER PHYSICS COMMUNICATIONS, 2015, 189 : 66 - 71
  • [3] Sound and Complete Concolic Testing for Higher-order Functions
    You, Shu-Hung
    Findler, Robert Bruce
    Dimoulas, Christos
    [J]. PROGRAMMING LANGUAGES AND SYSTEMS, ESOP 2021, 2021, 12648 : 635 - 663
  • [4] Arbogast: Higher order automatic differentiation for special functions with Modular C
    Charpentier, Isabelle
    Gustedt, Jens
    [J]. OPTIMIZATION METHODS & SOFTWARE, 2018, 33 (4-6): : 963 - 987
  • [5] Perturbation confusion in forward automatic differentiation of higher-order functions
    Manzyuk, Oleksandr
    Pearlmutter, Barak A.
    Radul, Alexey Andreyevich
    Rush, David R.
    Siskind, Jeffrey Mark
    [J]. JOURNAL OF FUNCTIONAL PROGRAMMING, 2019, 29
  • [6] Higher order invex functions and higher order pseudoinvex ones
    Ivanov, Vsevolod I.
    [J]. APPLICABLE ANALYSIS, 2013, 92 (10) : 2152 - 2167
  • [7] On convex functions of higher order
    Gilanyi, Attila
    Pales, Zsolt
    [J]. MATHEMATICAL INEQUALITIES & APPLICATIONS, 2008, 11 (02): : 271 - 282
  • [8] ON HIGHER ORDER BAZILEVIC FUNCTIONS
    Noor, Khalida Inayat
    Ahmad, Khalil
    [J]. INTERNATIONAL JOURNAL OF MODERN PHYSICS B, 2013, 27 (04):
  • [9] TESTING HIGHER VISUAL FUNCTIONS
    QUIGLEY, JH
    [J]. AMERICAN JOURNAL OF OPHTHALMOLOGY, 1959, 48 (06) : 819 - 823
  • [10] Higher Order Mutation Testing
    Jia, Yue
    Harman, Mark
    [J]. INFORMATION AND SOFTWARE TECHNOLOGY, 2009, 51 (10) : 1379 - 1393