Property-based testing (PBT) is a popular technique for establishing confidence in software, where users write properties -- i.e., executable specifications -- that can be checked many times in a loop by a testing framework. In modern PBT frameworks, properties are usually written in shallowly embedded domain-specific languages, and their definition is tightly coupled to the way they are tested. Such frameworks often provide convenient configuration options to customize aspects of the testing process, but users are limited to precisely what library authors had the prescience to allow for when developing the framework; if they want more flexibility, they may need to write a new framework from scratch. We propose a new, deeper language for properties based on a mixed embedding that we call deferred binding abstract syntax, which reifies properties as a data structure and decouples them from the property runners that execute them. We implement this language in Rocq and Racket, leveraging the power of dependent and dynamic types, respectively. Finally, we showcase the flexibility of this new approach by rapidly prototyping a variety of property runners, highlighting domain-specific testing improvements that can be unlocked by more programmable testing.


翻译:基于属性的测试(Property-based testing, PBT)是一种建立软件信心的流行技术,用户编写属性(即可执行的规约),测试框架可以多次循环检查这些属性。在现代PBT框架中,属性通常以浅层嵌入的领域特定语言编写,其定义与测试方式紧密耦合。这类框架通常提供便捷的配置选项以定制测试过程的各个方面,但用户仅限于库作者在开发框架时有先见之明所允许的范围;若需要更大的灵活性,则可能需要从头编写新的框架。我们提出了一种基于混合嵌入的新型深层属性语言,称之为延迟绑定抽象语法,它将属性具体化为数据结构,并将其与执行属性的属性运行器解耦。我们分别在Rocq和Racket中实现了该语言,分别利用了依赖类型和动态类型的能力。最后,我们通过快速原型化多种属性运行器,展示了这种新方法的灵活性,突显了通过更可编程的测试所能实现的领域特定测试改进。

0
下载
关闭预览

相关内容

一个具体事物,总是有许许多多的性质与关系,我们把一个事物的性质与关系,都叫作事物的属性。 事物与属性是不可分的,事物都是有属性的事物,属性也都是事物的属性。 一个事物与另一个事物的相同或相异,也就是一个事物的属性与另一事物的属性的相同或相异。 由于事物属性的相同或相异,客观世界中就形成了许多不同的事物类。具有相同属性的事物就形成一类,具有不同属性的事物就分别地形成不同的类。
《软件定义网络元素与机器代码的形式化验证》
专知会员服务
13+阅读 · 2025年11月18日
《信息技术实时定位系统性能测试方法》国家标准意见稿
《智能制造机器视觉在线检测测试方法》国家标准意见稿
《人工智能芯片基准测试评估方法》行业标准
专知会员服务
87+阅读 · 2022年2月20日
【IJCAI2021】​单样本可供性检测
专知会员服务
10+阅读 · 2021年8月27日
基于区域的目标检测——细粒度
计算机视觉战队
14+阅读 · 2018年2月1日
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
10+阅读 · 2013年12月31日
Arxiv
0+阅读 · 3月14日
Arxiv
0+阅读 · 2月26日
Arxiv
0+阅读 · 1月30日
VIP会员
最新内容
最新“指挥控制”领域出版物合集(简介)
专知会员服务
1+阅读 · 今天15:19
面向军事作战需求开发的人工智能(RAIMOND)
专知会员服务
3+阅读 · 今天15:13
软件定义多域战术网络:基础与未来方向(综述)
水下战战术决策中的气象与海洋预报(50页报告)
远程空中优势:新一代超视距导弹的兴起
专知会员服务
1+阅读 · 今天14:45
大语言模型溯因推理的统一分类学与综述
专知会员服务
0+阅读 · 今天12:07
相关基金
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
10+阅读 · 2013年12月31日
Top
微信扫码咨询专知VIP会员