Table of Contents
Fetching ...

RepoSummary: Feature-Oriented Summarization and Documentation Generation for Code Repositories

Yifeng Zhu, Xianlin Zhao, Xutian Li, Yanzhen Zou, Haizhuo Yuan, Yue Wang, Bing Xie

TL;DR

RepoSummary tackles the challenge of understanding software repositories by moving from file and module level summaries to feature oriented summaries that reflect how cross file methods realize high level functionalities. It introduces a four phase pipeline combining repository structure analysis, hierarchical code summarization, clustering, and feature driven documentation generation with preserved traceability to code elements. Empirical evaluation on three Java repositories and 26 commits shows stronger feature coverage and more accurate traceability than state of the art baselines HMCS and HGEN, and produces documentation that is easier to understand and better structured. The approach enables faster onboarding, easier maintenance, and improves traceability link recovery while anticipating extension to more languages and larger datasets.

Abstract

Repository summarization is a crucial research question in development and maintenance for software engineering. Existing repository summarization techniques primarily focus on summarizing code according to the directory tree, which is insufficient for tracing high-level features to the methods that collaboratively implement them. To address these limitations, we propose RepoSummary, a feature-oriented code repository summarization approach that simultaneously generates repository documentation automatically. Furthermore, it establishes more accurate traceability links from functional features to the corresponding code elements, enabling developers to rapidly locate relevant methods and files during code comprehension and maintenance. Comprehensive experiments against the state-of-the-art baseline (HGEN) demonstrate that RepoSummary achieves higher feature coverage and more accurate traceability. On average, it increases the rate of completely covered features in manual documentation from 61.2% to 71.1%, improves file-level traceability recall from 29.9% to 53.0%, and generates documentation that is more conceptually consistent, easier to understand, and better formatted than that produced by existing approaches.

RepoSummary: Feature-Oriented Summarization and Documentation Generation for Code Repositories

TL;DR

RepoSummary tackles the challenge of understanding software repositories by moving from file and module level summaries to feature oriented summaries that reflect how cross file methods realize high level functionalities. It introduces a four phase pipeline combining repository structure analysis, hierarchical code summarization, clustering, and feature driven documentation generation with preserved traceability to code elements. Empirical evaluation on three Java repositories and 26 commits shows stronger feature coverage and more accurate traceability than state of the art baselines HMCS and HGEN, and produces documentation that is easier to understand and better structured. The approach enables faster onboarding, easier maintenance, and improves traceability link recovery while anticipating extension to more languages and larger datasets.

Abstract

Repository summarization is a crucial research question in development and maintenance for software engineering. Existing repository summarization techniques primarily focus on summarizing code according to the directory tree, which is insufficient for tracing high-level features to the methods that collaboratively implement them. To address these limitations, we propose RepoSummary, a feature-oriented code repository summarization approach that simultaneously generates repository documentation automatically. Furthermore, it establishes more accurate traceability links from functional features to the corresponding code elements, enabling developers to rapidly locate relevant methods and files during code comprehension and maintenance. Comprehensive experiments against the state-of-the-art baseline (HGEN) demonstrate that RepoSummary achieves higher feature coverage and more accurate traceability. On average, it increases the rate of completely covered features in manual documentation from 61.2% to 71.1%, improves file-level traceability recall from 29.9% to 53.0%, and generates documentation that is more conceptually consistent, easier to understand, and better formatted than that produced by existing approaches.

Paper Structure

This paper contains 28 sections, 7 equations, 8 figures, 6 tables.

Figures (8)

  • Figure 1: Differences between traditional and feature-oriented repository summarization.
  • Figure 2: The framework of RepoSummary.
  • Figure 3: Stability, Separation, Small-Cluster Fraction and Combined Score in different $\gamma$.
  • Figure 4: The prompt template for Feature generation
  • Figure 5: Overview of commit dataset
  • ...and 3 more figures