Detecting Design Patterns in Android Applications with CodeBERT Embeddings and CK Metrics

Published: 01 Jan 2023, Last Modified: 19 Feb 2025AIST 2023EveryoneRevisionsBibTeXCC BY-SA 4.0
Abstract: As the software codebase increases and the complexity of software increases software developers tend to use simplified tested solutions such as design patterns. These design patterns in most cases tend to be transformed into clients’ requirements documents. Having large software increases the difficulty of understanding the overall architectural design of the overall application. With a speedily growing application of natural language processing (NLP) to source code understanding, in this paper, we propose an approach for detecting design patterns in the Android development domain. Our approach combines source code embeddings together with source code metrics to detect Android applications’ architectural design patterns namely model view controller (MVC), model view presenter (MVP), and model-view-view model (MVVM). We also detect if a design pattern is missing from a project. Our proposed approach was evaluated on a standard publicly available benchmark dataset retrieved from GitHub. The results showed that incorporating CodeBERT embeddings together with CK metrics improves classification performance. In addition, we compare our proposed approach results with the current state-of-the-art.
Loading