paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Requirement-Guided Test-Driven Development for Modular Code Generation with Large Language Model

需求引导的测试驱动开发:基于大语言模型的模块化代码生成
FSE Proceedings of the 34th ACM International Conference on the Foundations of Software Engineering2026匹配度 2/10 · 该论文聚焦于用需求抽取+测试驱动流水线提升 LLM 代码生成的可靠性,属于以 LLM 本身能力/生成为目标的工作;它与用户关注的“用静态分析/形式化方法分析 Agentic 或 ML 程序”以及“用 LLM 改进静态分析与形式化验证”都不直接相关,也不涉及浮点或贝叶斯程序分析。测试仅作为生成过程的执行反馈,而非静态分析技术本身。引用 0 inbox
Wasay Mohammed Abdul, Ragib Shahariar Ayon, Shibbir Ahmed, Rodion Podorozhny
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出需求引导的测试驱动流水线,抽取功能需求并映射到MVC模块,先测后码再执行驱动修复,提升LLM代码生成可靠性。

大语言模型(LLM)能够直接从自然语言问题描述合成软件,但可靠性不足:模型可能臆造功能,生成的测试与代码可能不一致,修复往往依赖人工。本文提出一种测试驱动流水线:首先从问题描述中抽取功能需求(FR),解析需求间依赖,并将其映射到模块化的 MVC 结构;然后在生成代码之前先生成测试,最后进行有界的、由执行结果驱动的精化修复。评估方面,作者用 Pass@1 和 refine@k 衡量执行可靠性,并用基于自然语言推理(NLI)的蕴含判断来评估功能需求抽取的忠实度。该工作将需求工程、测试驱动开发与 LLM 代码生成相结合,旨在减少幻觉、保持测试与代码一致并降低人工修复成本。

问题
LLM 直接由自然语言描述合成代码不可靠,容易出现功能幻觉、测试与代码不一致,且修复需人工介入。
方法
提出需求引导的测试驱动流水线:抽取功能需求并解析依赖,映射到模块化 MVC 结构,先生成测试再生成代码,并进行有界、执行驱动的精化。
评估
用 Pass@1 与 refine@k 评估生成代码的执行可靠性,并用基于 NLI 的蕴含判断评估功能需求抽取的忠实度。
原文摘要(Abstract)

Large Language Models (LLMs) show promise for synthesizing software directly from natural-language problem descriptions. However, LLM-based code synthesis remains unreliable: models may hallucinate features, generated tests and code may diverge, and repairs often require manual effort. We present a test-driven pipeline that extracts functional requirements (FR) from a problem description, resolves dependencies, maps them into a modular Model-View-Controller (MVC) structure, and generates tests before code, followed by bounded, execution-driven refinement. We evaluate execution reliability with Pass@1 and refine@k, and assess the faithfulness of FR extraction using NLI-based entailment.

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@inproceedings{AbdulAAP26,
  title = {Requirement-Guided Test-Driven Development for Modular Code Generation with Large Language Model},
  author = {Wasay Mohammed Abdul and Ragib Shahariar Ayon and Shibbir Ahmed and Rodion Podorozhny},
  booktitle = {FSE},
  year = {2026},
  doi = {10.1145/3803437.3807385}
}