Towards a Comprehensive Test Suite for Detectors of Design Patterns

Detection of design patterns is an important part of reverse engineering. Availability of patterns provides for a better understanding of code and also makes analysis more efficient in terms of time and cost. In recent years, we have observed a continual improvement in the field of automatic detection of design patterns in source code. Existing approaches can detect a fairly broad range of design patterns, targeting both structural and behavioral aspects of patterns. However, it is not straightforward to assess and compare these approaches. There is no common ground on which to evaluate the accuracy of the detection approaches, given the existence of variants and specific code constructs used to implement a design pattern. We propose a systematic approach to constructing a comprehensive test suite for detectors of design patterns. This approach is applied to construct a test suite covering the Singleton pattern. The test suite contains many implementation variants of these patterns, along with such code constructs as method forwarding, access modifiers, and long inheritance paths. Furthermore, we use this test suite to compare three detection tools and to identify their strengths and weaknesses.

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

[2]  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).

[3]  Joakim Nivre,et al.  On Evaluation of Accuracy in Pattern Detection , 2006 .

[4]  Jörg Niere,et al.  Handling large search space in pattern-based reverse engineering , 2003, 11th IEEE International Workshop on Program Comprehension, 2003..

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

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

[7]  Tom Mens,et al.  Language-independent detection of object-oriented design patterns , 2004, Comput. Lang. Syst. Struct..

[8]  Yann-Gaël Guéhéneuc,et al.  Instantiating and detecting design patterns: putting bits and pieces together , 2001, Proceedings 16th Annual International Conference on Automated Software Engineering (ASE 2001).

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

[10]  Christopher G. Lasater,et al.  Design Patterns , 2008, Wiley Encyclopedia of Computer Science and Engineering.

[11]  Albert Zündorf,et al.  An Interactive and Scalable Approach to Design Pattern Recovery , 2003 .

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

[13]  Rudolf Ferenc,et al.  Recognizing Design Patterns in C++ Programs with the Integration of Columbus and Maisa , 2002, Acta Cybern..

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

[15]  Tibor Gyimóthy,et al.  Towards a Benchmark for Evaluating Design Pattern Miner Tools , 2008, 2008 12th European Conference on Software Maintenance and Reengineering.

[16]  Alan Bundy,et al.  Automatic verification of design patterns in Java , 2005, ASE.