# TBar: Revisiting Template-based Automated Program Repair

**Authors:** Kui Liu, Anil Koyuncu, Dongsun Kim, Tegawend\'e F. Bissyand\'e

arXiv: 1903.08409 · 2019-06-07

## TL;DR

This paper evaluates the effectiveness of template-based automated program repair (APR) by building TBar, a tool that systematically applies fix patterns, demonstrating unprecedented success on the Defects4J benchmark.

## Contribution

The paper introduces TBar, a simple yet effective APR tool that leverages a comprehensive set of fix patterns, highlighting the importance of fix pattern diversity and the role of fault localization.

## Key findings

- TBar correctly fixes 74/101 bugs with perfect fault localization.
- TBar fixes 43 bugs on Defects4J, surpassing previous approaches.
- Fix pattern diversity significantly impacts APR effectiveness.

## Abstract

We revisit the performance of template-based APR to build comprehensive knowledge about the effectiveness of fix patterns, and to highlight the importance of complementary steps such as fault localization or donor code retrieval. To that end, we first investigate the literature to collect, summarize and label recurrently-used fix patterns. Based on the investigation, we build TBar, a straightforward APR tool that systematically attempts to apply these fix patterns to program bugs. We thoroughly evaluate TBar on the Defects4J benchmark. In particular, we assess the actual qualitative and quantitative diversity of fix patterns, as well as their effectiveness in yielding plausible or correct patches. Eventually, we find that, assuming a perfect fault localization, TBar correctly/plausibly fixes 74/101 bugs. Replicating a standard and practical pipeline of APR assessment, we demonstrate that TBar correctly fixes 43 bugs from Defects4J, an unprecedented performance in the literature (including all approaches, i.e., template-based, stochastic mutation-based or synthesis-based APR).

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1903.08409/full.md

## Figures

8 figures with captions in the complete paper: https://tomesphere.com/paper/1903.08409/full.md

## References

82 references — full list in the complete paper: https://tomesphere.com/paper/1903.08409/full.md

---
Source: https://tomesphere.com/paper/1903.08409