S|Research Notes
Back to LibraryLiterature Review / Vol. 2024
01 /

Research Problem

Analyzing large-scale software architectures is difficult because code files, developer ownership, documentation, and version control metadata reside in separate silos. Existing static analysis tools look at dependencies but fail to represent the richer semantic relationships, developer collaboration networks, and evolutionary shifts, making it hard to identify structural decay and architectural drift.


02 /

Proposed Solution

The authors present a framework to extract and represent multi-dimensional software repositories as a **Software Knowledge Graph (SKG)**. The schema models code entities (classes, methods, packages), social entities (developers, commits), and architectural specs (design patterns, API endpoints). Developers can run semantic SparQL or Cypher queries to detect structural flaws, locate modules that violate architectural layering, and identify technical debt hotspots.


03 /

Methodology & Evaluation

Implemented an automated pipeline that parses code repositories (generating ASTs), extracts git commit history, and maps these entities into a Neo4j graph database. The methodology was validated against three large open-source systems (including Kubernetes) to find structural discrepancies, and verified by architectural engineers via a user study.


04 /

Main Contributions

  • Defined a standardized ontology schema mapping code semantics to developer social networks and version control commits.
  • Built an automated parser and graph generator that runs in CI/CD pipeline environments.
  • Formulated Cypher queries that mathematically detect classic architectural smells (e.g. cyclic dependencies, hub-like components, unstable interfaces).

05 /

Limitations & Weaknesses

  • Graph database storage requirements and query execution times scale exponentially for repositories exceeding 10M lines of code.
  • Parsing dynamically-typed languages (like JavaScript/Python) yields a less complete class/method dependency graph compared to statically-typed languages (Java/Go).

06 /

Key Takeaways

Intertwining social factors (who modified what) with technical dependencies (what imports what) yields a 2x better prediction of architectural decay.

Representing codebase structure as a graph makes it highly accessible for machine learning models and graph neural networks (GNNs).


07 /

How This Relates to My Research

Strategic Alignment

This is a direct pillar of my research in Knowledge Graph Modeling and Software Architecture. It validates how graph-based models can solve complex code analysis tasks and provides a framework I want to extend by integrating LLMs to query the graph using natural language.


08 /

Future Research Ideas

  • Integrate an LLM agent with a vector database containing graph node descriptions, enabling developers to ask 'Where is the layer boundary violated?' in natural language and receive Cypher queries.
  • Add real-time git hook validation that blocks commits if the graph query detects that the change would introduce a cyclic architectural dependency.

09 /

References

Chand, S., Khan, A., & Johansson, M. (2024). Constructing and querying software knowledge graphs for architecture analysis. *Journal of Systems and Software*, 208, 111952.