Embedding Software Intent: Lightweight Java Module Recovery
Yirui He, Yuqi Huai, Xingyu Chen, Joshua Garcia · 2025
Read Embedding Software Intent: Lightweight Java Module Recovery by Yirui He, Yuqi Huai, Xingyu Chen, Joshua Garcia (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2512-15980.txt.
Introduction
Yirui He and co authors present ClassLAR, a lightweight method for recovering Java modules from monolithic systems, in a 2025 paper. Large Java codebases are hard to reason about at class level alone, and the Java Platform Module System asks for explicit modules that most legacy projects lack. Existing architecture recovery tools recover those modules poorly.
ClassLAR uses language models to read semantic intent from fully qualified class and package names, capturing both structural and functional cues. Across 20 popular Java projects, it beats all state of the art techniques on architectural similarity measures. It also runs 3.99 to 10.50 times faster than those baselines, making module recovery practical at scale.
Catalog record
| CREATOR | Yirui He, Yuqi Huai, Xingyu Chen, Joshua Garcia |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 57 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2512-15980
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Embedding Software Intent: Lightweight Java Module Recovery Yirui He, Yuqi Huai, Xingyu Chen, Joshua Garcia Abstract As an increasing number of software systems reach unprecedented scale, relying solely on code-level abstractions is becoming impractical. While architectural abstractions offer a means to manage these systems, maintaining their consistency with the actual code has been problematic. The Java Platform Module System (JPMS), introduced in Java 9, addresses this limitation by enabling explicit module specification at the language level. JPMS enhances architectural implementation through improved encapsulation and direct specification of ground-truth architectures within Java projects. Although many projects are written in Java, modularizing existing monolithic projects to JPMS modules is an open challenge due to ineffective module recovery by existing architecture recovery techniques. To address this challenge, this paper presents ClassLAR ( Class - and L anguage model-based A rchitectural R ecovery), a novel, lightweight, and efficient approach that recovers Java modules from monolithic Java systems using fully-qualified class names. ClassLAR leverages language models to extract semantic information from package and class names, capturing both structural and functional intent. In evaluations across 20 popular Java projects, ClassLAR outperformed all state-of-the-art techniques in architectural-level similarity metrics while achieving execution times that were 3.99 to 10.50 times faster. I Introduction Managing large-scale and complex systems through traditional code-level abstractions (e.g., functions, classes, packages) becomes infeasible as codebases reach hundreds of millions of lines. Software architecture provides higher-level abstractions (e.g., components, connectors, interfaces, configurations) to address this complexity [ 91 , 88 , 76 ] . Unfortunately, ensuring the consistency between architecture-level abstractions and code-level abstractions has been a longstanding problem at the core of software architectural drift and erosion [ 92 , 75 ] , which we collectively refer to as architectural decay . To address architectural decay, reverse engineering offers a promising direction by identifying system components and their interrelationships, creating representations at higher levels of abstraction [ 15 ] . Within the software architecture field, reverse engineering from implementation to high-level abstractions (i.e., software architecture recovery) stands as a critical topic. Over the past decades, researchers have proposed numerous architecture recovery techniques that extract system architecture from code implementations and reduce the manual effort required to maintain architectural abstractions [ 30 , 102 ] . While architecture recovery provides an effective approach for transforming monolithic systems into modular abstractions, two fundamental challenges remain. (1) Producing highly accurate architecture-recovery techniques faces the difficulty of obtaining accurate ground-truth architectures of projects, resulting in a relatively small number of such architectures being available [ 32 , 60 , 59 , 34 ] . (2) Existing recovery techniques have leveraged semantic [ 37 ] and structural [ 95 ] information, or combinations thereof [ 102 ] . However, achieving scalable recovery remains an open challenge, whether measured against ground-truth architectures or encapsulation metrics [ 59 , 60 , 30 ] . The introduction of the Java Platform Module System (JPMS) provides a unique opportunity to address the first challenge and, in turn, enables a systematic analysis of the second. Because JPMS encodes developer-created module boundaries directly in source code, it offers high-quality ground truth for large Java projects. By extracting these developer-defined modules, we can construct reliable benchmark architectures at scale. Building on this insight, we introduce ClassLAR ( Class - and L anguage model-based A rchitectural R ecovery), the first technique that extracts Java modules from monolithic systems using only fully-qualified class names, making it lightweight. Our key insight of ClassLAR is that by leveraging LM-based topic models with undersized module repair, we can design a technique to extract Java modules that substantially outperforms existing recovery techniques on a variety of accuracy and encapsulation measures while only needing the fully-qualified name of classes as input. The validity of relying solely on class names is supported by our examination of the modularization process of large-scale projects such as JUnit5 and OpenJDK JDK, where over 90% of source files in modularized versions preserve exact class-name matches with their non-modularized counterparts. This stability is consistent with prior empirical findings that major structural modifications are rare in real-world software evolution [ 54 , 53 ] . Our evaluations show that ClassLAR outperforms existing state-of-the-art architecture recovery techniques by producing recovered modules that not only more closely match developer-created modules under the measure of a2a score, by 11.46 to 20.63 percentage points (percentage point, pp, is the unit for the arithmetic difference between two percentages), but also exhibit good encapsulation property on Modularization Quality (MQ). ClassLAR performs these recoveries 3.99 to 10.50 times faster than existing techniques. To summarize, this paper makes the following contributions: • We built a dataset comprising 20 popular open-source GitHub [ 44 ] projects of varying scales. We extracted the ground-truth architecture for these 20 projects. This dataset can serve as a resource for future research and development. • We introduce ClassLAR , the first technique for extracting well-encapsulated Java modules that strongly resemble developer-created modules. ClassLAR operates using LMs and only the fully-qualified Java class names of a project as input, making ClassLAR fast and lightweight. • We evaluated the effectiveness of ClassLAR at extracting Java modules that resemble developer-created modules with 20 popular open-source GitHub projects, by comparing it against 4 state-of-the-art architecture recovery techniques. The results demonstrate that ClassLAR outperforms all techniques on a2a while achieving a faster speed. The remainder of the paper is organized as follows: Section II explains the background. Section III introduces the research questions. Section IV illustrates the main process of our study and describes ClassLAR in more detail; Section V details our analysis and discusses the obtained results; Section VII describes threats to validity; Section VIII outlines related work of the study and Section IX concludes the paper. II Background II-A Software Architectural Decay Software systems have grown increasingly large and more complex, resulting in many legacy software systems, which tend to remain in deployment and use for years or even decades. To maintain this growing complexity and scale of legacy software, program analysis of both the static and dynamic variety has been deployed to obtain high-level architectural abstractions from code-level artifacts [ 55 , 24 , 30 , 60 , 59 , 99 , 86 , 27 ] . Given the massive size of software, the length of time they live nowadays before they are decommissioned, and the continued need to build and maintain such large systems, it is imperative that we consider software constructs and concepts beyond typical code-level abstractions. A major means of handling such large and complex software systems has traditionally been to utilize constructs from software architecture (e.g., components, connectors, interfaces, and configurations) [ 91 , 88 , 76 ] . Unfortunately, ensuring that architecture-level abstractions and code-level abstractions are consistent has been a longstanding problem at the core of software architectural drift and erosion [ 92 , 75 ] , which we collectively refer to as architectural decay . Instances of architectural decay manifest themselves in a variety of forms—including architectural tactical vulnerabilities [ 16 ] , architectural technical debt [ 57 ] , architectural smells [ 29 , 35 , 36 ] , architectural hotspot patterns [ 98 , 14 ] , and architectural mismatch [ 38 , 39 ,