God Class Detection Approach Based on Graph Model and Isolation Forest
Author:
Affiliation:

Clc Number:

TP311

Fund Project:

National Key Research and Development Program of China (2016YFB1000801)

  • Article
  • |
  • Figures
  • |
  • Metrics
  • |
  • Reference
  • |
  • Related
  • |
  • Cited by
  • |
  • Materials
  • |
  • Comments
    Abstract:

    God class refers to a class that carries heavy tasks and responsibilities. The common feature of God class is that it contains a large number of attributes and methods, and has multiple dependencies with other classes in the system. God class is a typical code smell, which has a negative impact on the development and maintenance of the software. In recent years, many studies have been devoted to discovering or refactoring the God class; however, the detection ability of existing methods is not strong, and the detection precision is not high enough. This study proposes a God class detection approach based on graph model and isolation forest algorithm, which can be divided into two stages:The stage of the graph structure information analysis and the stage of intra-class measurement evaluation. In the stage of the graph structure information analysis, inter-class method call graphs and intra-class structure graphs are established, respectively. The isolation forest algorithm is used to reduce the detection range of God class. In the stage of the intra-class measurement evaluation, the impact of the scale and architecture of the project is taken into account, and the average value of the God class related measurement indicators in the project is used as the benchmark. An experiment is designed to determine the scale factors, and the product of the average value and the scale factors are used as the threshold for the detection to obtain the God class detection result. The experimental results on the code smell benchmark data set show that the method proposed in this article improves the precision and F1 value by 25.8 percentage points and 33.39 percentage points, respectively, compared to an existing God class detection method, with a high recall at the same time.

    Reference
    Related
    Cited by
Get Citation

刘弋,吴毅坚,彭鑫,闫亚东.基于图模型和孤立森林的上帝类检测方法.软件学报,2022,33(11):4046-4060

Copy
Share
Article Metrics
  • Abstract:
  • PDF:
  • HTML:
  • Cited by:
History
  • Received:November 19,2020
  • Revised:January 29,2021
  • Adopted:
  • Online: May 21,2021
  • Published: November 06,2022
You are the firstVisitors
Copyright: Institute of Software, Chinese Academy of Sciences Beijing ICP No. 05046678-4
Address:4# South Fourth Street, Zhong Guan Cun, Beijing 100190,Postal Code:100190
Phone:010-62562563 Fax:010-62562533 Email:jos@iscas.ac.cn
Technical Support:Beijing Qinyun Technology Development Co., Ltd.

Beijing Public Network Security No. 11040202500063