Architecture Recovery Revisited: A Hybrid Knowledge Graph and LLM-Based Approach
Abstract
Software architecture recovery has long been central to research in program understanding and reengineering. Understanding and modernizing large-scale legacy software requires accurate reconstruction of its architectural structure. Traditional recovery approaches based on code clustering or template matching struggle to deliver semantically meaningful decompositions, especially in the face of architectural drift and inadequate documentation. We present a hybrid architecture recovery method that integrates Large Language Models (LLMs) with a property-based Knowledge Graph derived directly from source code. Our approach iteratively explores, proposes, and refines component boundaries through a three-phase process: Explore, Allocate, and Shift. This process combines structural analysis with semantic reasoning and prompt engineering to produce coherent component hierarchies. We evaluate our system on three real-world C codebases (cJSON, SQLite, and Bash), and compare the recovered architectures against established reference architectures and gold standards.