大语言模型时代下声明式软件规约的自动化修复
Automated Repair of Declarative Software Specifications in the Era of Large Language Models
AI总结:
本研究评估了ChatGPT修复Alloy声明式软件规约的效果,发现其整体表现不及现有主流修复技术,但能修复其他方法无法解决的缺陷,同时也存在修复错误、幻觉及结果不一致等问题,为相关从业者提供了参考。
摘要:
声明式软件规约语言的应用日益广泛,加之其本身调试难度较高,凸显出适用于这类语言的高效自动化修复技术的必要性。近期研究者探索了多种自动修复声明式软件规约的方法,例如基于模板的修复、反馈驱动的迭代修复以及有界穷举方法。大语言模型的最新发展为声明式规约的自动修复提供了新的契机。本研究评估了利用OpenAI的ChatGPT修复用Alloy声明式语言编写的软件规约的效果。与命令式语言不同,Alloy中的规约不会被执行,而是会被转换为逻辑公式,并通过后端约束求解器进行求值,以识别规约实例和断言的反例。我们的评估聚焦于ChatGPT通过自动修复提升Alloy声明式规约正确性与完备性的能力。我们分析了ChatGPT生成的结果,并将其与主流的Alloy自动修复方法的结果进行对比。研究表明,尽管ChatGPT的表现不及现有技术,但它能够成功修复其他技术都无法解决的缺陷。我们的分析还发现了ChatGPT生成的修复中存在的错误,包括运算符使用不当、类型错误、高阶逻辑误用以及关系元数不匹配。此外,我们还观察到ChatGPT生成的修复存在幻觉现象以及结果不一致的情况。本研究为考虑将ChatGPT用于声明式规约修复的软件从业者、研究者和工具开发者提供了宝贵的见解。
英文摘要:
The growing adoption of declarative software specification languages, coupled with their inherent difficulty in debugging, has underscored the need for effective and automated repair techniques applicable to such languages. Researchers have recently explored various methods to automatically repair declarative software specifications, such as template-based repair, feedback-driven iterative repair, and bounded exhaustive approaches. The latest developments in large language models provide new opportunities for the automatic repair of declarative specifications. In this study, we assess the effectiveness of utilizing OpenAI's ChatGPT to repair software specifications written in the Alloy declarative language. Unlike imperative languages, specifications in Alloy are not executed but rather translated into logical formulas and evaluated using backend constraint solvers to identify specification instances and counterexamples to assertions. Our evaluation focuses on ChatGPT's ability to improve the correctness and completeness of Alloy declarative specifications through automatic repairs. We analyze the results produced by ChatGPT and compare them with those of leading automatic Alloy repair methods. Our study revealed that while ChatGPT falls short in comparison to existing techniques, it was able to successfully repair bugs that no other technique could address. Our analysis also identified errors in ChatGPT's generated repairs, including improper operator usage, type errors, higher-order logic misuse, and relational arity mismatches. Additionally, we observed instances of hallucinations in ChatGPT-generated repairs and inconsistency in its results. Our study provides valuable insights for software practitioners, researchers, and tool builders considering ChatGPT for declarative specification repairs.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。