Skip to main content
QUICK REVIEW

[Paper Review] Discovery of Layered Software Architecture from Source Code Using Ego Networks

Sanjay B. Thakare, Arvind W. Kiwelekar|arXiv (Cornell University)|Jun 6, 2021
Advanced Software Engineering MethodologiesComputer Science2 references9 citations
TL;DR

This paper proposes a novel, fully automated approach to recover layered software architecture from Java source code by modeling dependencies as ego networks—social network constructs centered on individual nodes. The method outperforms standard techniques in layer accuracy and violation detection across static and evolving systems, demonstrating strong potential for architecture recovery and maintenance.

ABSTRACT

Software architecture refers to the high-level abstraction of a system including the configuration of the involved elements and the interactions and relationships that exist between them. Source codes can be easily built by referring to the software architectures. However, the reverse process i.e. derivation of the software architecture from the source code is a challenging task. Further, such an architecture consists of multiple layers, and distributing the existing elements into these layers should be done accurately and efficiently. In this paper, a novel approach is presented for the recovery of layered architectures from Java-based software systems using the concept of ego networks. Ego networks have traditionally been used for social network analysis, but in this paper, they are modified in a particular way and tuned to suit the mentioned task. Specifically, a dependency network is extracted from the source code to create an ego network. The ego network is processed to create and optimize ego layers in a particular structure. These ego layers when integrated and optimized together give the final layered architecture. The proposed approach is evaluated in two ways: on static versions of three open-source software, and a continuously evolving software system. The distribution of nodes amongst the proposed layers and the committed violations are observed on both class level and package level. The proposed method is seen to outperform the existing standard approaches over multiple performance metrics. We also carry out the analysis of variation in the results concerning the change in the node selection strategy and the frequency. The empirical observations show promising signs for recovering software architecture layers from source codes using this technique and also extending it further to other languages and software.

Motivation & Objective

  • Address the challenge of reverse-engineering layered software architecture from source code, especially when documentation is outdated or missing.
  • Overcome limitations of manual and semi-automatic methods that rely on expert input and introduce bias or cost.
  • Develop a fully automated, scalable approach to reconstruct layered architectures using network analysis principles.
  • Improve interpretability and maintainability of software systems by accurately assigning classes and packages to logical layers.
  • Validate the method on diverse software systems, including continuously evolving ones, to ensure robustness and generalization.

Proposed method

  • Extract dependency relationships between classes and packages in Java systems to construct a directed network representation.
  • Model the dependency network as ego networks, where each node (class/package) acts as an ego with its immediate neighbors forming the first-order neighborhood.
  • Process each ego network to identify and optimize local layer structures based on dependency patterns and connectivity.
  • Integrate and optimize individual ego layers into a global layered architecture through iterative merging and refinement.
  • Apply node selection strategies based on frequency and connectivity to guide layer formation and improve stability.
  • Validate results using metrics such as violation counts (back-call and skip-call), stability, and impact of changes across software versions.

Experimental results

Research questions

  • RQ1Can ego networks be effectively adapted to model and recover layered software architecture from source code dependencies?
  • RQ2How does the proposed ego network-based method compare to standard clustering and architecture recovery techniques in terms of accuracy and violation detection?
  • RQ3What is the impact of node selection strategy and frequency on the quality and stability of the recovered architecture?
  • RQ4How well does the method perform on both static and continuously evolving software systems?
  • RQ5To what extent can the method generalize across different software types and object-oriented languages?

Key findings

  • The proposed method achieved superior performance across multiple metrics compared to four standard approaches in layer recovery and violation detection.
  • On the JHotDraw system, the stability of the latest version (jhd7_6) was 44.46%, indicating increased sensitivity to changes, with 55.54% of violations attributed to new dependencies.
  • The method detected 72.18% of violations in jhd7_2 and 56.24% in jhd7_5_1, demonstrating high sensitivity to architectural drift.
  • The approach showed strong performance on both small and large systems, including the complex, evolving JHotDraw, with high accuracy in layer assignment.
  • Empirical analysis revealed that node selection strategy and frequency significantly influenced layer quality and stability, with optimized strategies reducing violations.
  • The method achieved 100% stability in several versions (e.g., jhd5_3, jhd6_0_b1), indicating consistent architectural integrity under certain conditions.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.