Identifying Key Classes in Object-Oriented Software Using Generalized K-Core Decomposition
Weifeng Pan,Beibei Song,Kangshun Li,Kejun Zhang
DOI: https://doi.org/10.1016/j.future.2017.10.006
IF: 7.307
2018-01-01
Future Generation Computer Systems
Abstract:Identifying key classes can help developers familiarize with a previously unknown software system. Complex network research opens new opportunities for identifying key classes, and many approaches have been proposed. However, the software network that existing approaches rely on is un-weighted and un-directed, which does not conform to the reality of a software system. Thus, how to identify key classes by using more accurate software network models and appropriate complex network theories is still a problem that has never been reported. The objective of this paper is to provide a ranked list of classes for new developers as starting points for the program comprehension process. Our approach is based on a more accurate software network and a generalized version of k-core decomposition in complex network research. First, we use a weighted directed software network to represent the topological structure of software at the class level, which takes into consideration both the coupling direction and coupling strength. Then, we propose a generalized k-core decomposition method and use it to calculate the generalized coreness of each class. Finally, we sort classes with respect to their generalized corenesses in a descending order. The top-ranked classes serve as the key class candidates. Experiments have been performed on four open-source software systems. Empirical results have shown that our approach is able to identify a majority of true key classes, with a recall larger than 64% on the subject systems. Comparison studies with other nine static analysis based approaches have also been performed. Results show that our approach performs best in the whole set of subject systems according to the average ranking of the Friedman test. The evaluation indicates that our approach improves the effectiveness of existing approaches on identification of key classes. The key class candidates recommended by our approach can be excellent starting points for program comprehension process. Our approach is a valuable technique for developers who are aiming to gain a thorough understanding of a previously unknown software system.