# Analysis on Influential Functions in the Weighted Software Network

Authors: Haitao He; Chun Shan; Xiangmin Tian; Yalei Wei; Guoyan Huang
Journal: Security and Communication Networks
 (2018)

---

## Abstract

Identifying influential nodes is important for software in terms of understanding the design patterns and controlling the development and the maintenance process. However, there are no efficient methods to discover them so far. Based on the invoking dependency relationships between the nodes, this paper proposes a novel approach to define the node importance for mining the influential software nodes. First, according to the multiple execution information, we construct a weighted software network (WSN) to denote the software execution dependency structure. Second, considering the invoking times and outdegree about software nodes, we improve the method PageRank and put forward the targeted algorithm FunctionRank to evaluate the node importance (NI) in weighted software network. It has higher influence when the node has lager value of NI. Finally, comparing the NI of nodes, we can obtain the most influential nodes in the software network. In addition, the experimental results show that the proposed approach has good performance in identifying the influential nodes.


---

## Body

## 1. Introduction

Measuring accurately the importance of the node in the software networks is the premise to improve the security and robustness of software [1, 2]. Moreover, with the development of the software, measuring the importance of nodes in the network has practical significance for defending and protecting the influential nodes in the software network [3], if these nodes are suffered by deliberate attacks, maybe cascading failure occurs [4, 5]. Accordingly, how to mine the potential characteristics of software to control the evolution process of the software structure has become a hot spot for researching [6–9].Many researchers introduced the idea of complex networks to the field of software structure and abstracted software to a network from different granularity point [10]. With the network structure, many potential characteristics can be discovered directly. Ma et al. [11] abstracted interaction relationship between packages into a software network, and they defined functions in package as nodes and dependencies among functions as edges. Wang et al. [12] proposed an approach to study the evolution of special software kernel components, which adopted the theory of complex networks. They also proposed a generic method to find major structural changes that happened during the evolution of software systems. Li et al. [13] proposed a modular attachment mechanism of software network evolution. Their approach treated object-oriented software system as a modular network, which was more realistic. A new definition of asymmetric probabilities was given to acquire links in directed networks when new nodes attached to the existing network. With the directed network, both of the “scale-free” and “small-world” properties were verified to be present in the software network. In [14], David proposed a method to simplify the complexity of the software network. With the method, some valuable characteristics in the network could be obtained easily. From the researches above, the complex network was proved to be applicative in the software engineering and it brought us a new perspective to research the software structure. However, these methods of modeling the software mentioned above were based on the static structure of the source code. The execution characteristic during the software running process was neglected in these methods. For the software, most of the characteristics are exhibited during the execution process.The characteristics of the software execution can help us to understand the software better. It is obvious that the node is an important part of the network and it has enormous influence on the stability, reliability, and robustness of the network [15]. For a software network, the software function plays a critical role in the stability and robustness of the software during the execution process. In the structure of the software, the functions carry most of the feature characteristics and topology information and they can affect each other. In most cases, the fault of a function is not only caused by itself but also infected by the other functions. Recently, the importance of the node in the network was defined from different aspects. Bhattacharya et al. [2] defined a measure to evaluate relative importance of the nodes in software by assigning a numerical weight to each node of software graph. By the value of the betweenness and the clustering coefficient, Zhang et al. [16] measured the importance of each node to analyze the influence of each node to the entire network. According to the propagation field of the classes, Li et al. [17] put forward an indicator to measure the importance classes in the software network at class level. Based on the value of the indegree and the outdegree of each node, Wang and Lü [18] proposed a method to mine the influential nodes. With the method, they proved that the fault appeared with a large probability in those nodes with large degree value. In the researches above, the node was proved to play a key role to analyze the network. However, the node was regarded as an individual unit, as well as the relationship between the node and the entire network was ignored. In practical application, the network should be considered as a whole, in which the nodes can interact with each other.Considering the above-mentioned shortcomings, the dependency relationship between the function nodes, and the absence of efficient analysis methods, we construct the WSN to show the software structure according to the information of multiple execution. Based on the dependency relationship between the function nodes, we present a targeted method FunctionRank to evaluate the importance of the software nodes. With the analysis result of each node, we rank the influence of each node to mine the top-k nodes. These function nodes have played an important part in ensuring software reliability and stability. So they should be paid more attention in the process of software updating and software maintenance.The primary contributions of this paper can be summarized as follows:(i)
A novel method is proposed to construct weighted software network (WSN). So we make the understanding and recognition of software structure more accurate.(ii)
A measurement node importance (NI) is put forward to evaluate the importance of each node in the network.(iii)
The IC (independent cascade) model as an attack model is used to evaluate the influential functions for software system.(iv)
The proposed algorithm is an effective method for security measurements of cybernetwork and provides basis for software security and reliability improvement.The rest of this paper is organized as follows. The construction process of the weighted software network (WSN) is described in Section2. The node importance of each function node is given definition in Section 3. Then, in Section 4, the method FunctionRank is given to mine the most influential nodes. In Section 5, the performances of the proposed algorithm are showed by experiments. Finally, conclusions and future works of the paper are presented in Section 6.


