سند علمی

Fractal dimension in software networks

چکیده

– A large number of real networks are characterized by two fundamental properties: they are small world and scale-free. A recent paper demonstrated that the structure of many complex networks is also self-similar under a length-scale transformation, and calculated their fractal dimension using the “box counting” method. We studied nine large object-oriented software systems, finding that the graphs associated to these networks are self-similar. We also studied the time evolution of the fractal dimension during system growth, finding a significant correlation between the fractal dimension and object-oriented complexity metrics known to be correlated with software fault-proneness. Thus, in software systems the fractal dimension could be considered as a measure of internal complexity, and consequently of the system quality. Introduction. – Small-world and scale-free properties have been found in a large number of real networks [1]. A recent study [2] has found that the structure of these networks is often also self-similar, and it is possible to calculate their fractal dimension using the box-counting method. This method consists in covering the entire network with the minimum number of boxes NB of linear size B . If the number of boxes scales with the linear size B following a power law (see eq. (1)), then dB is the fractal dimension, or box dimension, of the graph [3]: NB ( B) ∼ −dB B . (1) Song et al. applied this procedure to several different real networks: a part of WWW, a social network, the biological networks of protein-protein interaction found in E. Coli and H. Sapiens, etc., finding consistent self-similar behavior. On the other hand, they analyzed also the Barabasi-Albert growth model of complex networks [4] —which introduces the concept of preferential attachment— finding that graphs generated in this way, as well as the Internet, are not self-similar(). In our research, we studied whether networks associated to software systems have a fractal dimension associated, and in this case what is its value. In particular, we considered object-oriented (OO) software systems, OO programming being the most widely used software technology. Object-oriented systems. The basic building block of OO programming is the class, composed of a data structure and of procedures able to access and process these data. The data structure is made up of fields (instance or class variables) that represent the state of an object. (1)See Supplementary Information of paper [2]. c © EDP Sciences Article published by EDP Sciences and available at http://www.edpsciences.org/epl or http://dx.doi.org/10.1209/epl/i2006-10384-1 1222 EUROPHYSICS LETTERS A class has also a behavior expressed in terms of methods that represent the procedures able to access and process the data structure. Classes may be defined at various levels of complexity, and are related across different kinds of binary relationships, such as inheritance, composition and dependence. A class may inherit from another class both state and behavior through an inheritance relation; the former is called subclass, the latter superclass. Declaring a field of a given class within another class leads to a composition relationship between the classes. A possible definition of dependence of class A on class B (among others found in the literature that are in practice equivalent) is that A depends on B if A accesses a field or calls a method defined in B. All these relationships are directed, in the sense that they involve a class that supplies some service (server class), and a class that uses this service (client class). When developing an OO software system, software engineers write classes and link them with other classes of the system. The interactions between all the classes yield the program functionality. Analyzing the source code of an OO system, it is possible to build its class graph —a graph whose nodes are the classes, and the graph edges represent directed relationships between classes. In this graph, the in-degree of a class is the number of edges directed toward the class, and is related to the usage level of this class in the system. On the other hand, the out-degree of a class is the number of edges leaving the class, and represents the level of usage the class makes of other classes in the system. It has already been shown that software networks are small-world and scale-free [5–7]. The in-degree distributions are power laws with exponent γ ≈ 2.5. The out-degree distributions are more controversial. Some authors found power law behavior [5–7], whereas others found a lognormal behavior [8]. Software networks have not yet been studied in order to find fractal properties in their topology. This perspective could be very interesting for software engineering, because one of the most desirable properties of OO architecture is modularity, and Song et al. in a recent paper [9] showed that fractal networks are characterized by a modular hierarchical structure. This implies that a well-engineered OO system, being modular, should show self-similarity. In this paper we investigate on the fractal properties of OO software systems, and demonstrate that a fractal dimension exists also for this kind of networks, as expected due to the above considerations. We also investigate on the relationship between the fractal dimension computed for various OO systems, and standard metrics related with software quality. The Chidamber and Kemerer Suite of object-oriented quality metrics. The definition and the validation of a suite of quality metrics for OO software systems plays an important role in the software engineering research field. The most known suite of OO metrics is that of Chidamber and Kemerer (CK). The CK suite is composed of six metrics: Weighted Methods per Class (WMC), Coupling Between Object Classes (CBO), Depth of Inheritance Tree (DIT), Number of Children (NOC), Response for a Class (RFC), Lack of Cohesion of Methods (LCOM) [10]. Some CK metrics measure internal properties of classes, for example the number of methods (WMC) and their cohesion. Cohesive methods share at least one of the class fields with another method. The lack of cohesion metric (LCOM) is the difference between the number of non-cohesive methods pairs and the number of cohesive pairs. CBO is a count of the number of other classes which a given class is coupled to, hence denotes the class dependency on other classes in the system. CBO metric for a given class is strictly related to the out-degree of the class node in the class graph, where links represent dependences between classes. RFC for a given class A is computed as the sum of the number of methods defined in A and of the cardinality of the set of methods called by them and belonging to external classes. The number of elements of this set is equal to the weighted number of out-links of class-A node, if the link between class A and another class B is weighted with the number of different methods of B called by A (weighted dependence). G. Concas et al.: Fractal dimension in software networks 1223 NOC and DIT measure properties of the inheritance tree. The NOC metric of a class is the number of directed subclasses of the class. The DIT metric of a class is the number of nodes (classes) to be crossed to reach the root of the inheritance tree. CK metrics have been widely validated in the literature, [11–14]. Many researchers found a correlation between some CK metrics and the fault-proneness of classes. Others found that some CK metrics are correlated with the effort needed for maintaining the classes. Among CK metrics, CBO is certainly the most validated, and almost always found highly correlated with system fault-proneness. High coupling negatively affects the system quality because if a bug is injected into a class this may potentially infect all the classes that depend on it. So the class coupling must be kept as low as possible. Other CK metrics which were often found to be correlated with system faults are WMC and RFC. For each software system studied, we calculate both the fractal dimension and CK metrics. We repeat these measures for different versions of the system and observe similar patterns between the evolution of the fractal dimension and the evolution of the system quality, expressed in terms of some CK metrics. Fractal dimension of software systems. – We studied the class graphs of the following nine OO software systems, whose source code is freely available on the Internet: JDK, Eclipse, Eclipse Birt, Netbeans, JBoss, Visual Works, SmallTalk/X, Squeak and GlassFish(). Using the same procedure followed by Song et al. [2], we calculated the fractal dimension dB for each of the considered graphs. All these graphs revealed a self-similar structure. Note that the box-counting algorithm defined in [2] works only for non-directed graphs, because the distance between two nodes taken as the shortest path between the nodes would not satisfy the expected commutative property in the case of directed graphs. For this reason, we did not consider link orientation in the computation of the fractal dimension of the graphs. The coverage algorithm used to tile the entire network with boxes of size B was devised after many tests with different possible algorithms. While a proof of its optimality is out of discussion, being the optimization problem in the NP-complete complexity class (see footnote ()), it yielded the best tiling we were able to find, and on the networks studied in [2] it yielded the same results reported there. It is also computationally quite efficient, because tiling a network with 10000 nodes and 140 000 links, varying B from 2 to 16 with steps of one, takes less than 30′′ on a 3GHz PC. It may be described as follows. For B = 2: 1) a node is selected randomly among those with smallest degree and is used as a seed; 2) the nodes having a distance less than B from the seed and from each other are assigned to a box, and the nodes belonging to the box are burned; 3) steps 1) and 2) are repeated considering only non-burned nodes, until all nodes are assigned to their respective boxes. In step 1) we choose the nodes with smallest degree because we found that, starting with the nodes with highest degree (the hubs of the network), we tend to find in the beginning some boxes with very many nodes, but then we leave out many other poorly connected nodes. In the end, the value of NB tends to be higher when following the latter procedure. The proposed algorithm was also tested to work better than simple random choice of the seed node of step 1). For B > 2, the tiling starts from the previous tiling made for B − 1 and proceeds in the following way: 1) a box is selected randomly among those with smallest cardinality; 2) all boxes adjacent to the selected one are probed, trying to merge them with it; if the merging yields a new box whose nodes have a distance less than B from each other, it is retained and the two merged boxes are burned; 3) steps 1) and 2) are repeated considering only non-burned (2)The Web sites of these projects are, in the same order of citation: java.sun.com, www.eclipse.org, www. eclipse.org/birt, www.netbeans.org, www.jboss.org, smalltalk.cincom.com, www.exept.de, www.squeak. org, glassfish.dev.java.net. 1224 EUROPHYSICS LETTERS −14 −12 −10 −8 −6 −4 −2 0

