arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.18458cs.SEcs.LG
收藏

基于大语言模型的设计模式检测

LLM-Based Design Pattern Detection

Clausthal University of Technology(克劳斯塔尔工业大学);Institute for Software and Systems Engineering(软件与系统工程研究所)

Christian Schindler, Andreas Rausch

AI总结:

针对传统静态分析难以检测设计模式实例的问题,提出利用大语言模型自动识别代码库中的模式实例,通过识别类在模式中的角色来提升软件理解与维护效率。

摘要:

在不熟悉的代码库中检测设计模式实例仍然是一项具有挑战性但对提高软件质量和可维护性至关重要的任务。传统的静态分析工具往往难以应对真实世界模式实现所具有的复杂性、多变性和缺乏显式标注等问题。在本文中,我们提出了一种利用大语言模型的新方法,用于在多种代码库中自动识别设计模式实例。我们的方法侧重于识别类在模式实例中所扮演的角色。通过提供对软件结构和意图更清晰的洞察,本研究旨在支持开发者、提高理解能力,并简化重构、维护及遵循最佳实践等任务。

英文摘要:

Detecting design pattern instances in unfamiliar codebases remains a challenging yet essential task for improving software quality and maintainability. Traditional static analysis tools often struggle with the complexity, variability, and lack of explicit annotations that characterize real-world pattern implementations. In this paper, we present a novel approach leveraging Large Language Models to automatically identify design pattern instances across diverse codebases. Our method focuses on recognizing the roles classes play within the pattern instances. By providing clearer insights into software structure and intent, this research aims to support developers, improve comprehension, and streamline tasks such as refactoring, maintenance, and adherence to best practices.

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

↑