用语言模型从类名恢复Java模块,速度快且更准。
Embedding Software Intent: Lightweight Java Module Recovery
- 基于类名和语言模型,提取包与类的语义意图
- 在20个大型项目中准确率超现有方法,速度提升3.99至10.5倍
- 适合需要快速重构单体Java系统的开发团队
随着软件系统规模不断增大,仅依赖代码级抽象已难以应对。虽然架构抽象能有效管理复杂系统,但其与实际代码的一致性难以维持。Java 9引入的Java平台模块系统(JPMS)通过语言级显式模块定义,提升了封装性并直接在项目中表达真实架构。然而,现有架构恢复技术在将单体Java项目模块化为JPMS模块时效果不佳。为此,本文提出ClassLAR(基于类与语言模型的架构恢复),一种轻量、高效的方法,仅使用全限定类名即可从单体系统中恢复Java模块。ClassLAR利用语言模型挖掘包名和类名中的语义信息,捕捉结构与功能意图。在20个流行Java项目上的评估显示,ClassLAR在架构相似度指标上优于所有前沿方法,执行时间比现有技术快3.99至10.50倍。
原文摘要 · Abstract (English)
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 Language model-based Architectural Recovery), 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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。