اسناد مشابه

  • Computing the Fractal Dimension of Software Networks

    سند علمی۲۰۰۹Mario Locci, Giulio Concas, Ivana Turnu

    Given a large software system, it is possible to associate to it a graph, also known as software network, where graph nodes are the software modules (packages, files, classes or other software entities), and graph edges are the relationships between modules. A recent paper by som

  • Box-covering algorithm for fractal dimension of weighted networks.

    سند علمی۲۰۱۳Scientific reportsDai-Jun Wei, Qi Liu, Hai-Xin Zhang, Yong Hu

    Box-covering algorithm is a widely used method to measure the fractal dimension of complex networks. Existing researches mainly deal with the fractal dimension of unweighted networks. Here, the classical box covering algorithm is modified to deal with the fractal dimension of wei

  • Comparison Density and Fractal Dimension of Drainage Networks in Different Scales and Precision Different (Case Study: Ilam Watersheds)

    مقاله۲۰۱۹پژوهشنامه مدیریت حوزه آبخیزAlimoradi, Mahtab، Ekhtesasi, Mohammadreza، Karimi, Haji، Taze, mahdi

    Every phenomena in the nature, despite the complexity of the subject, has certain rules and regulations. River pattern and behavior as one of the most complex natural phenomena to this is not an exception. Depending on geomorphologic, climatic, topographic and erosive conditions,

  • An Analysis of Applying Fractal Dimension to Stream Networks

    سند علمی۲۰۱۷Adam Zhang, Fred Swanson, Desiree Tullos

    Fractal dimensions have been frequently applied to generalize the complexity and drainage of particular stream networks. Certain techniques to calculate dimension have become particularly popular, specifically the Divider method, functional-box counting, and as a function between

  • A Neural-Network-Based Fault Diagnosis Approach for Analog Circuits by Using Wavelet Transformation and Fractal Dimension as a Preprocessor

    سند علمی۲۰۱۰Wenji Zhu, Yigang He

    This paper presents a new method of analog fault diagnosis based on back-propagation neural networks (BPNNs) using wavelet decomposition and fractal dimension as preprocessors. The proposed method has the capability to detect and identify faulty components in an analog electronic

  • Network Traffic Deviation Detection Based on Fractal Dimension

    سند علمی۲۰۱۲CITAfshin Shaabany, Fatemeh Jamshidi

    In this paper we examine aggregate network traffic for deviation detection. The precise and fast detection of network traffic deviation is crucial to improve the efficient operation of a network. It is often difficult to detect the time when the defects occur in a network. In thi