Keep Your Laziness in Check

被引:0
|
作者
Foner, Kenneth [1 ]
Zhang, Hengchu [1 ]
Lampropoulos, Leonidas [1 ]
机构
[1] Univ Penn, Philadelphia, PA 19104 USA
基金
美国国家科学基金会;
关键词
Random Testing; Laziness; Haskell; Generic Programming;
D O I
暂无
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
We introduce StrictCheck: a property-based random testing framework for observing, specifying, and testing the strictness of Haskell functions. Strictness is traditionally considered a non-functional property; StrictCheck allows it to be tested as if it were one, by reifying demands on data structures so they can be manipulated and examined within Haskell. Testing strictness requires us to 1) precisely specify the strictness of functions, 2) efficiently observe the evaluation of data structures, and 3) correctly generate functions with random strictness. We tackle all three of these challenges, designing an efficient generic framework for precise dynamic strictness testing. StrictCheck can specify and test the strictness of any Haskell function-including higher-order ones-with only a constant factor of overhead, and requires no boilerplate for testing functions on Haskell-standard algebraic data types. We provide an expressive but low-level specification language as a foundation upon which to build future higher-level abstractions. We demonstrate a non-trivial application of our library, developing a correct specification of a data structure whose properties intrinsically rely on subtle use of laziness: Okasaki's constant-time purely functional queue.
引用
收藏
页数:30
相关论文
共 50 条
  • [1] Keep Your Laziness in Check
    Foner, Kenneth
    Zhang, Hengchu
    Lampropoulos, Leonidas
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES, 2018,
  • [2] Keep your hormones in check: microRNA 394 finetunes brassinosteroid signalling
    Balcerowicz, Martin
    PLANT JOURNAL, 2024, 119 (02): : 639 - 640
  • [3] Keep cancer in check
    Brown, EA
    VETERINARY ECONOMICS, 2000, 41 : 40 - 40
  • [4] KEEP YOUR JOB, KEEP YOUR LIFE - WORKING STIFFS
    HEARD, A
    NEW REPUBLIC, 1994, 211 (8-9) : 11 - 12
  • [5] KEEP YOUR ANTENNAE OUT, KEEP YOUR BATTERIES CHARGED
    MCCLURE, R
    CANADIAN MEDICAL ASSOCIATION JOURNAL, 1988, 139 (10) : 1004 - 1005
  • [6] Brazilians keep Americas in check
    Knight, Patrick
    PPI Pulp and Paper International, 1993, 35 (04): : 63 - 65
  • [7] A plan to keep carbon in check
    Socolow, Robert H.
    Pacala, Stephen W.
    SCIENTIFIC AMERICAN, 2006, 295 (03) : 50 - 57
  • [8] Keep jellyfish numbers in check
    Richardson, Anthony J.
    Pauly, Daniel
    Gibbons, Mark J.
    NATURE, 2012, 483 (7388) : 158 - 158
  • [9] Keep jellyfish numbers in check
    Anthony J. Richardson
    Daniel Pauly
    Mark J. Gibbons
    Nature, 2012, 483 : 158 - 158
  • [10] To Keep Your Customers, Keep It Simple
    Spenner, Patrick
    Freeman, Karen
    HARVARD BUSINESS REVIEW, 2012, 90 (05) : 108 - 114