Design pattern detection using a DSL‐driven graph matching approach

Knowledge about design pattern (DP) instances improves program comprehension and reengineering of object‐oriented systems. Effectively, it helps to discover developer design decisions and trade‐offs that often are not documented. This work describes an approach to automatically detect DPs in existing object‐oriented systems by tracing systems' source code components with the roles they play in the patterns. In the proposed approach, DPs are modeled based on their high‐level structural properties (e.g., inheritance, dependency, invocation, delegation, type nesting, and membership relationships) that are checked, by source code parsing, against the system structure and components. Moreover, the approach can also detect pattern variants, defined by overriding the pattern properties. This paper presents a description of the approach, provides a brief description of the supporting tool, and discusses the results from the experiments carried out to validate it. The approach was validated on seven systems of an open benchmark that contains systems of increasing sizes. For five additional systems, the results have been compared with the ones from a similar approach existing in the literature. The obtained results, the identified DP variants, and the effectiveness of the approach are thoroughly presented and discussed. Copyright © 2014 John Wiley & Sons, Ltd.

[1]  Joakim Nivre,et al.  Evaluation of Accuracy in Design Pattern Occurrence Detection , 2010, IEEE Transactions on Software Engineering.

[2]  Rudolf Ferenc,et al.  Mining design patterns from C++ source code , 2003, International Conference on Software Maintenance, 2003. ICSM 2003. Proceedings..

[3]  Francesca Arcelli Fontana,et al.  DPB: A Benchmark for Design Pattern Detection Tools , 2012, 2012 16th European Conference on Software Maintenance and Reengineering.

[4]  P. David Stotts,et al.  SPQR: flexible automated design pattern extraction from source code , 2003, 18th IEEE International Conference on Automated Software Engineering, 2003. Proceedings..

[5]  Lothar Wendehals Improving Design Pattern Instance Recognition by Dynamic Analysis , 2003 .

[6]  Michael Philippsen,et al.  Two Controlled Experiments Assessing the Usefulness of Design Pattern Documentation in Program Maintenance , 2002, IEEE Trans. Software Eng..

