计算机工程与应用 ›› 2019, Vol. 55 ›› Issue (6): 113-119.DOI: 10.3778/j.issn.1002-8331.1712-0053

• 模式识别与人工智能 • 上一篇    下一篇

应用机器学习方法的设计模式挖掘研究

鲁润泽,张海平   

  1. 杭州电子科技大学 计算机学院,杭州 310018
  • 出版日期:2019-03-15 发布日期:2019-03-14

Research on Design Pattern Mining Based on Machine Learning

LU Runze, ZHANG Haiping   

  1. College of Computer, Hangzhou Dianzi University, Hangzhou 310018, China
  • Online:2019-03-15 Published:2019-03-14

摘要: 从源码中挖掘设计模式实例具有重要意义,它能够提升软件系统的可理解性和可维护性。基于机器学习方法,提出了一个设计模式挖掘方法。其中,使用类关系图表示软件系统和设计模式,采用子图匹配的方法从软件系统中提取出候选设计模式实例,过滤了大量非设计模式实例组合,提高了设计模式挖掘效率;提出了度量指标,将软件系统和设计模式向量化,采用机器学习的方法对候选设计模式实例进行分类,提高了设计模式挖掘的准确率。实验结果证明此方法效率和有效性上得到了一定的提升。

关键词: 设计模式, 设计模式挖掘, 子图同构, 机器学习

Abstract: Mining design patterns from source code is of great significance. It can improve the comprehensibility and maintainability of software systems. Based on machine learning, a design patterns detection method is proposed. A class diagram is used to represent software systems and design patterns. Subgraph matching is utilized to extract design pattern candidates from software systems and filter numerous non-design pattern instance combinations to improve design patterns mining efficiency. Metrics are proposed tovec-torized software systems and design patterns. Machine learning is used to classify the design pattern instance candidates to improved design pattern mining accuracy. Experimental results show that the efficiency and effectiveness of this method have been improved to some extent.

Key words: design pattern, design pattern mining, subgraph isomorphism, machine learning