## 2. Definitions of Weighted Software Network

Complex networks are suitable to show the invoking relationships between the software functions. Based on the information of the multiple execution processes, we define the software execution dependency structure with a directed-weighted network.


### 2.1. Software Network

In this section, according to the multiple execution information, we define a software network to demonstrate the software execution dependency structure. Figure1 shows a real example of software network.Figure 1
The software network.Where each node represents a software function and each edge is the invoking relationship between the functions. In the software network, most of the characteristics can be exhibited during the software execution process.


### 2.2. Weighted Software Network

Next, in order to guarantee the completeness of the experimental data and make the understanding and recognition of software structure more accurate, we define a weighted software network. Compared with the software network, we consider invoking times between the software functions in multiple execution processes as the weight of each edge. The weighted software network is suitable to demonstrate the complex invoking relationships between the software functions. The definition of weighted software network (WSN) is given as follows:(1)WSN=Node,Edge,W,Node,Edge∈software.Figure 2 shows a weighted software network, where Node is a software functions set and Edge is an invoking relationship set between the software functions. We that stands for the weight of edge e is calculated by the following formula:(2)We=∑jwe,e∈Edge,where j is the times of the trials with different experiment cases. we is a value of 1 or 0. If the edge e of one calling relationship appears in an execution trace, no matter how many times of it, let we be 1; otherwise it is 0.Figure 2
Weighted software network.Figure3 presents a simple process of the WSN established. As shown in Figure 3(a), si(1≤i≤5) is a function invoking trace in one-time execution of the software. The trace si contains a series of function calling relationships which can reflect the software execution process. Figure 3(b) shows a structure of WSN, in which the node and the edge of the network are defined as the function and the calling relationship between the functions appearing in s1~s5 in Figure 3(a), the weight of edges represents the number of each calling process executed in the 5 times’ execution, and the times of a calling relationship in some execution processes were ignored.Figure 3
The constructing process of WSN.
(a)
The 5 times’ execution traces (b)
The structure of WSNBased on multiple execution information under the different experimental cases of software, we guarantee the completeness of the experimental data. Function nodes which have appeared during the software multiple execution processes are considered as a set of nodes of the network structure, calling relationship between the software functions is considered as a set of edges, the weight of the edge, we consider the weightc to stand for the edge appearing c times in the N execution traces of the software, and we ignore the times appearing in an execution trace si. In this way, WSN is built.


## 2.1. Software Network

In this section, according to the multiple execution information, we define a software network to demonstrate the software execution dependency structure. Figure1 shows a real example of software network.Figure 1
The software network.Where each node represents a software function and each edge is the invoking relationship between the functions. In the software network, most of the characteristics can be exhibited during the software execution process.


## 2.2. Weighted Software Network

