MaintainCoder: Maintainable Code Generation Under Dynamic Requirements

📅 2025-03-31
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the critical limitation of existing code generation systems—neglect of maintainability and poor adaptability to dynamic requirement changes—by pioneering maintainability as the primary optimization objective. We propose a novel code generation framework designed for continuous evolution, emphasizing high cohesion, low coupling, and easy adaptability. Methodologically, we (1) introduce MaintainBench, the first dynamic maintainability evaluation benchmark; (2) integrate waterfall-style phased governance, design-pattern-driven architectural generation, and multi-agent collaborative reasoning; and (3) incorporate a quantitative dynamic maintenance cost assessment model. Experimental results demonstrate a 14–30% improvement in maintainability metrics on MaintainBench, while simultaneously achieving superior pass@k functional correctness over baseline methods. All code and the MaintainBench benchmark are publicly released.

Technology Category

Application Category

📝 Abstract
Modern code generation has made significant strides in functional correctness and execution efficiency. However, these systems often overlook a critical dimension in real-world software development: maintainability. To handle dynamic requirements with minimal rework, we propose MaintainCoder as a pioneering solution. It integrates Waterfall model, design patterns, and multi-agent collaboration to systematically enhance cohesion, reduce coupling, and improve adaptability. We also introduce MaintainBench, a benchmark comprising requirement changes and corresponding dynamic metrics on maintainance effort. Experiments demonstrate that existing code generation methods struggle to meet maintainability standards when requirements evolve. In contrast, MaintainCoder improves maintainability metrics by 14-30% with even higher correctness, i.e. pass@k. Our work not only provides the foundation of maintainable code generation, but also highlights the need for more holistic code quality research. Resources: https://github.com/IAAR-Shanghai/MaintainCoder.
Problem

Research questions and friction points this paper is trying to address.

Enhancing code maintainability under dynamic requirements
Reducing rework through systematic cohesion and coupling improvements
Addressing maintainability gaps in existing code generation systems
Innovation

Methods, ideas, or system contributions that make the work stand out.

Integrates Waterfall model and design patterns
Uses multi-agent collaboration for maintainability
Introduces MaintainBench for dynamic metrics
🔎 Similar Papers
No similar papers found.