Multi-Language Detection of Design Pattern Instances
Authors:
- Hugo AndradeHAHugo Andrade
- João BispoJBJoão Bispo
- Filipe F. CorreiaFCFilipe F. Correia
Preprint
Abstract
Code comprehension is often supported by source code analysis tools which provide more abstract views over software systems, such as those detecting design patterns. These tools encompass analysis of source code and ensuing extraction of relevant information. However, the analysis of the source code is often specific to the target programming language. We propose DP-LARA, a multi-language pattern detection tool that uses the multi-language capability of the LARA framework to support finding pattern instances in a code base. LARA provides a virtual AST, which is common to multiple OOP programming languages, and DP-LARA then performs code analysis of detecting pattern instances on this abstract representation. We evaluate the detection performance and consistency of DP-LARA with a few software projects. Results show that a multi-language approach does not compromise detection performance, and DP-LARA is consistent across the languages we tested it for (i.e., Java and C/C++). Moreover, by providing a virtual AST as the abstract representation, we believe to have decreased the effort of extending the tool to new programming languages and maintaining existing ones.Keywords
All Related Versions
This publication has 28 references indexed in Scilit:
- Feature-based software design pattern detectionJournal of Systems and Software, 2022
- Detecting design patterns: a hybrid approach based on graph matching and static analysisInformation Technology and Management, 2021
- Clava: C/C++ source-to-source compilation using LARASoftwareX, 2020
- Compilation of MATLAB computations to CPU/GPU via C/OpenCL generationConcurrency and Computation: Practice and Experience, 2020
- Design pattern detection approaches: a systematic review of the literatureArtificial Intelligence Review, 2020
- Software Metrics and tree-based machine learning algorithms for distinguishing and detecting similar structure design patternsSN Applied Sciences, 2019
- Aspect composition for multiple target languages using LARAComputer Languages, Systems & Structures, 2018
- Source code and design conformance, design pattern detection from source code by classification approachApplied Soft Computing, 2015
- Design pattern detection using a DSL-driven graph matching approachJournal of Software: Evolution and Process, 2014
- Language-independent detection of object-oriented design patternsComputer Languages, Systems & Structures, 2004