A Network Perspective on Software Modularity
The modularity of a software architecture is considered a key feature that contributes to the sustainability of large scale software projects. Ideally, modularization fosters the decoupling of software development eﬀorts, which can then be performed independently if a binding standard interface is established. As the software evolves in time, modularity might even favor its maintainability and expandability. If the development of a given system is meant to be sustainable, the amount of eﬀort required to perform modiﬁcations in the software architecture must be compatible with the resources (time, human, etc) available at any time. Therefore monitoring the modularity of an evolving software system promises to be an important step towards a sustainable software development regime, however such a task would be tedious and slow if performed manually. In this article we propose an eﬃcient automatic quantitative approach to estimate the coherence between the modularity of the dependency network of large open source Java projects and their decomposition in terms of Java packages. Figure 1 shows an example visualization of the modular structure of the JAVA project AspectJ.
A measure for modular coherence inspired by complex network science
According to our needs, we adopt a network metric which was ﬁrst used to study assortative mixing in networks, which is the tendency for network nodes to be connected to other nodes that are like (or unlike) them in some way. The resulting metric Q (details in the paper) measures the fraction of network edges that connect nodes within the same module minus the expected value of the same quantity measured from a random network with the same node/module allocation. If the ﬁrst is not better than random Q = 0. In general, Q ∈ [−1, 1],i.e. the more modular the network, the closer Q is to 1. Figure 2 provides two examples of networks and their respective Q scores.
In the analysis of software structures, this metric is useful because in many cases the deﬁnition of modules is given by means of programming constructs like classes, ﬁles, namespaces or packages. The Q–metric
The results presented in our paper indicate that the Q-metric known from the analysis of cluster structures in network science is a promising and reasonable approach to quantify the coherence between the package decomposition of large software projects and their dependency structures. As such, it constitutes a macroscopic measure that allows us to monitor and evaluate software engineering processes and reason about the sustainability of software architectures. In particular, it provides a simple mapping from local development activities to their respective impact on the mesoscopic and macroscopic structures of software systems.
Zanetti, Marcelo Serrano; Schweitzer, Frank