跳至主要内容

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

Read full paper at:
http://www.scirp.org/journal/PaperInformation.aspx?PaperID=51394#.VGlWmWfHRK0

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.
Cite this paper
Uchiyama, S. , Kubo, A. , Washizaki, H. and Fukazawa, Y. (2014) Detecting Design Patterns in Object-Oriented Program Source Code by Using Metrics and Machine Learning. Journal of Software Engineering and Applications, 7, 983-998. doi: 10.4236/jsea.2014.712086
 

[1] Gamma, E., Helm, R., Johnson, R. and Vlissides, J. (1994) Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Boston.
[2] Lorenz, M. and Kidd, J. (1994) Object-Oriented Software Metrics. Prentice Hall, Upper Saddle River.
[3] Uchiyama, S., Kubo, A., Washizaki, H. and Fukazawa, Y. (2011) Design Pattern Detection Using Software Metrics and Machine Learning. Proceedings of the 5th International Workshop on Software Quality and Maintainability, Oldenburg, 1 March 2011, 38-47.
[4] Tsantalis, N., Chatzigeorgiou, A., Stephanides, G. and Halkidis, S. (2006) Design Pattern Detection Using Similarity Scoring. IEEE Transactions on Software Engineering, 32, 896-909.
http://dx.doi.org/10.1109/TSE.2006.112
[5] Blewitt, A., Bundy, A. and Stark, L. (2005) Automatic Verification of Design Patterns in Java. Proceedings of the 20th International Conference on Automated Software Engineering, Long Beach, 7-11 November 2005, 224-232.
[6] Kim, H. and Boldyreff, C. (2000) A Method to Recover Design Patterns Using Software Product Metrics. In: Proceedings of the 6th International Conference on Software Reuse: Advances in Software Reusability, Vienna, 27-29 June 2000, 318-335.
[7] Ferenc, R., Beszedes, A., Fulop, L. and Lele, J. (2005) Design Pattern Mining Enhanced by Machine Learning. Proceedings of the 21st IEEE International Conference on Software Maintenance, Budapest, 26-29 September 2005, 295-304. http://dx.doi.org/10.1109/ICSM.2005.40
[8] Washizaki, H., Fukaya, K., Kubo, A. and Fukazawa, Y. (2009) Detecting Design Patterns Using Source Code of before Applying Design Patterns. In: Proceedings of the 8th IEEE/ACIS International Conference on Computer and Information Science, Shanghai, 1-3 June 2009, 933-938.
[9] Shi, N. and Olsson, R.A. (2006) Reverse Engineering of Design Patterns from Java Source Code. In: Proceedings of the 21st IEEE/ACM International Conference on Automated Software Engineering, Tokyo, 18-22 September 2006, 123-134. http://dx.doi.org/10.1109/ASE.2006.57
[10] Lee, H., Youn, H. and Lee, S. (2007) Automatic Detection of Design Pattern for Reverse Engineering. In: Proceedings of the 5th ACIS International Conference on Software Engineering Research, Management and Applications, Busan, 20-22 August 2007, 577-583.
[11] Wendehals, L. and Orso, A. (2006) Recognizing Behavioral Patterns at Runtime Using Finite Automata. Proceedings of the 4th ICSE 2006 Workshop on Dynamic Analysis, Shanghai, 26 May 2006, 33-40. http://dx.doi.org/10.1145/1138912.1138920
[12] Hayashi, S., Katada, J., Sakamoto, R., Kobayashi, T. and Saeki, M. (2008) Design Pattern Detection by Using Meta Patterns. IEICE Transactions on Information and Systems, 91-D, 933-944.
http://dx.doi.org/10.1093/ietisy/e91-d.4.933
[13] Lucia, A., Deufemia, V., Gravino, C. and Risi, M. (2009) Design Pattern Recovery through Visual Language Parsing and Source Code Analysis. Journal of Systems and Software, 82, 1177-1193.
http://dx.doi.org/10.1016/j.jss.2009.02.012
[14] Guéhéneuc, Y. and Antoniol, G. (2008) DeMIMA: A Multilayered Approach for Design Pattern Identification. IEEE Transactions on Software Engineering, 34, 667-684.
http://dx.doi.org/10.1109/TSE.2008.48
[15] Dietrich, J. and Elgar, C. (2007) Towards a Web of Patterns. Journal of Web Semantics, 5, 108-116. http://dx.doi.org/10.1016/j.websem.2006.11.007
[16] Basili, V.R. and Weiss, D.M. (1984) A Methodology for Collecting Valid Software Engineering Data. IEEE Transactions on Software Engineering, 10, 728-738.
http://dx.doi.org/10.1109/TSE.1984.5010301
[17] Segaran, T. (2007) Programming Collective Intelligence. O’Reilly, Sebastopol.
[18] Hirano, H. (2008) Neural Network Implemented with C++ and Java. Personal Media, Tokyo.
[19] Kurita, T. (1990) Deciding Unit Number of Hidden Layer in Three-Layer-Neural Network by Using Information Criteria. IEICE Transactions on Information and Systems, 73, 1872-1878.
[20] Yuki, H. (2014) An Introduction to Design Patterns to Study by Java. http://www.hyuki.com/dp/
[21] Tanaka, H. (2010) Hello World with Java! http://web.archive.org/web/20100808072152/
[22] Oracle. Oracle Technology Network for Java Developers.
http://www.oracle.com/technetwork/java/index.html             eww141117lx
[23] JUnit.org. Resources for Test Driven Development. http://www.junit.org/
[24] SpringSource.org. Spring Source. http://www.springsource.org/

评论

此博客中的热门博文

Does Immigration Promote the Investment of the Monopolistic Firm?

In the present paper, we examine the effect of increasing uncertainty of immigrants’ growth on the optimal timing of investment of a firm that has a monopolistic power over the labor market. It is revealed that when the uncertainty of immigrants’ growth is more than a threshold level, increasing uncertainty of immigrants’ growth accelerates the optimal timing of firms’ investment and enhances the economic growth, even if the uncertainty of immigrants’ growth is formulated by the geometric Brownian motion, which is in sharp contrast to the standard result that an increase in the uncertainty postpones the optimal timing. With an increase in the immigrants over the past ten years, workforces in the host countries have been growing significantly to the extent that the immigrants represent 70% of the increase in the workforce in Europe, and 47% in the United States as OECD indicates. In the present paper, we attempted to investigate the effect of increased uncertainty caused by the growi...

Education Policy Implementation: A Mechanism for Enhancing Primary Education Development in Zanzibar

Education is one of the fundamental rights of individuals; therefore, the government of a country needs to develop and strengthen educational policy and quality as well as to ensure that everyone has equal access to basic education. The improvement of access and quality of education in the world is becoming as an essential factor in development, whereas the basic education (primary school), is acknowledged as a foundation of the higher educational development for every country. To fulfill this goal, governments introduce several policies and procedures; however, it requires some reforms and participation from the politician, policymakers, and other stakeholders to re-examine educational policy so that it can lead to multiplication and betterment of the reforms. Educational reforms actually focus on accountability. A positive educational development and reform is very challenging and needs more effort and strategy on how to use and utilize the resources effectively as such it can achie...