用真实项目评测大模型做软件设计的能力,发现它在建模上仍有短板。
From What to How: Bridging User Requirements with Software Development Using Large Language Models
- 构建包含30个项目的专用评测基准,覆盖需求到测试全流程
- 大模型生成代码时缺乏设计会严重出错,但能写出合格的测试用例
- 适合关注AI辅助开发、软件工程自动化的研究者和开发者
近期大型语言模型(LLMs)被广泛用于提升开发效率,催生了众多评估性能的基准。然而这些基准主要聚焦代码实现,忽视了同样关键的软件设计环节。为此,本文提出DesBench——一个面向软件设计任务的感知型评测基准,涵盖设计驱动的代码生成、面向对象建模以及验收测试用例设计三类任务。DesBench包含30个手工构建的Java项目,涵盖需求文档、设计模型、实现代码与验收测试,总计30个设计模型、194个Java类和737个测试用例。我们使用七款前沿大模型(包括三个DeepSeek R1、两个Qwen2.5和两个GPT模型)进行评估。结果表明,大模型在软件设计方面仍面临显著挑战:(1) 仅提供高层或无设计信息时,生成代码正确率大幅下降;(2) 在面向对象建模中,虽能准确识别对象与类,但难以定义操作与类间关系;(3) 从功能需求自动生成的验收测试用例,在代码覆盖率上可达到人类水平。研究揭示了当前大模型在处理软件设计方面的局限性,呼吁探索更适合大模型开发的新设计方法与语言。
原文摘要 · Abstract (English)
Recently, large language models (LLMs) are extensively utilized to enhance development efficiency, leading to numerous benchmarks for evaluating their performance. However, these benchmarks predominantly focus on implementation, overlooking the equally critical aspect of software design. This gap raises two pivotal questions: (1) Can LLMs handle software design? (2) Can LLMs write code following the specific designs? To investigate these questions, this paper proposes DesBench, a design-aware benchmark for evaluating LLMs on three software design-related tasks: design-aware code generation, object-oriented modeling, and the design of acceptance test cases. DesBench comprises 30 manually crafted Java projects that include requirement documents, design models, implementations, and acceptance tests, amounting to a total of 30 design models, 194 Java classes, and 737 test cases. We evaluated seven state-of-the-art LLMs, including three DeepSeek R1, two Qwen2.5, and two GPT models, using DesBench. The results reveal that LLMs remain significantly challenged by the intricacies of software design: (1) For code generation, LLMs struggle to produce correct implementations when provided with only high-level or no designs. (2) In object-oriented modeling, while LLMs can accurately identify objects and classes, they face challenges in defining operations and inter-class relationships. (3) Acceptance test cases generated by LLMs from functional requirements achieve code coverage quality comparable to those written by humans. Our research highlights the current limitations of LLMs in managing software design and calls for further investigation into new design methodologies and languages suitable for LLM-based development.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。