Next, in order to guarantee the completeness of the experimental data and make the understanding and recognition of software structure more accurate, we define a weighted software network. Compared with the software network, we consider invoking times between the software functions in multiple execution processes as the weight of each edge. The weighted software network is suitable to demonstrate the complex invoking relationships between the software functions. The definition of weighted software network (WSN) is given as follows:(1)WSN=Node,Edge,W,Node,Edge∈software.Figure 2 shows a weighted software network, where Node is a software functions set and Edge is an invoking relationship set between the software functions. We that stands for the weight of edge e is calculated by the following formula:(2)We=∑jwe,e∈Edge,where j is the times of the trials with different experiment cases. we is a value of 1 or 0. If the edge e of one calling relationship appears in an execution trace, no matter how many times of it, let we be 1; otherwise it is 0.Figure 2
Weighted software network.Figure3 presents a simple process of the WSN established. As shown in Figure 3(a), si(1≤i≤5) is a function invoking trace in one-time execution of the software. The trace si contains a series of function calling relationships which can reflect the software execution process. Figure 3(b) shows a structure of WSN, in which the node and the edge of the network are defined as the function and the calling relationship between the functions appearing in s1~s5 in Figure 3(a), the weight of edges represents the number of each calling process executed in the 5 times’ execution, and the times of a calling relationship in some execution processes were ignored.Figure 3
The constructing process of WSN.
(a)
The 5 times’ execution traces (b)
The structure of WSNBased on multiple execution information under the different experimental cases of software, we guarantee the completeness of the experimental data. Function nodes which have appeared during the software multiple execution processes are considered as a set of nodes of the network structure, calling relationship between the software functions is considered as a set of edges, the weight of the edge, we consider the weightc to stand for the edge appearing c times in the N execution traces of the software, and we ignore the times appearing in an execution trace si. In this way, WSN is built.


## 3. Node Importance

According to the complex invoking relationships for software system, we show the most common topology structures of the weighted software network in Figure4 to explain the importance of the function node.Figure 4
Three kinds of topology structures.
(a) (b) (c)Definition 1 (IN (indegree nodes)).
For a nodevi, IN is a set of functions which call node vi directly. The IN of node vi is gotten by only one call step.
As shown in Figure4(a), IN(A)={B,C}. The influence of node vi is based on IN (vi) which call vi directly.Definition 2 (ON (outdegree nodes)).
For a nodevi, ON is a set of functions which are called by node vi directly. The number of ON(vi) is vi’s outdegree, CO.
As shown in Figure4(a), ON(A)={B,C,D} and CO (A) = 3.Definition 3 (TN (terminal nodes)).
The nodes that have no outdegree and have no contribution to the influence of other nodes are defined as terminal nodes.
As shown in Figure4(b), C is a terminal node.Definition 4 (LTN (loop terminal nodes)).
The nodes that only have an outlink to their own are defined as loop terminal nodes.
As shown in Figure4(c), C only has an outlink to its own. So C is a loop terminal node.Definition 5 (OD (output degree)).
The weight sum of each edge for a nodevi to its outdegree nodes, OD(vi), is named as output degree of the node vi.
In Figure4(a), the weight of each edge for A to ON(A) is 2, 2, and 5, respectively. OD(A) is the sum of these weights, namely, A’s output degree.Definition 6 (WC (weighted contribution)).
The ratio of the weight for nodevi to node vj and vi’s output degree, WC(vj), is the weighted contribution of vi to vj.
In Figure4(a), the weight of A to B is 2. The weighted contribution of A to B is given as follows:(3)WCB=2ODA=22+2+5=29.Based on the above definitions, the node importance (NI) of node vj is given as follows:(4)NIVj=α+1-α∑INVjWCVj∗NIViCOVj+1,where α is the certain probability of calling a random node for LTN, and the probability of invoking each node is the same. It is set as 0.15 with experimental verification.


## 4. Important Nodes Mining

