Authors:
Abir Nacef
1
;
Sahbi Bahroun
2
;
Adel Khalfallah
1
and
Samir Ben Ahmed
1
Affiliations:
1
Faculty of Mathematical, Physical and Natural Sciences of Tunis (FST), Computer Laboratory for Industrial Systems, Tunis El Manar University, Tunisia
;
2
Higher Institute of Computer Science (ISI), Limtic Laboratory, Tunis El Manar University, Tunisia
Keyword(s):
Design Patterns, Singleton Variant, RNN-LSTM Classifier, Machine Learning, SD Classifier.
Abstract:
Design patterns codify standard solutions to common problems in software design and architecture. Given their importance in improving software quality and facilitating code reuse, many types of research are proposed on their automatic detection. In this paper, we focus on singleton pattern recovery by proposing a method that can identify orthodox implementations and non-standard variants. The recovery process is based on specific data created using a set of relevant features. These features are specific information defining each variant which is extracted from the Java program by syntactical and semantic analysis. We are based on the singleton analysis and different proposed features in ou previous work (Nacef et al., 2022) to create structured data. This data contains a combination of feature values defining each singleton variant to train a supervised Machine Learning (ML) algorithm. The goal is not limited to detecting the singleton pattern but also the specification of the implem
ented variant as so as the incoherent structure that inhib the pattern intent. We use different ML algorithms to create the Singleton Detector (SD) and compare their performance. The empirical results demonstrate that our method based on features and supervised ML, can identify any singleton implementation with the specific variant’s name achieving 99% of precision, and recall. We have compared the proposed approach to similar studies namely DPDf and GEML. The results show that the SD outperforms the state-of-the-art approaches by more than 20% on evaluated data constructed from different repositories; PMART, DPB and DPDf corpus in terms of precision.
(More)