MaintainCoder: Maintainable Code Generation Under Dynamic Requirements

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Wang, Zhengren, Ling, Rui, Wang, Chufan, Yu, Yongan, Wang, Sizhe, Li, Zhiyu, Xiong, Feiyu, Zhang, Wentao
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866908564448083968
author Wang, Zhengren
Ling, Rui
Wang, Chufan
Yu, Yongan
Wang, Sizhe
Li, Zhiyu
Xiong, Feiyu
Zhang, Wentao
author_facet Wang, Zhengren
Ling, Rui
Wang, Chufan
Yu, Yongan
Wang, Sizhe
Li, Zhiyu
Xiong, Feiyu
Zhang, Wentao
contents 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 the Waterfall model, design patterns, and multi-agent collaboration to systematically enhance cohesion, reduce coupling, achieving clear responsibility boundaries and better maintainability. We also introduce MaintainCoder, a benchmark comprising requirement changes and novel dynamic metrics on maintenance efforts. Experiments demonstrate that existing code generation methods struggle to meet maintainability standards when requirements evolve. In contrast, MaintainCoder improves dynamic maintainability metrics by more than 60% with even higher correctness of initial codes. Furthermore, while static metrics fail to accurately reflect maintainability and even contradict each other, our proposed dynamic metrics exhibit high consistency. Our work not only provides the foundation for maintainable code generation, but also highlights the need for more realistic and comprehensive code generation research. Resources: https://github.com/IAAR-Shanghai/MaintainCoder.
format Preprint
id arxiv_https___arxiv_org_abs_2503_24260
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle MaintainCoder: Maintainable Code Generation Under Dynamic Requirements
Wang, Zhengren
Ling, Rui
Wang, Chufan
Yu, Yongan
Wang, Sizhe
Li, Zhiyu
Xiong, Feiyu
Zhang, Wentao
Software Engineering
Computation and Language
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 the Waterfall model, design patterns, and multi-agent collaboration to systematically enhance cohesion, reduce coupling, achieving clear responsibility boundaries and better maintainability. We also introduce MaintainCoder, a benchmark comprising requirement changes and novel dynamic metrics on maintenance efforts. Experiments demonstrate that existing code generation methods struggle to meet maintainability standards when requirements evolve. In contrast, MaintainCoder improves dynamic maintainability metrics by more than 60% with even higher correctness of initial codes. Furthermore, while static metrics fail to accurately reflect maintainability and even contradict each other, our proposed dynamic metrics exhibit high consistency. Our work not only provides the foundation for maintainable code generation, but also highlights the need for more realistic and comprehensive code generation research. Resources: https://github.com/IAAR-Shanghai/MaintainCoder.
title MaintainCoder: Maintainable Code Generation Under Dynamic Requirements
topic Software Engineering
Computation and Language
url https://arxiv.org/abs/2503.24260