RealBench: 一个与真实世界软件开发实践对齐的仓库级代码生成基准测试
RealBench: A Repo-Level Code Generation Benchmark Aligned with Real-World Software Development Practices
AI总结:
RealBench通过结合自然语言需求和UML图,评估LLM在结构化设计下的代码生成能力,揭示了LLM在仓库级代码生成中的性能差距和优化策略。
摘要:
编写代码需要大量时间和精力。为自动化此过程,研究人员利用大语言模型(LLMs)进行代码生成并取得了显著进展。许多基准测试如HumanEval和EvoCodeBench已创建以评估LLMs,要求其根据自然语言要求生成代码。然而,在企业应用和团队开发中,开发者通常基于结构化设计或规范编写代码,而非原始自然语言描述。现有基准测试与真实行业开发实践之间存在差距,导致当前基准分数可能无法准确反映代码生成在自动化软件开发任务中的帮助程度。为此,我们提出了RealBench,一个与真实世界行业软件开发实践对齐的仓库级代码生成基准测试。每个示例包含自然语言需求和UML图作为系统设计,匹配开发者通常接收的规范方式。基于构建的基准测试,我们系统地评估了高级LLMs在接收到结构化系统设计时的代码生成能力。实验结果揭示了当前LLMs在与真实世界软件开发实践对齐的仓库级代码生成中的关键见解。首先,我们发现关于仓库级代码生成,LLMs表现较差,且存在显著的性能差距。其次,LLMs擅长查找和创建UML图中定义的模块,但生成的模块质量通常较差,由于语法和逻辑错误。第三,生成整个仓库一次是较小仓库的最佳生成策略,而生成复杂仓库时采用模块化策略比其他策略更有效。
英文摘要:
Writing code requires significant time and effort in software development. To automate this process, researchers have made substantial progress using Large Language Models (LLMs) for code generation. Many benchmarks like HumanEval and EvoCodeBench have been created to evaluate LLMs by requiring them to generate code from natural language requirements. However, in enterprise applications and team development, developers typically write code based on structured designs or specifications rather than raw natural language descriptions. This gap between existing benchmarks and real industry development practices means that current benchmark scores may not accurately reflect how much code generation can help automate software development tasks. To address this gap, we propose RealBench, a repository-level code generation benchmark aligned with real-world industry software development practices. Each example includes both natural language requirements and UML diagrams as system design, matching how developers typically receive specifications. Based on the constructed benchmarks, we conduct a systematic evaluation of advanced LLMs' code generation capabilities when provided with structured system designs. The experimental results reveal key insights in current LLMs' capabilities for repo-level code generation aligned with real-world software development practices. First, we notice that regarding repo-level code generation, LLMs show much worse performance and there are significant performance gaps among LLMs. Second, LLMs are good at finding and creating modules defined in UML diagrams, but the quality of generated modules is often poor due to grammar and logic errors. Third, generating the entire repository at once is the best generation strategy on smaller repositories, while generating a complex repository with the module-by-module strategy works better compared to other strategies.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。