arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2406.10101cs.SE
收藏

需求即你所需:使用 LLM 从需求到代码

Requirements are All You Need: From Requirements to Code with LLMs

Bingyang Wei

AI总结:

本文提出定制化 LLM 与 Progressive Prompting 方法,按需求分析、面向对象建模、单元测试到代码生成的渐进流程实现从需求文档到代码的自动化,并通过 Web 项目案例验证其有效性。

摘要:

文本格式在软件需求文档中的普遍使用,为将大型语言模型(LLM)应用于软件工程任务提供了绝佳机会。高质量的软件需求不仅能够改进人工软件开发流程,还能使组织充分发挥新兴 LLM 技术的潜力。本文介绍了一种定制化 LLM,用于根据结构良好的需求文档自动生成代码片段。该 LLM 增强了与软件开发过程、需求分析、面向对象设计和测试驱动开发相关的知识、启发式方法和指令,有效模拟了经验丰富的软件工程师的专业能力。我们提出了一种“Progressive Prompting”方法,使软件工程师能够以逐步推进的方式与该 LLM 协作。通过这种方法,LLM 增量地处理软件开发任务:解释所提供的需求以提取功能需求,利用这些需求创建面向对象模型,随后基于面向对象设计生成单元测试和代码。我们通过一个聚焦于 Web 项目开发的案例研究,展示了该 LLM 在理解复杂用户需求以及生成稳健设计和代码解决方案方面的能力。本研究强调了将 LLM 集成到软件开发工作流中以显著提升效率和质量的潜力。该定制化 LLM 可在 https://chat.openai.com/g/g-bahoiKzkB-software-engineer-gpt 获取。

英文摘要:

The pervasive use of textual formats in the documentation of software requirements presents a great opportunity for applying large language models (LLMs) to software engineering tasks. High-quality software requirements not only enhance the manual software development process but also position organizations to fully harness the potential of the emerging LLMs technology. This paper introduces a tailored LLM for automating the generation of code snippets from well-structured requirements documents. This LLM is augmented with knowledge, heuristics, and instructions that are pertinent to the software development process, requirements analysis, object-oriented design, and test-driven development, effectively emulating the expertise of a seasoned software engineer. We introduce a "Progressive Prompting" method that allows software engineers to engage with this LLM in a stepwise manner. Through this approach, the LLM incrementally tackles software development tasks by interpreting the provided requirements to extract functional requirements, using these to create object-oriented models, and subsequently generating unit tests and code based on the object-oriented designs. We demonstrate the LLM's proficiency in comprehending intricate user requirements and producing robust design and code solutions through a case study focused on the development of a web project. This study underscores the potential of integrating LLMs into the software development workflow to significantly enhance both efficiency and quality. The tailored LLM is available at https://chat.openai.com/g/g-bahoiKzkB-software-engineer-gpt.

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

↑