Exploiting Multi-aspect Interactions for God Class Detection with Dataset Fine-tuning

Shaojun Ren, Chongyang Shi, Shuxin Zhao · 2021

God class refers to a class that undertakes too many responsibilities for tasks that should more appropriately be handled by multiple classes. The existence of god classes seriously affects the maintainability and understandability of software. To eliminate god class, we first need to identify them. Researchers have proposed traditional methods using code metrics and deep learning methods using code metrics and text information to detect god classes. However, the relationship existing in metrics and text information is often ignored; moreover, deep learning methods require a large number of reliable datasets, while authentic god class datasets are scarce. To solve the above problems, we propose a novel god class detection method based on multi-aspect interactions and dataset fine-tuning. First, we use proposed model to extract multi-aspect interaction information, including three parts: (i) the interaction information existing in code metrics; (ii) the interaction information existing in texts; (iii) the interaction information existing in texts and code metrics. In this way, we can not only make use of code metrics and text information, but also fully exploit the multi-aspect interaction information. Second, we train with large-scale synthetic datasets to obtain a pre-trained model, then fine-tune the pre-trained model parameters with high-quality authentic datasets. Using the training method of pre-training and fine-tuning, we can solve the problem of low-reliability synthetic datasets and scarce authentic datasets. Finally, evaluation results on open-source applications suggest that the proposed approach improves on the state-of-the-art.

Read the paper · More papers on PaperTik