Automated code generation driven by Large Language Models (LLMs) has enhanced development efficiency, yet generating complex application-level software code remains challenging. Multi-agent frameworks show potential, but existing methods perform inadequately in large-scale application-level software code generation: they fail to maintain a semantically reasonable project structure and generate fragmented outputs that lack traceable requirement-to-code mappings, making them difficult to extend or scale. To address these limitations, this paper proposes KGMACG, a Knowledge-Guided Multi-Agent framework for scalable Code Generation. KGMACG orchestrates three specialized agents in a closed-loop: the Code Organization & Planning Agent (COPA) transforms software requirements specification (SRS) and architectural design document (ADD) into a modular build plan and project skeleton; the Coding Agent (CA) synthesizes repository-level code guided by a five-pillar knowledge base; and the Testing Agent (TA) continuously generates unit tests and feeds failure traces back for rectification. The loop terminates only when the project compiles and achieves \(\geq\) 95% requirement coverage, guaranteeing both syntactic correctness and functional completeness. We evaluate KGMACG on three industrial-scale case studies (E-Commerce, Campus Security, Stock Trading) against six state-of-the-art multi-agent baselines: MetaGPT, AutoGen, CAMEL, CrewAI, ChatDev and CodeAgent. With the same backbone LLMs (DeepSeek R1 and gpt-5-codex-medium), The results indicate that KGMACG advances the automation of application-level software development.
Bo Yang, Xiao Zhang, Weisong Sun et al.· ACM Transactions on Software...· 0 citations
Understanding the architecture is crucial for effectively maintaining and managing large software systems. However, discrepancies often exist between the designed and implemented architectures, which can pose significant risks. To identify these discrepancies, architects need to extract the architecture from the system implementation, which is both time-consuming and error-prone. To simplify this procedure, many automatic architecture recovery techniques have been developed. Yet, their accuracy is often limited. Architects must still invest significant effort in refining recovery results to ensure they accurately reflect the implemented architecture. To reduce such manual effort, we introduce SemRef, a framework that combines LLMs with dependency analysis to automatically refine architectures recovered by existing architecture recovery tools. By leveraging the LLM’s semantic understanding capabilities and integrating structural dependencies, SemRef enhances both the accuracy and the comprehension of recovered architectures. To evaluate SemRef, we tested on 9 projects with published ground-truth architectures and 10 state-of-the-art architecture recovery tools. 5 commonly used metrics are adopted to evaluate the effectiveness of SemRef. The results show that SemRef improves accuracy across various metrics, with normalized gains ranges from 17.72% to 43.35%. Specifically, for MoJoFM and a2aadj metrics, SemRef achieves relative improvements of 118.57% and 100.41%, respectively. Moreover, SemRef is highly scalable. It maintains stable performance across projects ranging from thousands to trillions of lines of code with the cost scale linearly with project size. Further, we test SemRef on various LLMs to demonstrate its generalizability across different models. Beyond improving accuracy, the integration of LLMs enables SemRef to provide a structured module hierarchy and hierarchical module summaries, which further enhance the comprehensibility of recovered architectures.
Yiran Zhang, Chengwei Liu, Yuqiang Sun et al.· arXiv.org· 1 citation
Findings indicate that cross-model collaboration offers a practical and parameter-efficient alternative to scaling up monolithic models for code generation and maintains competitive accuracy when only 20% of test cases are available for diagnostic feedback.
Jiangping Huang, Wen-Guang Ye, Weisong Sun et al.· ACM Transactions on Software...· 0 citations
We use cookies to run the site and, with your consent, for analytics and to show ads.
See our Cookie Policy.