In this section, we first provide an algorithm outdegree nodes to get the outdegree node list of all nodes, according to the outdegree nodes of each node in the software network, and then we provide another algorithm FunctionRank to calculate NI of each node. In the method FunctionRank, we evaluate the importance of nodes iteratively (see Algorithms1 and 2).Algorithm 1:Outdegree nodes.
Input: node set V, edge set E Output: childStr //the out-degree node list of all nodes (01)for (each vi∈V) (02)for (vsi,vej∈E) (03)if (vi = vsi) (04)childStr += “” + vej; (05) (06)print (vi + childStr); (07)Algorithm 2:FunctionRank.
Input: node vi, childStr (vi) Output: the NI of node vi //evaluate the importance of nodes Process: (01)Initialize NI(vi) = 1f, α = 0.15f (02)if (childStr[vi] != null) (03) outdegree = childStr.size (); (04)for (each vj∈ childStr [vi]) (05)if (vj is equal vi) (06)outdegree - -; (07)else (08)weighMap.put (vj,weight (vi→vj)); (09)weigh += weight (vi→vj); (10) (11) (12)for (each vj∈ childStr [vi]) (13)if (vj is not equal vi) (14)tempNI (vj) += NI (vi) ∗ weighMap.get (vj)/weigh; (15) (16) (17) (18) tempNI (vi) = (α+(1-α)∗tempNI(vi)) ∗ (outdegree (vi) + 1); (19) NI (vi) = tempNI (vi);As shown in algorithm outdegree nodes, for each node in setV we traverse the edges in set E in line (1) and line (2). We define the nodes of an edge as start node vsi and end node vej, respectively. In line (3) to line (4) we add the end node vej of an edge to the childStr of node vi, when node vi equals the start node vsi of the edge. Finally, we print the childStr of vi in line (6).We evaluate the importance of each node in the network by an iterative process, as shown in Algorithm2. In line (1), we initialise NI(vi) as importance of nodes and α as the certain probability to call a random node, respectively. Line (2) to (19) is the iterative process to compute the importance coming from outdegree of the current node and other nodes which call the current node. The computational formula of node importance (NI) is given in line (18); it has higher influence when the node has lager value of NI. Ultimately, the importance for a node (NI) is obtained when error of current NI value and previous NI value is less than a given threshold for all nodes.With the measuring results obtained from Algorithm2, we choose the top-k nodes as the influential nodes for the software network. In Algorithm 3, we illustrate the process of top-k nodes (KN).Algorithm 3:Top-k nodes (KN).
Input: node set N, NI of each node Output: the top - k influential nodes Process:  (01)Initialize list //store the importance of nodes (02)for (each node v∈N) (03)list.add (NI(v)); (04)end for (05) Collections.sort (list); (06) Collections.reverse (list); (07) print list.get (k)In Algorithm3, we initialise list as the measurement list for all the nodes in line (1). Lines (2) to (4) are a looping process to store the NI value for each node. The sorting process is given in line (5) and line (6), the top-k nodes are chosen from the list in line (7).


## 5. Experimental Analysis

A series of experiments were conducted to compare the performance of the proposed algorithm (named as FunctionRank) with different parameter values. They were implemented in JDK1.6.0 and executed on a PC with 3.30 GHz CPU and 5 GB memory.


### 5.1. Experimental Datasets

