Lune

FSE2023Top-tier venue

HyperDiff: Computing Source Code Diffs at Scale

Quentin Le Dilavrec, Djamel Eddine Khelladi, Arnaud Blouin, Jean-Marc Jézéquel

Abstract

With the advent of fast software evolution and multistage releases, temporal code analysis is becoming useful for various purposes, such as bug cause identification, bug prediction or code evolution analysis. Temporal code analyses can consist in analyzing multiple Abstract Syntax Trees (ASTs) extracted from code evolutions, e.g. one AST for each commit or release. Core feature to temporal analysis is code differencing: the computation of the so-called Diff or edit script between two given versions of the code. However, jointly analyzing and computing the difference on thousands versions of code faces scalability issues. Mainly because of the cost of: 1) parsing the original and evolved code in two source and target ASTs; 2) wasting resources by not reusing intermediate computation results that can be shared between versions. This paper details a novel approach based on time-oriented data structures that makes code differencing scale up to large software codebases. In particular, we leverage on the HyperAST, a novel representation of code histories, to propose an incremental and memory efficient approach by lazifying the well known GumTree diffing algorithms, a mainstream code differencing algorithm and tool. We evaluated our approach on a curated list of 19 large software projects and compared it to GumTree. Our approach outperforms it in scalability both in time and memory. We observed an order-of-magnitude difference: 1) in CPU time from x1.2 to x12.7 for the total time of diff computation and up to x226 in intermediate phases of the diff computation, and 2) in memory footprint of x4.5 per AST node. The approach produced 99.3% of identical diffs with respect to GumTree.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

1 top-tier paper has cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • CodeMapper: A Language-Agnostic Approach to Mapping Code Regions Across Commits cites Accurate method and variable tracking in commit history
  • CodeMapper: A Language-Agnostic Approach to Mapping Code Regions Across Commits cites CodeShovel: Constructing Method-Level Source Code Histories
  • HyperAST: Enabling Efficient Analysis of Software Histories at Scale cites CodeShovel: Constructing Method-Level Source Code Histories
  • Accurate method and variable tracking in commit history cites CodeShovel: Constructing Method-Level Source Code Histories
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers1

  1. CodeMapper: A Language-Agnostic Approach to Mapping Code Regions Across CommitsHuimin Hu, Michael PradelICSE 2026

Builds on3

  1. CodeShovel: Constructing Method-Level Source Code HistoriesFelix Grund, Shaiful Alam Chowdhury, Nick C. Bradley, Braxton Hall et al.ICSE 2021 · 33 citations
  2. Accurate method and variable tracking in commit historyMehran Jodavi, Nikolaos TsantalisFSE 2022 · 12 citations
  3. HyperAST: Enabling Efficient Analysis of Software Histories at ScaleQuentin Le Dilavrec, Djamel Eddine Khelladi, Arnaud Blouin, Jean-Marc JézéquelASE 2022 · 5 citations

Related papers

  1. Fine-grained, accurate and scalable source differencingJean-Rémy Falleri, Matias MartinezICSE 2024 · 9 citations
  2. A Differential Testing Approach for Evaluating Abstract Syntax Tree Mapping AlgorithmsYuanrui Fan, Xin Xia, David Lo, Ahmed E. Hassan et al.ICSE 2021 · 18 citations
  3. iASTMapper: An Iterative Similarity-Based Abstract Syntax Tree Mapping AlgorithmNeng Zhang, Qinde Chen, Zibin Zheng, Ying ZouASE 2023 · 2 citations
  4. Concise, type-safe, and efficient structural diffingSebastian Erdweg, Tamás Szabó, André PacakPLDI 2021 · 6 citations
  5. DIFFBASE: a differential factbase for effective software evolution managementXiuheng Wu, Chenguang Zhu, Yi LiFSE 2021 · 7 citations
Dusk over the sea between two cliffs drawn in fine vertical lines