Academia.eduAcademia.edu

Outline

DP-CORE: A Design Pattern Detection Tool for Code Reuse

2016, Proceedings of the Sixth International Symposium on Business Modeling and Software Design

https://doi.org/10.5220/0006223301600167

Abstract

In order to maintain, extend or reuse software projects one has to primarily understand what a system does and how well it does it. And, while in some cases information on system functionality exists, information covering the non-functional aspects is usually unavailable. Thus, one has to infer such knowledge by extracting design patterns directly from the source code. Several tools have been developed to identify design patterns, however most of them are limited to compilable and in most cases executable code, they rely on complex representations, and do not offer the developer any control over the detected patterns. In this paper we present DP-CORE, a design pattern detection tool that defines a highly descriptive representation to detect known and define custom patterns. DP-CORE is flexible, identifying exact and approximate pattern versions even in non-compilable code. Our analysis indicates that DP-CORE provides an efficient alternative to existing design pattern detection tools.

FAQs

sparkles

AI

What distinguishes DP-CORE from other design pattern detection tools?add

DP-CORE supports detection in non-executable source code and allows for custom pattern definitions. Unlike others, it uses UML-based representations and efficiently handles incomplete code, yielding results in under 5 seconds.

How does the pattern detection algorithm in DP-CORE operate?add

DP-CORE employs a recursive pruning algorithm that reduces permutations for candidate patterns based on object matching. This approach minimizes computational inefficiency, checking significantly fewer combinations than brute force methods.

What were the evaluation results comparing DP-CORE to PINOT?add

In tests across libraries like JHotDraw and Java AWT, both tools detected similar patterns but showed variation due to representation differences. DP-CORE proved efficient, with detection taking less than 5 seconds per project.

What types of design patterns does DP-CORE effectively identify?add

DP-CORE successfully identified 6 GoF design patterns, including Abstract Factory and Visitor, in a curated example project. The tool did report some false positives, highlighting the need for precise pattern definitions.

How does DP-CORE handle common code errors during pattern detection?add

DP-CORE effectively detects patterns even in non-compilable code, tolerating common syntax and semantic errors. It can ignore many issues, enabling detection of reusable code that may have minor inconsistencies.

References (17)

  1. Arcelli, F. and Christina, L. (2007). Enhancing Software Evolution through Design Pattern Detection. In Pro- ceedings of the 2007 Third International IEEE Work- shop on Software Evolvability, pages 7-14, Paris, France.
  2. Arcelli, F. F., Perin, F., Raibulet, C., and Ravani, S. (2008). Behavioral Design Pattern Detection through Dynamic Analysis. In Proceedings of the 4th Interna- tional Workshop on Program Comprehension through Dynamic Analysis, pages 11-16, Antwerp, Belgium.
  3. Beck, K. and Cunningham, W. (1987). Using Pattern Lan- guages for Object-Oriented Programs. In Proceedings of the OOPSLA-87 Workshop on the Specification and Design for Object-Oriented Programming, Orlando, FL, USA.
  4. Birkner, M. (2007). Object-Oriented Design Pattern Detec- tion Using Static and Dynamic Analysis of Java Soft- ware. Master's thesis, University of Applied Sciences Bonn-Rhein-Sieg Sankt Augustin, Germany.
  5. Dong, J., Lad, D. S., and Zhao, Y. (2007a). DP-Miner: Design Pattern Discovery Using Matrix. In Proceed- ings of the 14th Annual IEEE International Confer- ence and Workshops on the Engineering of Computer- Based Systems, ECBS '07, pages 371-380, Tucson, AZ, USA.
  6. Dong, J., Zhao, Y., and Peng, T. (2007b). Architecture and Design Pattern Discovery Techniques -A Review. In Proceedings of the 2007 International Conference on Software Engineering Research & Practice, volume 2 of SERP 2007, pages 621-627, Las Vegas, NV, USA.
  7. Dong, J., Zhao, Y., and Peng, T. (2009). A Review of De- sign Pattern Mining Techniques. International Jour- nal of Software Engineering and Knowledge Engi- neering, 19(06):823-855.
  8. Gamma, E., Vlissides, J., Johnson, R., and Helm, R. (1998). Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA.
  9. Guéhéneuc, Y.-G. and Antoniol, G. (2008). DeMIMA: A Multilayered Approach for Design Pattern Identifica- tion. IEEE Trans. Softw. Eng., 34(5):667-684.
  10. Kaczor, O., Guéhéneuc, Y.-G., and Hamel, S. (2006). Effi- cient Identification of Design Patterns with Bit-vector Algorithm. In Proceedings of the 10th European Con- ference on Software Maintenance and Reengineering, CSMR 2006, pages 175-184, Bari, Italy.
  11. Lucia, A. D., Deufemia, V., Gravino, C., and Risi, M. (2009). Design Pattern Recovery Through Visual Lan- guage Parsing and Source Code Analysis. J. Syst. Softw., 82(7):1177-1193.
  12. Nickel, U., Niere, J., and Zündorf, A. (2000). The FU- JABA Environment. In Proceedings of the 22nd Inter- national Conference on Software Engineering, ICSE '00, pages 742-745, Limerick, Ireland.
  13. Oracle (2015). Compiler Tree API. Avail. online: http:// docs.oracle.com/javase/8/docs/jdk/api/ javac/tree/index.html, [retrieved March, 2015].
  14. Rasool, G. and Streitferdt, D. (2011). A Survey on Design Pattern Recovery Techniques. International Journal of Computer Science Issues, 8(6):251-260.
  15. Shi, N. and Olsson, R. A. (2006). Reverse Engineering of Design Patterns from Java Source Code. In Proceed- ings of the 21st IEEE/ACM International Conference on Automated Software Engineering, ASE '06, pages 123-134, Tokyo, Japan.
  16. Stencel, K. and Wegrzynowicz, P. (2008). Detection of Di- verse Design Pattern Variants. In Proceedings of the 2008 15th Asia-Pacific Software Engineering Confer- ence, APSEC '08, pages 25-32, Beijing, China.
  17. Tsantalis, N., Chatzigeorgiou, A., Stephanides, G., and Halkidis, S. (2006). Design Pattern Detection us- ing Similarity Scoring. IEEE Trans. Softw. Eng., 32(11):896-909.