Firstly, several dynamic software datasets are used to evaluate the performance of the algorithms. The classical software is obtained from the open-source community. These software programs are coded in C or C++, including program software tar and cflow.In the experiment, we chose different versions of tar and cflow, respectively, for experiment. tar is a decompression software for Linux, and cflow is an analysis tool for C program to extract the relationship of function calls (download from the open-source software library:Https://sourceforge.net).


### 5.2. Evaluation on the FunctionRank

We run the algorithm on each version of tar and cflow. By the algorithm FunctionRank, we calculate theNI of each function node. Here we mine top-10 nodes in each version about software tar and cflow. It is shown in Tables 1 and 2, respectively.Table 1
Top-10 influential nodes for each version of software tar.
Function name V1.21 V1.23 V1.25 V1.27 V1.28 Rank/value Rank/value Rank/value Rank/value Rank/value dump_file0 1/3.020 1/2.808 1/2.804 1/2.604 1/2.603 flush_archive 2/2.245 5/1.969 4/1.949 4/1.943 4/1.939 _gnu_flush_read 3/2.212 2/2.130 7/1.593 7/1.592 8/1.591 update_archive 4/2.139 4/2.108 2/2.270 2/2.270 2/2.246 to_chars 5/2.124 3/2.124 3/2.127 3/2.124 3/2.124 _gnu_flush_write 6/1.865 6/1.738 12/1.152 13/1.151 14/1.149 start_header 7/1.672 7/1.673 6/1.698 6/1.674 7/1.674 _open_archive 8/1.589 8/1.581 8/1.578 8/1.578 6/1.803 dump_regular_file 9/1.460 9/1.468 10/1.305 9/1.478 9/1.478 find_next_block 10/1.317 13/1.102 13/1.105 15/1.100 15/1.097Table 2
Top-10 influential nodes for each version of software cflow.
Function name cflow-1.0 cflow-1.1 cflow-1.2 cflow-1.3 cflow-1.4 Rank/value Rank/value Rank/value Rank/value Rank/val print_symbol 1/4.195 1/4.195 1/4.195 1/4.196 2/4.104 yylex 2/3.822 2/3.822 2/3.822 2/3.823 3/4.074 nexttoken 3/2.985 3/2.985 3/2.985 3/2.987 4/3.334 parse_variable_declaration 4/2.309 4/2.309 4/2.309 5/2.310 10/2.310 parse_dcl 5/2.200 5/2.200 5/2.200 7/2.200 11/2.200 gnu_output_handler 6/2.068 6/2.068 6/2.068 8/2.068 12/2.011 yyrestart 7/2.042 7/2.042 7/2.042 9/2.050 8/2.593 alloc_cons 8/2.037 9/42.010 8/2.010 — — tree_output 9/1.985 10/1.985 9/1.985 10/1.993 5/3.101 lookup 10/1.906 11/1.892 11/1.880 11/1.831 14/1.822As it is shown in Table1, for versions tar-1.21 and tar-1.23, theNI of the top-10 are almost the same. The reason is that the difference between the three versions only reflects the number of function calls. In other words, there is no change of the component function of these two versions. In the latest three versions, developers changed the logical contents of some functions or insert new functions into the software to enrich the features of software; on the other hand, the software was simplified or some features were removed to improve the robustness, which results in the ranking variation. For example, in the prior versions node _gnu_flush_read ranked 2nd or 3rd but it ranked 7th and 8th in versions tar-1.25, tar-1.27, and tar-1.28. Table 2 shows the top-10 influential functions of software cflow in different versions. The ranking of some functions in each version of cflow varies but with little range. For example, function print_symbol’s ranking ranges from 1 to 2. So we can make a prediction that it may still be more influential than most others in the next new version. Meanwhile, there is no function alloc_cons for the latest versions cflow-1.3 and cflow-1.4 results in the ranking variation. In other words, there is change of the component function of these two versions.In addition, the number of nodes which have highNI is rather small in each version. These high value nodes have taken a great part in ensuring software reliability and stability. It means that there are little functions that should be paid more attention in software updating and software maintenance. We calculate the count for different range of NI values. The results of software tar and cflow are shown in Figures 5 and 6, respectively.Figure 5
Number of nodes in value scope of tar.Figure 6
Number of nodes in value scope of cflow.As we can see in Figure5, most of nodes are ordinary functions. We would not pay more attention to them. Meanwhile, a handful of nodes that have high NI should be paid more attention. They play important roles in the process of software updating and software maintenance. For cflow, the number of nodes in each scope is shown in Figure 6. It has the same characteristic with tar. The number of nodes with high NI is much less than that of low NI. By paying more attention to these influential nodes in future versions, we can improve software reliability and stability. Thereby we can greatly reduce the amount of work and improve work efficiency.At the same time,NI of the same ranking nodes within different versions has slight wave, as shown in Figures 7 and 8.Figure 7
NI distribution of tar.Figure 8
NI distribution of cflow.As it is shown in Figure7, the NI distribution of software tar is similar extremely in the six versions. With the increasing of node ranking, the NI of each node shows a decrease trend. As the lower rank, the value shows a trend of increase. The higher NI ranges from 0.7 to 3.0; most nodes’ values are around 0.4. The development of versions follows the same laws, the NI of a certain ranking remains stable and the NI distribution of different software versions is nearly the same. So, we can predict the future versions’ trends based on this. Meanwhile, Figure 8 shows the NI distribution of software cflow, the higher NI ranges from 0.8 to 4.0, and most nodes’ values are around 0.5. The curve of each version has the same tendency; namely, the NI distribution of software cflow follows the same trend.


### 5.3. Performance Evaluation

In the study of complex network, we often examine the effectiveness of a method [19, 20] through the analysis of spreading influence about top-k nodes. Therefore, this paper will introduce IC (independent cascade) model. The IC model derived from the SIR (Susceptible-Infected-Recovered) model, the SIR model is a theory about virus spreading and has to be researched widely in complex networks, such as the marketing, advertising, early warning, and social stability. In software engineering, the similar algorithms were used to analyze the change impact [21] and error propagation [22].The IC model is a probability model; when a nodev is activated, it will attempt to activate its inactive outdegree nodes with probability p only once [23]. Whether node v can activate its neighbor nodes successfully, v is still active, but it has no influence later. The communication process is over when there are no influential active nodes in the network, while, in the actual execution process of software, the running fault can affect the other function running due to the invoking relationship. When running fault, all of the invoked functions would affect the normal execution of the parent function. So the faults can widely spread among the function nodes during the running process. So we take IC model as a software attack model to evaluate the effectiveness of our method. A software attack instance is shown in Figure 9.Figure 9
A software attack instance.
(a) (b)We assume the nodea and node b are attacked as Figure 9(a) shows, and then a and d will attack its inactive outdegree nodes with probability p only once, where b and c are attacked successfully by a; meanwhile e and h are attacked successfully by d in Figure 9(b), next a and d have no aggressivity, and the nodes attacked by a and d can attack their inactive outdegree nodes with probability p in the same way. Finally, the number of attacked nodes represents the influence of original attacked nodes.When calculating the influence of the top-k important nodes obtained by different methods, we will separately run IC model about 10 times and then consider the average of active nodes as the performance evaluation of the method.The software key entities typically account for a small proportion and only account for one point five percent to two percent in the study of class size [24]. At the same time, it is not acceptable for the cost of checking most of the key entities. So an appropriate number of key entities is needed to be selected. By ranking all functions as descending order according to the measurements, we chose little key functions for different systems: top 20 for tar and top 30 for cflow.Figure10 shows the average of active nodes for different software versions. In all the different versions of the software systems, key functions identified by NI can activate more nodes than that identified by the method PageRank and MKN [25] as Figure 10 shows. Visibly, compared with another two methods, NI is more effective in the identification of the key functions. The key functions play an important role in software system in terms of reducing the numbers of test data, detecting the vulnerabilities of software structure, and analyzing software reliability, and they should be paid more attention in the process of software updating and software maintenance. Measuring accurately the importance of the node in the software networks is the premise to improve the security and robustness of software. Moreover, with the development of the software, measuring the importance of nodes in the network has practical significance for protecting the influential nodes from deliberate attacks in the software network.Figure 10
The curves of the number of active nodes.


## 5.1. Experimental Datasets

Firstly, several dynamic software datasets are used to evaluate the performance of the algorithms. The classical software is obtained from the open-source community. These software programs are coded in C or C++, including program software tar and cflow.In the experiment, we chose different versions of tar and cflow, respectively, for experiment. tar is a decompression software for Linux, and cflow is an analysis tool for C program to extract the relationship of function calls (download from the open-source software library:Https://sourceforge.net).


## 5.2. Evaluation on the FunctionRank

We run the algorithm on each version of tar and cflow. By the algorithm FunctionRank, we calculate theNI of each function node. Here we mine top-10 nodes in each version about software tar and cflow. It is shown in Tables 1 and 2, respectively.Table 1
Top-10 influential nodes for each version of software tar.
Function name V1.21 V1.23 V1.25 V1.27 V1.28 Rank/value Rank/value Rank/value Rank/value Rank/value dump_file0 1/3.020 1/2.808 1/2.804 1/2.604 1/2.603 flush_archive 2/2.245 5/1.969 4/1.949 4/1.943 4/1.939 _gnu_flush_read 3/2.212 2/2.130 7/1.593 7/1.592 8/1.591 update_archive 4/2.139 4/2.108 2/2.270 2/2.270 2/2.246 to_chars 5/2.124 3/2.124 3/2.127 3/2.124 3/2.124 _gnu_flush_write 6/1.865 6/1.738 12/1.152 13/1.151 14/1.149 start_header 7/1.672 7/1.673 6/1.698 6/1.674 7/1.674 _open_archive 8/1.589 8/1.581 8/1.578 8/1.578 6/1.803 dump_regular_file 9/1.460 9/1.468 10/1.305 9/1.478 9/1.478 find_next_block 10/1.317 13/1.102 13/1.105 15/1.100 15/1.097Table 2
Top-10 influential nodes for each version of software cflow.
Function name cflow-1.0 cflow-1.1 cflow-1.2 cflow-1.3 cflow-1.4 Rank/value Rank/value Rank/value Rank/value Rank/val print_symbol 1/4.195 1/4.195 1/4.195 1/4.196 2/4.104 yylex 2/3.822 2/3.822 2/3.822 2/3.823 3/4.074 nexttoken 3/2.985 3/2.985 3/2.985 3/2.987 4/3.334 parse_variable_declaration 4/2.309 4/2.309 4/2.309 5/2.310 10/2.310 parse_dcl 5/2.200 5/2.200 5/2.200 7/2.200 11/2.200 gnu_output_handler 6/2.068 6/2.068 6/2.068 8/2.068 12/2.011 yyrestart 7/2.042 7/2.042 7/2.042 9/2.050 8/2.593 alloc_cons 8/2.037 9/42.010 8/2.010 — — tree_output 9/1.985 10/1.985 9/1.985 10/1.993 5/3.101 lookup 10/1.906 11/1.892 11/1.880 11/1.831 14/1.822As it is shown in Table1, for versions tar-1.21 and tar-1.23, theNI of the top-10 are almost the same. The reason is that the difference between the three versions only reflects the number of function calls. In other words, there is no change of the component function of these two versions. In the latest three versions, developers changed the logical contents of some functions or insert new functions into the software to enrich the features of software; on the other hand, the software was simplified or some features were removed to improve the robustness, which results in the ranking variation. For example, in the prior versions node _gnu_flush_read ranked 2nd or 3rd but it ranked 7th and 8th in versions tar-1.25, tar-1.27, and tar-1.28. Table 2 shows the top-10 influential functions of software cflow in different versions. The ranking of some functions in each version of cflow varies but with little range. For example, function print_symbol’s ranking ranges from 1 to 2. So we can make a prediction that it may still be more influential than most others in the next new version. Meanwhile, there is no function alloc_cons for the latest versions cflow-1.3 and cflow-1.4 results in the ranking variation. In other words, there is change of the component function of these two versions.In addition, the number of nodes which have highNI is rather small in each version. These high value nodes have taken a great part in ensuring software reliability and stability. It means that there are little functions that should be paid more attention in software updating and software maintenance. We calculate the count for different range of NI values. The results of software tar and cflow are shown in Figures 5 and 6, respectively.Figure 5
Number of nodes in value scope of tar.Figure 6
Number of nodes in value scope of cflow.As we can see in Figure5, most of nodes are ordinary functions. We would not pay more attention to them. Meanwhile, a handful of nodes that have high NI should be paid more attention. They play important roles in the process of software updating and software maintenance. For cflow, the number of nodes in each scope is shown in Figure 6. It has the same characteristic with tar. The number of nodes with high NI is much less than that of low NI. By paying more attention to these influential nodes in future versions, we can improve software reliability and stability. Thereby we can greatly reduce the amount of work and improve work efficiency.At the same time,NI of the same ranking nodes within different versions has slight wave, as shown in Figures 7 and 8.Figure 7
NI distribution of tar.Figure 8
NI distribution of cflow.As it is shown in Figure7, the NI distribution of software tar is similar extremely in the six versions. With the increasing of node ranking, the NI of each node shows a decrease trend. As the lower rank, the value shows a trend of increase. The higher NI ranges from 0.7 to 3.0; most nodes’ values are around 0.4. The development of versions follows the same laws, the NI of a certain ranking remains stable and the NI distribution of different software versions is nearly the same. So, we can predict the future versions’ trends based on this. Meanwhile, Figure 8 shows the NI distribution of software cflow, the higher NI ranges from 0.8 to 4.0, and most nodes’ values are around 0.5. The curve of each version has the same tendency; namely, the NI distribution of software cflow follows the same trend.


## 5.3. Performance Evaluation

In the study of complex network, we often examine the effectiveness of a method [19, 20] through the analysis of spreading influence about top-k nodes. Therefore, this paper will introduce IC (independent cascade) model. The IC model derived from the SIR (Susceptible-Infected-Recovered) model, the SIR model is a theory about virus spreading and has to be researched widely in complex networks, such as the marketing, advertising, early warning, and social stability. In software engineering, the similar algorithms were used to analyze the change impact [21] and error propagation [22].The IC model is a probability model; when a nodev is activated, it will attempt to activate its inactive outdegree nodes with probability p only once [23]. Whether node v can activate its neighbor nodes successfully, v is still active, but it has no influence later. The communication process is over when there are no influential active nodes in the network, while, in the actual execution process of software, the running fault can affect the other function running due to the invoking relationship. When running fault, all of the invoked functions would affect the normal execution of the parent function. So the faults can widely spread among the function nodes during the running process. So we take IC model as a software attack model to evaluate the effectiveness of our method. A software attack instance is shown in Figure 9.Figure 9
A software attack instance.
(a) (b)We assume the nodea and node b are attacked as Figure 9(a) shows, and then a and d will attack its inactive outdegree nodes with probability p only once, where b and c are attacked successfully by a; meanwhile e and h are attacked successfully by d in Figure 9(b), next a and d have no aggressivity, and the nodes attacked by a and d can attack their inactive outdegree nodes with probability p in the same way. Finally, the number of attacked nodes represents the influence of original attacked nodes.When calculating the influence of the top-k important nodes obtained by different methods, we will separately run IC model about 10 times and then consider the average of active nodes as the performance evaluation of the method.The software key entities typically account for a small proportion and only account for one point five percent to two percent in the study of class size [24]. At the same time, it is not acceptable for the cost of checking most of the key entities. So an appropriate number of key entities is needed to be selected. By ranking all functions as descending order according to the measurements, we chose little key functions for different systems: top 20 for tar and top 30 for cflow.Figure10 shows the average of active nodes for different software versions. In all the different versions of the software systems, key functions identified by NI can activate more nodes than that identified by the method PageRank and MKN [25] as Figure 10 shows. Visibly, compared with another two methods, NI is more effective in the identification of the key functions. The key functions play an important role in software system in terms of reducing the numbers of test data, detecting the vulnerabilities of software structure, and analyzing software reliability, and they should be paid more attention in the process of software updating and software maintenance. Measuring accurately the importance of the node in the software networks is the premise to improve the security and robustness of software. Moreover, with the development of the software, measuring the importance of nodes in the network has practical significance for protecting the influential nodes from deliberate attacks in the software network.Figure 10
The curves of the number of active nodes.


## 6. Conclusions and Future Work

In order to understand and recognize software structure better, a novel method is proposed in this paper to mine the influential nodes in weighted software network. Firstly, taking into account the invoking times, we construct a directed-weighted network structure to make the understanding and recognization of software structure more accurate. Then, a measurement of NI is put forward to evaluate the node importance, where we provide an idea of importing PageRank and WSN to Software engineering domain. Furthermore, we also consider the outdegree value as a key parameter to the node importance. The outdegree value can reflect the complexity of the node. Finally, the algorithm named FunctionRank is presented to calculate the NI and the change trends of nodes’ importance are analyzed by different software versions. In addition, the experimental results show that the proposed feasible approach has good performance in identifying the influential software nodes.Although the approach we proposed shows some feasibilities in identifying influence nodes in complex software network, the broad validity of our approach should be demonstrated further. Our future work is using more open-source software network to evaluate the validity to improve our approach.



---

*Source: 1525186-2018-04-01.xml*