A Structural Rule-Based Approach for Design Patterns Recovery

  • Mohammed Ghazi Al-Obeidallah
  • Miltos Petridis
  • Stelios Kapetanakis
Part of the Studies in Computational Intelligence book series (SCI, volume 722)


Design patterns have a key role in the software development process. They describe both structure, behavior of classes and their relationships. Design patterns can improve software documentation, speed up the development process and enable large-scale reuse of software architectures. This paper presents a Multiple Levels Detection Approach (MLDA) to recover design pattern instances from Java source code. MLDA is able to extract design pattern instances based on a generated class level representation of an investigated system. Specifically, MLDA presents what is the so-called Structural Search Model (SSM) which incrementally builds the structure of each design pattern based on the generated source code model. Moreover, MLDA uses a rule-based approach to match the method signatures of the candidate design instances to that of the subject system. As the experiment results illustrate, MLDA is able to extract 23 design patterns with reasonable detection accuracy.


Design patterns Detection Reverse engineering Gang of four Static analysis Rule-based systems 


  1. 1.
    Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley Longman Publishing Co., Inc., Boston (1995)MATHGoogle Scholar
  2. 2.
    CLIPS: A Tool for Building Expert Systems. (2016). 5 Jan 2017
  3. 3.
    Frost, R., Hafiz, R., Callaghan, P.: Parser combinators for ambiguous left-recursive grammars. In: 10th International Symposium on Practical Aspects of Declarative Languages (PADL), ACM-SIGPLAN, vol. 4902, pp. 167–181 (2008)Google Scholar
  4. 4.
    Github. : JavaParser by javaparser. (2015). 1 Mar 2015
  5. 5.
    Forgy, C.L.: Rete: a fast algorithm for the many pattern/many object pattern match problem. Artif. Intell. 19(1), 17–37 (1982)CrossRefGoogle Scholar
  6. 6.
    Frakes, W.B., Baeza-Yates, R.: Information Retrieval: Data Structure and Algorithms. Prentice Hall (1992)Google Scholar
  7. 7.
    Guéhéneuc, Y.G., Sahraoui, H., Zaidi, F.: Fingerprinting design patterns. In Proceedings of the 11th Working Conference on Reverse Engineering (WCRE), pp. 172–181. IEEE Computer Society Press, Washington, DC, USA (2004)Google Scholar
  8. 8.
    Guéhéneuc, Y.G., Jussien, N.: Using explanations for design patterns identification. In: Proceedings of the First IJCAI Workshop Modelling and Solving Problems with Constraints, pp. 57–64 (2001)Google Scholar
  9. 9.
    Tsantalis, N., Chatzigeorgiou, A., Stephanides, G., Halkidis, S.: Design pattern detection using similarity scoring. IEEE Trans. Softw. Eng. 32, 11 (2006)CrossRefGoogle Scholar
  10. 10.
    Guéhéneuc, Y., Antoniol, G.: DeMIMA: a multilayered approach for design pattern identification. IEEE Trans. Softw. Eng. 34 (2008)Google Scholar
  11. 11.
    Yu, D., Zhang, Y., Chen, Z. : A comprehensive approach to the recovery of design pattern instances based on sub-patterns and method signatures. J. Syst. Softw. 103, 1–16 (2015)Google Scholar
  12. 12.
    Shi, N., Olsson, R.: Reverse engineering of design patterns from java source code. In: ASE 06: Proceedings of the 21st IEEE International Conference on Automated Software Engineering, pp. 123–134 (2006)Google Scholar
  13. 13.
    Uchiyama, S., Kubo, A., Washizaki, H., Fukazawa, Y.: Detecting design patterns in object-oriented program source code by using metrics and machine learning. J. Softw. Eng. Appl. 7, 983–998 (2014)CrossRefGoogle Scholar
  14. 14.
    Alnusair, A., Zhao, T., Yan, G.: Rule based detection of design patterns in program code. Int. J. Softw. Tools Technol. Trans. 16(3), 315–334 (2014)Google Scholar
  15. 15.
    Lucia, A.D., Deufemia, V., Gravino, C., Risi, M.: Design pattern recovery through visual language parsing and source code analysis. J. Syst.Softw. 82, 1177–1193 (2009)CrossRefGoogle Scholar
  16. 16.
    Zanoni, M.: Data mining techniques for design pattern detection. Ph.D. Dissertation, Universita degli Studi di Milano-Bicocca (2012)Google Scholar
  17. 17.
    Guéhéneuc,Y.-G.: P-MARt: Pattern-like micro architecture repository. In: Proceedings of the 1st EuroPLoP Focus Group on Pattern Repositories (2007)Google Scholar
  18. 18.
    Arcelli Fontana, F., Caracciolo, A., Zanoni, M.: DPB: a benchmark for design pattern detection tools. In Proceedings of the 16th European Conference on Software Maintenance and Reengineering (CSMR 12) pp. 235–244. IEEE Computer Society, Szeged, Hungary (2012)Google Scholar
  19. 19.
    Ampatzoglou, A., Michou, O., Stamelos, I.: Building and mining a repository of design pattern instances: practical and research benefits. Entertain. Comput. 4, 131–142 (2013)CrossRefGoogle Scholar

Copyright information

© Springer International Publishing AG 2018

Authors and Affiliations

  • Mohammed Ghazi Al-Obeidallah
    • 1
  • Miltos Petridis
    • 2
  • Stelios Kapetanakis
    • 1
  1. 1.Department of ComputingUniversity of BrightonBrightonUK
  2. 2.Department of ComputingMiddlesex UniversityLondonUK

Personalised recommendations