Skip to main content
QUICK REVIEW

[论文解读] Chat2Code: Towards conversational concrete syntax for model specification and code generation, the case of smart contracts

Ilham Qasse, Shailesh Mishra|arXiv (Cornell University)|Dec 21, 2021
Multi-Agent Systems and Negotiation被引用 6
一句话总结

本文提出 Chat2Code,一种利用聊天机器人作为模型驱动工程(MDE)具体语法的对话式接口,使非技术用户能够通过自然语言交互生成智能合约代码。该方法利用自然语言处理技术解析用户输入,将多种术语映射到正式模型元素,并自动生成与平台无关的智能合约代码,经用户体验调查验证,79% 的参与者表示满意度高于平均水平。

ABSTRACT

The revolutionary potential of automatic code generation tools based on Model-Driven Engineering (MDE) frameworks has yet to be realized. Beyond their ability to help software professionals write more accurate, reusable code, they could make programming accessible for a whole new class of non-technical users. However, non-technical users have been slow to embrace these tools. This may be because their concrete syntax is often patterned after the operations of textual or graphical interfaces. The interfaces are common, but users would need more extensive, precise and detailed knowledge of them than they can be assumed to have, to use them as concrete syntax. Conversational interfaces (chatbots) offer a much more accessible way for non-technical users to generate code. In this paper, we discuss the basic challenge of integrating conversational agents within Model-Driven Engineering (MDE) frameworks, then turn to look at a specific application: the auto-generation of smart contract code in multiple languages by non-technical users, based on conversational syntax. We demonstrate how this can be done, and evaluate our approach by conducting user experience survey to assess the usability and functionality of the chatbot framework.

研究动机与目标

  • 通过用对话式聊天机器人作为具体语法替代传统文本或图形化界面,解决 MDE 工具中的可用性差距。
  • 使非技术用户能够通过自然语言交互指定领域模型,并生成准确且可重用的智能合约代码。
  • 降低掌握正式建模符号和工具所涉及的学习曲线与认知负荷。
  • 在真实开发场景中评估基于聊天机器人的框架的可用性与功能性。

提出的方法

  • 设计一种对话式具体语法层,利用自然语言处理与意图识别技术,将自然语言输入映射到正式模型元素。
  • 实现一个聊天机器人框架 iContractBot,集成基于 EMF 的智能合约元模型,以支持在多个区块链平台上的代码生成。
  • 使用 Xatkit 框架实现对话管理、上下文跟踪以及在模型规范过程中的实时反馈。
  • 将用户使用的多样化术语(例如 'integer'、'number'、'float')映射到领域模型中的标准化数据类型,以处理语言歧义。
  • 追踪用户对话以生成模型构件,用于验证、比较与反馈收集。
  • 针对具有不同背景的参与者(非程序员与程序员)开展用户体验调查,以评估框架的可用性与功能性。

实验结果

研究问题

  • RQ1聊天机器人能否作为 MDE 框架中领域特定建模的有效且直观的具体语法?
  • RQ2聊天机器人在多大程度上能够解释并纠正非技术用户提供的模糊或非正式自然语言输入,从而生成正确的模型实例?
  • RQ3与传统建模工具相比,对话式界面在提升可用性与用户满意度方面效果如何?
  • RQ4将用户多样化的术语映射到正式模型元素的机制,在多大程度上保持了规格说明的准确性?
  • RQ5在智能合约开发中使用对话式界面时,用户面临的主要可用性挑战与偏好是什么?

主要发现

  • 在技术与非技术背景的参与者中,79% 的调查对象表示使用 iContractBot 框架的整体体验高于平均水平。
  • 聊天机器人成功解释并纠正了非正式或模糊的用户输入,即使存在语言差异,仍能实现准确的模型与代码生成。
  • 非技术用户认为对话式界面显著优于传统建模工具,减少了对正式培训的需求。
  • 该框架在多个区块链平台上,成功实现了从对话式输入生成与平台无关的智能合约代码,证明了其可行性。
  • 用户反馈表明,对混合式对话-图形界面、模板化合约以及自动补全功能存在强烈需求,提示未来可进行相应增强。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。