Detecting Design Patterns in Object-Oriented Program Source Code by Using Metrics and Machine Learning

Detecting well-known design patterns in object-oriented program source code can help maintainers understand the design of a program. Through the detection, the understandability, maintainability, and reusability of object-oriented programs can be improved. There are automated detection techniques; however, many existing techniques are based on static analysis and use strict conditions composed on class structure data. Hence, it is difficult for them to detect and distinguish design patterns in which the class structures are similar. Moreover, it is difficult for them to deal with diversity in design pattern applications. To solve these problems in existing techniques, we propose a design pattern detection technique using source code metrics and machine learning. Our technique judges candidates for the roles that compose design patterns by using machine learning and measurements of several metrics, and it detects design patterns by analyzing the relations between candidates. It suppresses false negatives and distinguishes patterns in which the class structures are similar. As a result of experimental evaluations with a set of programs, we confirmed that our technique is more accurate than two conventional techniques.

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

[2]  Victor R. Basili,et al.  A Methodology for Collecting Valid Software Engineering Data , 1984, IEEE Transactions on Software Engineering.

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

[4]  Rudolf Ferenc,et al.  Design pattern mining enhanced by machine learning , 2005, 21st IEEE International Conference on Software Maintenance (ICSM'05).

[5]  Toby Segaran,et al.  Programming Collective Intelligence , 2007 .

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

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

[8]  Hironori Washizaki,et al.  Detecting Design Patterns Using Source Code of Before Applying Design Patterns , 2009, 2009 Eighth IEEE/ACIS International Conference on Computer and Information Science.

[9]  Mark Lorenz Object-Oriented Software Metrics , 1994 .

[10]  Shinpei Hayashi,et al.  Design Pattern Detection by Using Meta Patterns , 2008, IEICE Trans. Inf. Syst..

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

[12]  Jens Dietrich,et al.  Towards a web of patterns , 2007, J. Web Semant..

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

[14]  Hironori Washizaki,et al.  Design pattern detection using software metrics and machine learning , 2011 .

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

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

[17]  Eunseok Lee,et al.  Automatic Detection of Design Pattern for Reverse Engineering , 2007, 5th ACIS International Conference on Software Engineering Research, Management & Applications (SERA 2007).