When AI Refactors Code: An Expert-informed Framework for Assessing Long-term Maintainability and Architectural Drift - Jhawar, Sourabh (Journal of Computer Based Parallel Programming, 2026)
Artificial Intelligence (AI), including large language models, is increasingly used to identify, recommend, and implement software refactoring. Existing evaluations primarily emphasize immediate structural outcomes, including reduced complexity, improved cohesion, increased testability, and removal of code smells. However, limited guidance exists for determining whether such improvements remain beneficial across multiple development cycles or contribute to architectural drift, technical debt, and knowledge loss. This study develops an expert-informed framework for assessing long-term maintainability in AI-refactored software systems. A focused narrative synthesis of literature on software refactoring, maintainability, architectural erosion, software evolution, and AI-assisted software engineering informed a preliminary conceptual model. The model was subsequently refined through semi-structured interviews with three senior practitioners representing quality engineering, enterprise architecture, cloud infrastructure, and production operations. Hybrid deductive-inductive thematic analysis produced four integrated findings: long-term maintainability is multidimensional and temporal; repeated context-limited optimization may accumulate into architectural drift; assessment requires structural, architectural, contextual, governance, and operational evidence; and expert knowledge should be embedded through persistent architectural context, machine-enforceable controls, risk-based review, and operational feedback. These findings informed the AI Refactoring Maintainability and Drift Assessment Framework (AI-RMDAF), which links an approved system baseline, multidimensional assessment, risk classification, deployment monitoring, and continuous organizational learning. The study contributes an exploratory conceptual framework that provides a foundation for future empirical and longitudinal validation rather than a statistically or predictively validated model. It offers researchers a structured agenda for longitudinal evaluation and provides practitioners with a governance-oriented approach for preserving architectural intent while retaining the productivity advantages of AI-assisted refactoring.