一句话:提出融合语义相似度与结构依赖的加权图及优化社区检测,实现更准确、可扩展的软件架构恢复。
软件架构对开发与维护至关重要,但软件演化会导致架构漂移与退化。人工分析耗时易错,现有自动化架构恢复技术在准确性和效率上仍有局限,尤其面对大规模系统。本文提出SSAR方法,将文件间的语义相似度与结构依赖融合为加权图,并采用优化后的社区检测算法对图进行划分以实现软件模块化。作者在九个具有真实架构的开源项目上,与六种当前最优架构恢复技术比较,使用MoJoFM、a2a和c2ccvg三个指标评估。结果表明,SSAR在三个指标上分别提升5.0%-90.9%、3.8%-16.9%和12.5%-500%,平均执行时间降低5%-99%,兼顾了恢复精度与可扩展性。
Software architecture is critical for software development and maintenance. As software evolves, its architecture may drift from the original design, resulting in architectural degradation that negatively affects software quality. To effectively manage and maintain software systems, architects need an accurate understanding of the current architecture, but manual analysis is time-consuming and error-prone. Therefore, numerous automated architecture recovery techniques have been developed to facilitate this process. However, existing techniques often face limitations in either accuracy or efficiency, especially when dealing with large-scale software systems. In this paper, we propose a novel architecture recovery approach that integrates semantic similarity and structural dependencies between files to construct a weighted graph. Then it applies an optimized community detection algorithm to partition the graph for software modularization. To evaluate the effectiveness of our approach, we selected nine open-source projects with ground-truth architectures and compared our approach against six state-of-the-art architecture recovery techniques. Experimental results have shown that our approach improves accuracy ranging from 5.0% to 90.9%, 3.8% to 16.9%, and 12.5% to 500% in the three well-known architecture similarity metrics (MoJoFM, a2a, and c2ccvg), respectively. Additionally, it reduces the average execution time by 5% to 99%. In conclusion, our approach not only achieves a more precise recovery of software architecture but also significantly cuts down the time and effort required for the recovery process.