Jadwal Sholat

Memuat jadwal sholatโ€ฆ

Ilmu Komputer & AI editorial

Open AccessOA2026

WiseSpec: Requirements-Driven Agents for Code Generation

A requirements engineering approach to improve LLM-based repository-level code generation
Zhao Tianยท 2026ยท DOI 10.48550/arXiv.2609.00568

The core problem

Code generation aims to automatically generate source code from task requirements and has attracted significant attention with the rapid advancement of large language models (LLMs). Despite remarkable progress, LLMs often struggle to generate correct code for complex software engineering tasks because task descriptions are frequently incomplete, ambiguous, or lack critical contextual information. Existing approaches primarily improve the capabilities of coding agents through more sophisticated tools, skills, and workflows, while largely overlooking the quality of the task requirements themselves. To address this limitation, we draw inspiration from software requirements engineering and propose WiseSpec, a novel requirements-driven agent framework for repository-level code generation. WiseSpec automatically constructs structured and information-rich requirements, assesses their quality through execution-based evaluation, and iteratively refines them to better guide code generation.

Innovation

Experimental results show that WiseSpec consistently outperforms all baselines, achieving an average improvement of 13.17% in %Resolved. The evaluation was conducted on repository-level code generation tasks, where WiseSpec demonstrated superior performance across multiple metrics. The improvement is attributed to the enhanced quality of requirements, which reduces ambiguity and provides critical context for the code generation model. The results indicate that focusing on requirement quality can significantly boost the effectiveness of coding agents, even without changes to the underlying LLM or additional tools.
Code generation aims to automatically generate source code from task requirements and has attracted significant attention with the rapid advancement of large language models (LLMs). Despite remarkable progress, LLMs often struggle to generate correct code for complex software engineering tasks because task descriptions are frequently incomplete, ambiguous, or lack critical contextual information. Existing approaches primarily improve the capabilities of coding agents through more sophisticated tools, skills, and workflows, while largely overlooking the quality of the task requirements themselves. To address this limitation, we draw inspiration from software requirements engineering and propose WiseSpec, a novel requirements-driven agent framework for repository-level code generation. WiseSpec automatically constructs structured and information-rich requirements, assesses their quality through execution-based evaluation, and iteratively refines them to better guide code generation.
WiseSpec operates in three main stages: requirement construction, quality assessment, and iterative refinement. Given an initial task description, the framework first constructs structured requirements by extracting key entities, actions, and constraints, and enriching them with contextual information from the repository. These requirements are represented in a formalized format that includes preconditions, postconditions, and invariants. The quality of the constructed requirements is then assessed through execution-based evaluation: candidate code is generated from the requirements, executed against test cases, and the results are used to compute a requirement quality score. This score guides an iterative refinement loop where the requirements are updated to resolve ambiguities, fill missing information, and correct inconsistencies. The process continues until the requirements are deemed sufficient or a maximum number of iterations is reached. The final requirements are then used to generate the target code. The framework can be formalized as follows: Let be the set of requirements, be the generated code, and be the execution results. The quality score is defined as the pass rate of on test cases derived from . The refinement step updates to such that . The overall objective is to maximize subject to computational constraints.

Why it matters

The success of WiseSpec highlights the importance of task requirements in code generation. By treating requirements as first-class artifacts that can be constructed, evaluated, and refined, the framework addresses a fundamental bottleneck in existing approaches. The execution-based evaluation provides a feedback signal that is directly tied to the correctness of the generated code, enabling targeted improvements. The iterative refinement process mimics best practices from software requirements engineering, where requirements are elaborated and validated before implementation. This work suggests that future coding agents should integrate requirement engineering principles to handle complex, real-world tasks. Limitations include the reliance on test cases for evaluation, which may not always be available or complete. Future work could explore automated test generation and broader applicability to other software engineering tasks.

Who should read this

CS practitioners and researchers

Opening member contentโ€ฆ