[7]  Ronald A. Olsson,et al.  Reverse Engineering of Design Patterns from Java Source Code , 2006, 21st IEEE/ACM International Conference on Automated Software Engineering (ASE'06).

[8]  Paul Klint,et al.  The syntax definition formalism SDF—reference manual— , 1989, SIGP.

[9]  Yann-Gaël Guéhéneuc,et al.  P-MARt : Pattern-like Micro Architecture Repository , 2007 .

[10]  Ghulam Rasool,et al.  Design pattern recovery based on annotations , 2010, Adv. Eng. Softw..

[11]  Giuliano Antoniol,et al.  Object-oriented design patterns recovery , 2001, J. Syst. Softw..

[12]  Dirk Beyer,et al.  CrocoPat: efficient pattern analysis in object-oriented programs , 2003, 11th IEEE International Workshop on Program Comprehension, 2003..

[13]  Yongtao Sun,et al.  A Matrix-Based Approach to Recovering Design Patterns , 2009, IEEE Transactions on Systems, Man, and Cybernetics - Part A: Systems and Humans.

[14]  Ioannis Stamelos,et al.  A methodology to assess the impact of design patterns on software quality , 2012, Inf. Softw. Technol..

[15]  Sai Peck Lee,et al.  UML Extension for Defining the Interaction Variants of Design Patterns , 2012, IEEE Software.

[16]  Yann-Gaël Guéhéneuc,et al.  Fingerprinting design patterns , 2004, 11th Working Conference on Reverse Engineering.

[17]  Robert B. France,et al.  A UML-based pattern specification technique , 2004, IEEE Transactions on Software Engineering.

[18]  Ilka Philippow,et al.  An approach for reverse engineering of design patterns , 2004, Software & Systems Modeling.

[19]  Ghulam Rasool,et al.  Flexible design pattern detection based on feature types , 2011, 2011 26th IEEE/ACM International Conference on Automated Software Engineering (ASE 2011).

[20]  Yingxu Wang,et al.  Formal Modeling and Specification of Design Patterns Using RTPA , 2008, Int. J. Cogn. Informatics Nat. Intell..

[21]  Michele Risi,et al.  Improving Behavioral Design Pattern Detection through Model Checking , 2010, 2010 14th European Conference on Software Maintenance and Reengineering.

[22]  Jing Dong,et al.  Experiments on Design Pattern Discovery , 2007, Third International Workshop on Predictor Models in Software Engineering (PROMISE'07: ICSE Workshops 2007).

[23]  Giuliano Antoniol,et al.  Design pattern recovery in object-oriented software , 1998, Proceedings. 6th International Workshop on Program Comprehension. IWPC'98 (Cat. No.98TB100242).

[24]  Alexander Chatzigeorgiou,et al.  Design Pattern Detection Using Similarity Scoring , 2006, IEEE Transactions on Software Engineering.

[25]  Lutz Prechelt,et al.  Design recovery by automated search for structural design patterns in object-oriented software , 1996, Proceedings of WCRE '96: 4rd Working Conference on Reverse Engineering.

[26]  Alessandro Orso,et al.  Recognizing behavioral patterns atruntime using finite automata , 2006, WODA '06.

[27]  Steffen Becker,et al.  Combining clustering and pattern detection for the reengineering of component-based software systems , 2011, QoSA-ISARCS '11.

[28]  Anssi Karhinen,et al.  Software Metrics by Architectural Pattern Mining , 2000 .

[29]  Federico Bergenti IMPROVING UML DESIGNS USING AUTOMATIC DESIGN PATTERN DETECTION , 2001 .

[30]  Shensheng Zhang,et al.  A practical pattern recovery approach based on both structural and behavioral analysis , 2005, J. Syst. Softw..

[31]  Francesca Arcelli Fontana,et al.  A tool for design pattern detection and software architecture reconstruction , 2011, Inf. Sci..

[32]  Yann-Gaël Guéhéneuc,et al.  Identification of behavioural and creational design motifs through dynamic analysis , 2010, J. Softw. Maintenance Res. Pract..

[33]  Krzysztof Stencel,et al.  Relaxing queries to detect variants of design patterns , 2013, 2013 Federated Conference on Computer Science and Information Systems.

[34]  Michele Risi,et al.  Behavioral Pattern Identification through Visual Language Parsing and Code Instrumentation , 2009, 2009 13th European Conference on Software Maintenance and Reengineering.

[35]  Jing Dong,et al.  Architecture and Design Pattern Discovery Techniques - A Review , 2007, Software Engineering Research and Practice.

[36]  Cornelia Boldyreff,et al.  A Method to Recover Design Patterns Using Software Product Metrics , 2000, ICSR.

[37]  Hong Zhu,et al.  On the Composition of Design Patterns , 2008, 2008 The Eighth International Conference on Quality Software.

[38]  Dirk Beyer,et al.  Relational programming with CrocoPat , 2006, ICSE.

[39]  Ghulam Rasool,et al.  Discovering Variants of Design Patterns , 2013 .

[40]  Marco Torchiano,et al.  Empirical studies in reverse engineering: state of the art and future trends , 2007, Empirical Software Engineering.

[41]  Mario Luca Bernardi,et al.  Model-driven detection of Design Patterns , 2010, 2010 IEEE International Conference on Software Maintenance.

[42]  Michele Risi,et al.  An Eclipse plug-in for the detection of design pattern instances through static and dynamic analysis , 2010, 2010 IEEE International Conference on Software Maintenance.

[43]  Gongjun Yan,et al.  Automatic recognition of design motifs using semantic conditions , 2013, SAC '13.

[44]  Ghulam Rasool,et al.  A Survey on Design Pattern Recovery Techniques , 2011 .

[45]  Krzysztof Stencel,et al.  Implementation Variants of the Singleton Design Pattern , 2008, OTM Workshops.

[46]  Jim Welsh,et al.  Towards pattern-based design recovery , 2002, ICSE '02.

[47]  Maayan Goldstein,et al.  System Grokking - A Novel Approach for Software Understanding, Validation, and Evolution , 2009, NGITS.

[48]  Mario Luca Bernardi,et al.  A model-driven graph-matching approach for design pattern detection , 2013, 2013 20th Working Conference on Reverse Engineering (WCRE).

[49]  Günter Kniesel,et al.  DPJF - Design Pattern Detection with High Accuracy , 2012, 2012 16th European Conference on Software Maintenance and Reengineering.

[50]  Rudolf K. Keller,et al.  Pattern-based design recovery with SPOOL , 2002 .

[51]  Yann-Gaël Guéhéneuc,et al.  Improving design-pattern identification: a new approach and an exploratory study , 2010, Software Quality Journal.

[52]  Krzysztof Stencel,et al.  Detection of Diverse Design Pattern Variants , 2008, 2008 15th Asia-Pacific Software Engineering Conference.

[53]  Jean-Marc Jézéquel,et al.  Precise Modeling of Design Patterns , 2000, UML.

[54]  Jing Dong,et al.  Verifying Behavioral Correctness of Design Pattern Implementation , 2008, SEKE.

[55]  Yann-Gaël Guéhéneuc,et al.  Efficient identification of design patterns with bit-vector algorithm , 2006, Conference on Software Maintenance and Reengineering (CSMR'06).

[56]  Marek Vokác An efficient tool for recovering Design Patterns from C++ Code , 2006, J. Object Technol..

[57]  Francesca Arcelli Fontana,et al.  Using Design Pattern Clues to Improve the Precision of Design Pattern Detection Tools , 2011, J. Object Technol..

[58]  Ralph Johnson,et al.  design patterns elements of reusable object oriented software , 2019 .

[59]  Sai Peck Lee,et al.  Representing design pattern interaction roles and variants , 2010, 2010 2nd International Conference on Computer Engineering and Technology.

[60]  Welf Löwe,et al.  Automatic design pattern detection , 2003, 11th IEEE International Workshop on Program Comprehension, 2003..

[61]  Rudolf Ferenc,et al.  Evaluating C++ Design Pattern Miner Tools , 2006, 2006 Sixth IEEE International Workshop on Source Code Analysis and Manipulation.

[62]  Michele Risi,et al.  Design pattern recovery through visual language parsing and source code analysis , 2009, J. Syst. Softw..

[63]  Yann-Gaël Guéhéneuc,et al.  DeMIMA: A Multilayered Approach for Design Pattern Identification , 2008, IEEE Transactions on Software Engineering.