arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2306.08616cs.SE
收藏

朝向自动化识别架构侵蚀违规症状

Towards Automated Identification of Violation Symptoms of Architecture Erosion

School of Computer Science, Wuhan University(武汉大学计算机学院);Department of Computing Science, University of Groningen(格罗宁根大学计算科学系)

Ruiyin Li, Peng Liang, Paris Avgeriou, Yifei Wang

AI总结:

本文研究利用传统机器学习、深度学习和大语言模型自动检测代码审查中的架构违规症状,通过实验发现SVM结合词嵌入表现最佳,大语言模型在不平衡数据集上表现更优,研究为提升架构一致性提供了自动化方法。

摘要:

架构侵蚀损害软件维护,当实现偏离预期架构时尤为明显。早期检测违规症状至关重要,代码审查评论提供了有前景的文本来源。本文研究利用传统机器学习(ML)、深度学习(DL)和大语言模型(LLMs)自动检测架构违规症状。我们构建并评估了15个ML和4个DL分类器,使用词嵌入(word2vec、fastText、GloVe)在四个开源项目(OpenStack Nova、Neutron、Qt Base、Creator)的代码审查中进行测试。我们还构建了基于LLM的分类器,使用GPT-4o、Qwen-2.5和DeepSeek-R1。结果表明,SVM结合word2vec在ML/DL方法中表现最佳(F1分数:0.808),200维嵌入通常更优。多数投票集成进一步提升了性能。在不平衡测试集上,SVM在宏F1分数上仍最强。统计检验确认了显著的性能差异。最佳的LLM分类器优于传统ML/DL方法,GPT-4o达到最高F1分数(0.851)。实践调查和访谈表明,早期预警架构问题具有实际价值。受控实验显示,提供检测到的违规症状可将开发者检测率从25.9%提升至64.7%。本研究贡献了自动化检测方法、全面的ML/DL与LLM比较,以及经实践验证的证据,以改进架构一致性和可持续性。

英文摘要:

Architecture erosion harms software maintenance when implementation deviates from intended architecture. Early detection of violation symptoms is essential, and code review comments provide a promising textual source for automated identification. This paper investigates automatic detection of architecture violation symptoms from code reviews using traditional machine learning (ML), deep learning (DL), and large language models (LLMs). We built and evaluated 15 ML and 4 DL classifiers with word embeddings (word2vec, fastText, GloVe) on code reviews from four open-source projects (OpenStack Nova, Neutron, Qt Base, Creator). We also constructed LLM-based classifiers using GPT-4o, Qwen-2.5, and DeepSeek-R1. Results show that SVM with word2vec performs best among ML/DL methods (F1-score: 0.808), with 200-dimensional embeddings generally superior. Majority-vote ensembles further improve the performance. On an imbalanced test set, SVM remains strongest in Macro-F1. Statistical tests confirm significant performance differences. The best LLM-based classifiers outperformed traditional ML/DL approaches, with GPT-4o achieving the highest F1-score (0.851). Practitioner surveys and interviews indicate practical value for early warning of architectural issues. A controlled experiment shows that providing detected violation symptoms improves developers' detection rate from 25.9% to 64.7%. The study contributes an automated detection approach, comprehensive ML/DL vs LLM comparison, and practitioner-validated evidence for improving architectural conformance and sustainability.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