2022/03/16 by Pritom Saha Akash, Akash, Pritom Saha, Chang, Kevin Chen-Chuan
Computer Science · #Artificial Intelligence (cs.AI) #FOS: Computer and information sciences #Software Engineering (cs.SE) #Software Engineering Research #Software Engineering Techniques and Practices #Software System Performance and Reliability #Software Testing and Debugging Techniques
paper · pdf · doi:10.48550/arxiv.2203.08787
openalex publication_date 2022/03/16 · openalex created_date 2022/05/05 · openalex updated_date 2026/07/28
The code smell is a sign of design and development flaws in a software system\nthat reduces the reusability and maintainability of the system. Refactoring is\ndone as an ongoing practice to remove the code smell from the program code.\nAmong different code smells, the God class or Blob is one of the most common\ncode smells. A god class contains too many responsibilities, violating\nobject-oriented programming design's low coupling and high cohesiveness\nprinciples. This paper proposes an automatic approach to extracting a God class\ninto multiple smaller classes with more specific responsibilities. To do this,\nwe first construct a graph of methods (as nodes) for the concerning god class.\nThe edge between any two methods is determined by their structural similarity,\nand the feature for each method is initialized using different semantic\nrepresentation methods. Then, the variational graph auto-encoder is used to\nlearn a vector representation for each method. Finally, the learned vectors are\nused to cluster methods into different groups to be recommended as refactored\nclasses. We assessed the proposed framework using three different class\ncohesion metrics on sixteen actual God Classes collected from two well-known\nopen-source systems. We also conducted a comparative study of our approach with\na similar existing approach and found that the proposed approach generated\nbetter results for almost all the God Classes used in the experiment.\n