Design Pattern Recommendation Using Doc2vec

Nada Shorim, Mohammad El‐Ramly, Hanaa Bayomi Mobarz · 2023

Design patterns are widely recognized as valuable tools in software engineering for improving software quality and reducing development time. Selecting a suitable design pattern is crucial for creating high-quality software systems. The wrong design pattern can lead to difficult-to-maintain code. The appropriate design pattern can improve the overall quality of the software, making it easier to maintain, modify, and extend over time. However, selecting the appropriate design pattern for a specific design problem from textual descriptions is challenging and requires a deep understanding of their functionality and characteristics. In order to address this challenge, a recommendation system is developed that utilizes text classification through the application of doc2vec. This approach has not been previously explored in research and has the potential to be highly effective. This approach involves: first, preprocessing techniques such as stop word removal, tokenization, and stemming are applied to design pattern category descriptions, design patterns' descriptions, and problem scenarios. Second, doc2vec is applied for word embeddings to create the model. The study evaluates two approaches for selecting design patterns. The first approach focuses solely on making a recommendation based on the descriptions of the design patterns themselves and achieves an accuracy of 54.3%, making accurate recommendations for 25 out of 46 problems. The second approach considers the category of the design patterns before making a selection, resulting in an enhanced accuracy of 65.21% and correctly recommending a design pattern for 30 out of 46 problems. The second approach outperforms the first by leveraging the design pattern category, significantly narrowing the search space and improving recommendation accuracy. These initial results are promising and pave the way for further improvement by enhancing the technique or combining doc2vec with other techniques.

Read the paper · More papers on PaperTik