Back close

A declarative approach to detecting design patterns from Java execution traces and source code

Publication Type : Journal Article

Publisher : Elsevier BV

Source : Information and Software Technology

Url : https://doi.org/10.1016/j.infsof.2024.107457

Keywords : Augmented call tree, Declarative specification, Design pattern detection, Execution trace, Gang-of-Four patterns, Java, JIVE, Object-oriented software, SQL query, Structure and behavior

Campus : Amritapuri

School : School of Computing

Department : Computer Science and Engineering

Year : 2024

Abstract : Design patterns are invaluable for software engineers because they help obtain well-structured and reusable object-oriented software components and contribute towards ease of software comprehension, maintenance, and modification. However, identifying design patterns from an inspection of the source code is not easy because, in most cases, there are no syntactic cues that signal their presence. This topic has therefore elicited considerable interest in the field. The novel aspect of our work is that we propose a set of primitives using which we can declaratively specify design patterns based on a combination of static and dynamic information. Our experimental work is carried out in the context of Java: static information is extracted from Java source code, and dynamic information from an execution trace of a program. Each declarative pattern specification is automatically translated into an SQL query which retrieves all instances of the design pattern present in the program. We illustrate our approach with the well-known Gang-of-Four design patterns and the approach extends to other such design patterns. The experimental results show the efficacy of our approach for representative programs for all GoF patterns in addition to more extensive case studies, JHotDraw, Junit, and QuickUML.

Cite this Research Publication : Aswathy Mohan, Swaminathan Jayaraman, Bharat Jayaraman, A declarative approach to detecting design patterns from Java execution traces and source code, Information and Software Technology, Elsevier BV, 2024, https://doi.org/10.1016/j.infsof.2024.107457

Admissions Apply Now