Out of Context: How important is Local Context in Neural Program Repair?

Julian Aron Prenner, Romain Robbes
12/8/2023
cs.SEcs.AI

No confident code implementation found for this paper.

Abstract

Deep learning source code models have been applied very successfully to the problem of automated program repair. One of the standing issues is the small input window of current models which often cannot fully fit the context code required for a bug fix (e.g., method or class declarations of a project). Instead, input is often restricted to the local context, that is, the lines below and above the bug location. In this work we study the importance of this local context on repair success: how much local context is needed?; is context before or after the bug location more important? how is local context tied to the bug type? To answer these questions we train and evaluate Transformer models in many different local context configurations on three datasets and two programming languages. Our results indicate that overall repair success increases with the size of the local context (albeit not for all bug types) and confirm the common practice that roughly 50-60% of the input window should be used for context leading the bug. Our results are not only relevant for researchers working on Transformer-based APR tools but also for benchmark and dataset creators who must decide what and how much context to include in their datasets.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{prenner2023context,
  title  = {Out of Context: How important is Local Context in Neural Program Repair?},
  author = {Julian Aron Prenner and Romain Robbes},
  year   = {2023},
  eprint = {2312.04986},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2312.04986v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2312.04986.svg)](https://codeofpaper.com/paper/2312.04986)

Discussion