Validation is a central activity when developing formal specifications. Similarly to coding, a possible validation technique is to define upfront test cases or scenarios that a future specification should satisfy or not. Unfortunately, specifying such test cases is burdensome and error prone, which could cause users to skip this validation task. This paper reports the results of an empirical evaluation of using pre-trained large language models (LLMs) to automate the generation of test cases from natural language requirements. In particular, we focus on test cases for structural requirements of simple domain models formalized in the Alloy specification language. Our evaluation focuses on the state-of-the-art GPT-5 model, but results from other closed- and open-source LLMs are also reported. The results show that, in this context, GPT-5 is already quite effective at generating positive (and negative) test cases that are syntactically correct and that satisfy (or not) the given requirement, and that can detect many wrong specifications written by humans.


翻译:验证是开发形式化规约的核心活动。与编码类似,一种可行的验证技术是预先定义测试用例或场景,这些用例或场景应当(或不应当)被未来的规约所满足。然而,指定此类测试用例既繁琐又容易出错,可能导致用户跳过这一验证任务。本文报告了一项实证评估的结果,该评估旨在利用预训练大语言模型(LLM)从自然语言需求自动生成测试用例。我们特别关注针对简单领域模型的结构性需求所生成的测试用例,这些模型使用Alloy规约语言进行形式化描述。评估主要聚焦于当前最先进的GPT-5模型,同时也报告了其他闭源与开源LLM的结果。结果表明,在此背景下,GPT-5已能较为有效地生成语法正确、满足(或不满足)给定需求的正向(与负向)测试用例,并能检测出许多由人工编写的错误规约。

0
下载
关闭预览

相关内容

《软件定义网络元素与机器代码的形式化验证》
专知会员服务
12+阅读 · 2025年11月18日
【2023新书】程序证明,Program Proofs,642页pdf
专知会员服务
67+阅读 · 2023年3月29日
专知会员服务
34+阅读 · 2021年5月8日
智能合约的形式化验证方法研究综述
专知
16+阅读 · 2021年5月8日
异常检测论文大列表:方法、应用、综述
专知
126+阅读 · 2019年7月15日
手把手教你用LDA特征选择
AI研习社
12+阅读 · 2017年8月21日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
9+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
10+阅读 · 2013年12月31日
VIP会员
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
9+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
10+阅读 · 2013年12月31日
Top
微信扫码咨询专知VIP会员