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

一种基于ChatGPT和提示工程的快速开发新方法

A Novel Approach for Rapid Development Based on ChatGPT and Prompt Engineering

Youjia Li, Jianjun Shi, Zheng Zhang

AI总结:

本研究利用ChatGPT和提示工程构建Web代码生成平台,通过动态提示构建器显著提升代码生成质量,在多个指标上大幅改进,并验证了实际开发中的有效性。

摘要:

代码生成是现代软件开发中的一项强大技术,能够提高开发效率、减少错误,并促进标准化和一致性。近年来,ChatGPT在自动代码生成方面展现出巨大潜力。然而,现有的代码生成研究缺乏对实际软件开发过程的指导。在本研究中,我们利用ChatGPT开发了一个基于Web的代码生成平台,该平台由关键组件组成:用户界面、提示构建器和后端服务。具体而言,提示构建器动态生成全面的提示以增强模型生成性能。我们在2个数据集上进行了实验,通过8个广泛使用的指标评估生成的代码。结果表明:(1)我们的提示构建器是有效的,使得EM提高了65.06%,BLEU提高了38.45%,CodeBLEU提高了15.70%,Pass@1提高了50.64%。(2)在实际开发场景中,98.5%的测试用例可以通过手动验证得到验证,这凸显了基于ChatGPT的代码生成方法所提供的真正帮助。

英文摘要:

Code generation stands as a powerful technique in modern software development, improving development efficiency, reducing errors, and fostering standardization and consistency. Recently, ChatGPT has exhibited immense potential in automatic code generation. However, existing researches on code generation lack guidance for practical software development process. In this study, we utilized ChatGPT to develop a web-based code generation platform consisting of key components: User Interface, Prompt Builder and Backend Service. Specifically, Prompt Builder dynamically generated comprehensive prompts to enhance model generation performance. We conducted experiments on 2 datasets, evaluating the generated code through 8 widely used metrics.The results demonstrate that (1) Our Prompt Builder is effective, resulting in a 65.06% improvement in EM, a 38.45% improvement in BLEU, a 15.70% improvement in CodeBLEU, and a 50.64% improvement in Pass@1. (2) In real development scenarios, 98.5% of test cases can be validated through manual validation, highlighting the genuine assistance provided by the ChatGPT-based code generation approach.

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

↑