Collaborative Multi-Agent Code Generation and Test-Driven Refactoring in Autonomous Software Engineering

Mitigating Semantic Drift, Tool Execution Errors, and Hallucination Cascades through Role-Specialized Iterative Consensus

Authors

  • Qory Imanda, S.Kom.
  • Muhammad Fezi, S.Kom.
  • Refni Risma Yanti, S.Kom.

Abstract

Automated software engineering powered by large language models (LLMs) has transitioned from rudimentary snippet completion to autonomous end-to-end repository modification. However, single-agent architectures suffer from compounding errors: semantic drift across multi-step plans, unverified tool hallucinations, and unconstrained side-effects in complex codebases. This study investigates the efficacy of collaborative multi-agent architectures in autonomous code refactoring and bug resolution. We design and implement a role-specialized three-agent orchestration pipeline comprising an Architect Agent (task decomposition and contract definition), a Coder Agent (sandboxed patch generation), and a Test-Driven Auditor Agent (automated unit test synthesis and static analysis validation). Evaluating the framework across 14 non-trivial engineering tasks—including reactive framework migrations, database optimization, and secure API endpoints—the multi-agent pipeline demonstrated an 85.7% first-pass verification success rate (Pass@1), compared to 57.1% achieved by a monolithic single-agent baseline. Crucially, the auditor agent intercepted 100% of breaking schema mutations and syntax regressions before deployment, bounding the blast radius through isolated verification loops. These findings establish that iterative consensus and rigorous role separation significantly outstrip monolithic LLM prompting, offering a verifiable paradigm for mission-critical software automation.

References

Downloads

Published

2026-11-07

Issue

Section

Original Research Articles (General Multidisciplinary)

License

Creative Commons Attribution 4.0 International (CC BY 4.0)
Open Access Article
This work is licensed under a Creative Commons Attribution 4.0 International (CC BY 4.0) license.
Screening Plagiarism PASSED
Similarity Index: < 15% (Turnitin Verified). Peer-reviewed with Zero Plagiarism Policy.
Official Letter of Acceptance (LoA) PDF

How to Cite

Citation Style
Loading citation...
Download .RIS

How to Cite

Collaborative Multi-Agent Code Generation and Test-Driven Refactoring in Autonomous Software Engineering: Mitigating Semantic Drift, Tool Execution Errors, and Hallucination Cascades through Role-Specialized Iterative Consensus. (2026). Journal of Tunas Melayu Digital, 1(1), 27-30. https://jutuma.org/index.php/tmd/article/view/multi-agent-code-generation-refactoring
JTMD • Vol 1 No 1 Collaborative Multi-Agent Code Generation and...
Share: