arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2309.04696cs.PL
收藏

pun:属性之趣;迈向一种内置程序验证设施的编程语言

pun: Fun with Properties; Towards a Programming Language With Built-in Facilities for Program Validation

Triera Gashi, Sophie Adeline Solheim Bosio, Joachim Tilsted Kristensen, Michael Kirkedal Thomsen

AI总结:

本文提出并形式化了一种内置属性验证机制的函数式编程语言 pun,通过自动生成输入数据降低基于属性测试的准入门槛,并在二叉搜索树库上验证了其有效性。

摘要:

基于属性的测试是验证程序正确性的强大方法。然而,由于准入门槛很高,它在工业界并未得到广泛使用。障碍之一是编写生成随机输入数据所需的生成器。程序属性通常以复杂的数据结构作为输入,而以保持不变式的方式为这些结构编写生成器需要耗费大量精力。在本文中,我们提出并形式化了一种新的编程语言 pun;这是一种简单的函数式编程语言,将属性作为程序验证的内置机制。我们展示了如何自动为 pun 属性生成输入,从而为程序员使用基于属性的测试提供低准入门槛。我们在一个二叉搜索树库上评估了我们的工作,并将测试结果与 Haskell 中的类似库进行了比较。

英文摘要:

Property-based testing is a powerful method to validate program correctness. It is, however, not widely use in industry as the barrier of entry can be very high. One of the hindrances is to write the generators that are needed to generate randomised input data. Program properties often take complicated data structures as inputs and, it requires a significant amount of effort to write generators for such structures in a invariant preserving way. In this paper, we suggest and formalise a new programming language \textsf{pun}; a simple functional programming with properties as a built-in mechanism for program validation. We show how to generate input for \textsf{pun} properties automatically, thus, providing the programmer with a low barrier of entry for using property-based testing. We evaluate our work a on library for binary search trees and compare the test results to a similar library in Haskell.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