Generating Software Architecture Description from Source Code using Reverse Engineering and Large Language Model

Software Architecture Descriptions (SADs) are indispensable for navigating the complexity of modern software systems. They enable high-level reasoning, guide design decisions, and facilitate communication among diverse stakeholders. Yet in practice, SADs are frequently missing, outdated, or poorly aligned with the system’s actual implementation. As a result, developers are forced to derive architectural insights directly from source code—a time-intensive task that increases mental effort, slows onboarding, and contributes to the gradual degradation of architectural clarity over a system’s lifetime. To address these challenges, we propose an automated generation of SADs from source code by combining reverse engineering (RE) techniques with Large Language Model (LLM). Our approach recovers both static and behavioral views by extracting a comprehensive component diagram, filters architecturally significant elements—core components—via prompt-guided LLM analysis, and generates state machine diagrams to model component behavior based on code logic. This dual-view representation offers a scalable and maintainable alternative to manual architectural documentation. This approach, demonstrated with C++ examples, showcases the potent capability of LLMs to: 1) find abstract component diagram, lowering the reliance on human expert involvement, and 2) represent complex software behaviors, especially when enriched with domain-specific knowledge through few-shot prompting. These findings suggest a viable path toward reducing manual effort while enhancing system understanding and long-term maintainability.

Paper

References (38)

Scroll for more · 26 remaining

Similar papers

© 2026 NYSGPT2525 LLC