TL;DR
This paper introduces SCuV, a novel tool for visualizing software architecture by clustering code based on invocation relationships. Unlike existing tools, SCuV provides an invocation-aware and dynamically adjustable hierarchical view, making it easier to understand complex software systems.
What Problem Does This Paper Address?
Understanding the architecture of large software systems is crucial for maintenance, reengineering, and impact analysis. Traditional software clustering tools often rely on static dependencies like directory structure or function calls, but they struggle to represent the dynamic invocation flow between modules. This makes it difficult for engineers to grasp how different parts of a system interact, especially when design documentation is unavailable or outdated. The paper highlights two key limitations of existing tools: a lack of awareness of invocation order and a preference for static, non-interactive visualizations.
Methods
SCuV employs a two-phase approach:
- Source Code Analysis: It first analyzes the source code (currently supporting Java) to build a call graph, representing function invocations. This graph serves as the input for the clustering process. The authors mention plans to incorporate implicit dependencies like classloading and reflection in future versions.
- Hierarchical Clustering: This phase involves two main steps:
- Entry-based Clustering: Connected components of the call graph are identified. Within each component, "entry functions" are detected, and functions solely invoked by them are grouped into larger modules. This process iteratively merges modules until no more entry functions exist.
- PageRank-based Clustering: A variation of the PageRank algorithm is applied to a module invocation-dependency graph (MIDG) derived from the previous step. This helps determine coupling costs between modules. Modules are then merged based on their PageRank scores and coupling degrees, iteratively building a higher-level MIDG until a single cluster is formed.
The tool also features a naming strategy that uses package and class names, and for merged modules, it adopts textual mining techniques. The visualization component offers a hierarchical and dynamically adjustable view, allowing users to zoom in and out to explore different levels of detail.
Datasets
The paper uses the Weka software system (version 3.0) as a case study for demonstration. Weka is described as a Java-based system containing 10 packages, 147 class files, and a total of 95 KLOC (thousand lines of code). No new benchmarks are introduced; rather, an existing, well-known software project is used to showcase the tool's capabilities.
Key Insights and Ideas
- Invocation Awareness is Key: The paper strongly emphasizes that understanding how modules invoke each other is as important as knowing that they are connected. SCuV's ability to represent this dynamic flow is a significant differentiator.
- Granularity is Crucial for Comprehension: The ability to dynamically adjust the level of detail in the visualization (zoom in/out) allows users to get both a high-level overview and a deep dive into specific module interactions.
- Bridging the Gap: SCuV aims to bridge the gap between static code analysis and the dynamic behavior of software, offering a more realistic architectural representation.
- Potential for Interactive Tools: The authors suggest that SCuV's design is well-suited for interactive platforms like iPads or large touch-screen systems, enhancing collaborative software engineering and individual comprehension.
Key Results
The paper primarily focuses on demonstrating the capabilities of the SCuV tool rather than presenting quantitative performance metrics. The key qualitative results are:
- SCuV successfully produces invocation-aware hierarchical clusters of the Weka software system.
- The visualization allows for dynamic navigation, enabling users to explore the software architecture at different granularities.
- The tool provides a more intuitive understanding of module relationships compared to traditional IDEs like Eclipse, especially when dealing with complex invocation chains.
Limitations and Future Work
- Limited Language Support: Currently, SCuV only supports Java. The authors state it could be extended to other programming languages.
- Explicit Function Calls Only: The current version of the source code analyzer only considers explicit function calls when building the call graph.
- Future Work: The authors plan to incorporate implicit dependencies such as classloading and reflection into the call graph analysis. They also suggest exploring further improvements to the visualization and interactive features.
Summary updated