Abstract
Nowadays, software has become a complex piece of work that may be beyond our control. Understanding how software evolves over time plays an important role in controlling software development processes. This study investigates the principles of software evolution by applying complex network theories to the structural changes in object-oriented software systems. By analyzing network motifs—small, recurring structural patterns—we find that a motif's stability positively correlates with its abundance. Furthermore, motifs with high Z-scores tend to exhibit stable structures. These findings suggest that software evolution is driven by functional cloning and structural duplication, favoring structural stability. This work provides valuable insights for reverse engineering and the analysis of structural changes in software systems.
Introduction: The "DNA" of Code
As software systems grow in scale and complexity, they often reach a point where traditional metrics like lines of code (LOC) or simple class counts fail to capture the underlying architecture. This research addresses a fundamental question: Are there universal rules governing how software structure evolves? By treating object-oriented (OO) software as a complex network, we can identify recurring subgraphs, or "network motifs," that serve as the building blocks of the system. Much like biological systems, software evolution appears to favor patterns that provide structural stability and facilitate functional "cloning."
Methods and Datasets
The study modeled six diverse OO software systems—ranging from the Visualization Toolkit (VTK) and Tomcat to specialized frameworks like Digital Material (DM) and commercial systems like SCRR—as directed graphs. In these graphs, nodes represent classes or modules, while edges represent relationships such as inheritance or method calls.
To analyze these networks, the researchers employed:
- Motif Detection: Identifying 3-node and 4-node subgraphs that appear significantly more often in real software than in randomized networks.
- Z-Scores: A statistical measure of a motif's significance; high Z-scores indicate non-random, essential building blocks.
- Structural Stability Score (SSS): Motifs were categorized into three classes based on their response to perturbations: Class I (highly stable, e.g., acyclic), Class II (moderately stable, e.g., single feedback loop), and Class III (unstable, e.g., complex multi-loop circuits).
Key Insights: Stability and Simplicity
The analysis revealed several critical principles driving software architecture:
- Stability-Driven Selection: Structural stability is a primary evolutionary driver. Motifs resistant to failures (Class I) are significantly more abundant than unstable ones.
- Simplicity and Reusability: Simpler motifs with fewer edges are encountered more frequently. Fewer constraints on interactions make these micro-structures easier to reproduce or "clone" across a system.
- The Feedback Loop Penalty: Similar to McCabe’s cyclomatic complexity, the presence of feedback loops decreases a motif's stability, explaining the common engineering practice of avoiding circular dependencies.
Results: Significance and Stability
The experimental results consistently showed a positive correlation between a motif's abundance and its structural stability across all six datasets, regardless of the programming language (C++ vs. Java) or application domain.
Motifs with the highest Z-scores—those most statistically significant to the system's structure—almost exclusively belong to the most stable classes (Class I or II). Statistical validation using the Kruskal-Wallis test confirmed that the differences in Z-scores between stability classes were significant, often with greater than 95% confidence.
Conclusion
This research reinforces the view of software systems as artificial complex networks that share properties like "Small World" and "Scale-Free" characteristics with biological networks. The preference for stable, simple motifs suggests that software evolution is a non-random process aimed at maintaining structural integrity. Future work will focus on "evolution complexity," quantifying the cost of changing these micro-structures and how such changes propagate through a system's architecture.
Summary updated