Features and Supervised Machine Learning Based Method for Singleton Design Pattern Variants Detection
Abir Nacef, Sahbi Bahroun, Adel Khalfallah, Samir Ben Ahmed
2023
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 implemented 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.
DownloadPaper Citation
in Harvard Style
Nacef A., Bahroun S., Khalfallah A. and Ben Ahmed S. (2023). Features and Supervised Machine Learning Based Method for Singleton Design Pattern Variants Detection. In Proceedings of the 18th International Conference on Evaluation of Novel Approaches to Software Engineering - Volume 1: ENASE, ISBN 978-989-758-647-7, SciTePress, pages 226-237. DOI: 10.5220/0011992100003464
in Bibtex Style
@conference{enase23,
author={Abir Nacef and Sahbi Bahroun and Adel Khalfallah and Samir Ben Ahmed},
title={Features and Supervised Machine Learning Based Method for Singleton Design Pattern Variants Detection},
booktitle={Proceedings of the 18th International Conference on Evaluation of Novel Approaches to Software Engineering - Volume 1: ENASE,},
year={2023},
pages={226-237},
publisher={SciTePress},
organization={INSTICC},
doi={10.5220/0011992100003464},
isbn={978-989-758-647-7},
}
in EndNote Style
TY - CONF
JO - Proceedings of the 18th International Conference on Evaluation of Novel Approaches to Software Engineering - Volume 1: ENASE,
TI - Features and Supervised Machine Learning Based Method for Singleton Design Pattern Variants Detection
SN - 978-989-758-647-7
AU - Nacef A.
AU - Bahroun S.
AU - Khalfallah A.
AU - Ben Ahmed S.
PY - 2023
SP - 226
EP - 237
DO - 10.5220/0011992100003464
PB - SciTePress