计算机科学 ›› 2015, Vol. 42 ›› Issue (2): 173-176.doi: 10.11896/j.issn.1002-137X.2015.02.037

• 软件与数据库技术 • 上一篇    下一篇

基于关联度和特征约束的软件设计模式识别方法

古辉,张炜星,金鹏,顾杰杰   

  1. 浙江工业大学计算机科学与技术学院 杭州310023,浙江工业大学计算机科学与技术学院 杭州310023,浙江工业大学计算机科学与技术学院 杭州310023,浙江工业大学计算机科学与技术学院 杭州310023
  • 出版日期:2018-11-14 发布日期:2018-11-14

Method of Software Design Patterns Identification Based on Correlation and Feature Constraints

GU Hui, ZHANG Wei-xing, JIN Peng and GU Jie-jie   

  • Online:2018-11-14 Published:2018-11-14

摘要: 在程序理解和软件逆向工程研究中,找到准确和快速地描述软件的设计模式和待识别源代码的方法,对于构建合理的设计模式识别框架和高效的识别算法是至关重要的。运用无向图的邻接表和连通分量的原理,提出类与类之间关联度的概念,由待识别源代码构建一个关联类集合,旨在减小设计模式识别算法的搜索空间;根据设计模式的特征,提出基于关联度和特征约束的设计模式识别算法。对Junit、JHotDraw和JreFactory 3个开源应用程序进行的设计模式识别表明,该算法能够准确高效地完成对源代码设计模式的识别。

关键词: 程序理解,设计模式识别,关联度,特征约束

Abstract: In program comprehension and software reverse engineering research,it is crucial to find a method that can describe software design patterns and source code to be identified accurately and quickly for constructing a reasonable design pattern identification framework and efficient recognition algorithms.With the principle of adjacency list and connected component of undigraph,we presented the concept of correlation between the class in source code,constructed association class collection from source code to be identified so as to reduce the search space of the algorithm of design pattern recognition.According to the features of design patterns,algorithms of design pattern identification based on correlation and feature constraints were proposed.The algorithm was applied to three open sources including applications-Junit,JHotDraw and JreFactory.These results demonstrate the algorithms can accurately and efficiently complete the recognition of design patterns in source code.

Key words: Program comprehension,Design patterns identification,Correlation,Feature constraints

[1] Gamma E,Helm R,Johnson R,et al.Design Patterns-Elements of Reusable Object-Oriented Software[M].New Jersey:Addison-Wesley,1995
[2] Krmer C,Lutz Prechelt.Design recovery by automated search for structural design patterns in object-oriented software[C]∥Proceedings of the Third Working Conference on Reverse Engineering.1996:208-215
[3] Rasool G,Mader P.Flexible Design Pattern Detection Based on Feature Types[C]∥26th IEEE/ACM International Conference on Automated Software Engineering (ASE).2011:243-252
[4] Balanyi Z,Ferenc R.Mining Design Patterns from C++ Source Code[C]∥Proc.Internationl Conf.on Software Maintenance(ICSM’03).2003:305-314
[5] Dobis M,Majtas L.Mining Design Patterns from Existing Projects Using Static and Run-Time Analysis[J].Springer Software Engineering Techniques,2011,0:62-75
[6] 古辉,张炜星.基于XML Schema 技术的设计模式定义方法[J].计算机科学,2014,1(1):254-257
[7] Antoniol G,Fiutem R,Cristoforetti L.Design pattern recovery in object-oriented software[C]∥Proceedings of 6th IEEE International Workshop on Program Comprehension (IWPC 1998).1998:153-160
[8] Gueheneuc Y G,Guyomarc’h J Y,Sahraoui H.Improving design-pattern identification:a new approach and an exploratory study[J].Software Quality Journal,2010,8(1):145-174
[9] 苗康,余啸,赵吉,等.基于关系演算的Java模式识别[J].计算机应用研究,2010,7(9):3425-3430
[10] Li F,Li Q S,Su Y,et al.Detection of design patterns by combin-ing static and dynamic analyses[J].Journal of Shanghai University(English Edition),2007,1(2):156-162
[11] 严蔚敏,吴伟民.数据结构(c语言版)[M].北京:清华大学出版社,1997
[12] 阎宏.Java与模式[M].北京:电子工业出版社,2002

No related articles found!
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!