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