# Adversarial Patch Generation for Automatic Program Repair

**Authors:** Abdulaziz Alhefdhi, Hoa Khanh Dam, Xuan-Bach D. Le, Aditya Ghose  
**arXiv:** [2012.11060](https://arxiv.org/abs/2012.11060)  
**Date:** 2020-12-21  
**Summary page:** https://www.summarizepaper.com/en/arxiv-id/2012.11060v1/

## Key points

- Automatic program repair (APR) has gained significant attention in recent years
- Search-based techniques are a popular approach in APR, involving generating repair candidates through syntactic analyses and searching for valid repairs within the generated search space
- The authors propose an alternative approach inspired by adversarial bugs and repairs, leveraging deep learning Generative Adversarial Networks (GANs)
- Preliminary evaluations showed promising results, with their approach generating repairs identical to human fixes for 21.2% of 500 bugs
- The model successfully generated complex fixes involving multiple correct changes and the correct number of arguments passed to a method
- Combining their approach with semantics-based approaches can address the need for understanding code semantics and intended behavior
- This AI-powered approach to automatic program repair using GANs does not require hard-coding bug-fixing rules or a set of test cases
- It offers a fast and scalable solution that can generalize across software applications
- The promising results demonstrate feasibility and provide insights for future enhancements in this field

## Summary

Automatic program repair (APR) has gained significant attention in recent years, with various techniques proposed to address this problem. One popular approach in APR is search-based techniques, which involve generating repair candidates through syntactic analyses and searching for valid repairs within the generated search space. However, in this work, the authors explore an alternative approach inspired by the adversarial concept of bugs and repairs. The proposed approach leverages the architecture of deep learning Generative Adversarial Networks (GANs) to suggest repairs that closely resemble human-generated fixes. The authors conducted preliminary evaluations, which demonstrated promising results. Specifically, their approach was able to generate repairs identical to human fixes for 21.2% of 500 bugs. Furthermore, the authors provide additional examples to showcase the capabilities of their model. In one example, their model successfully generated complex fixes involving multiple correct changes and the correct number of arguments passed to a method. This example highlights the need for understanding code semantics and intended behavior, which can be addressed by combining their approach with semantics-based approaches. In summary, this article presents an AI-powered approach to automatic program repair using GANs that does not require hard-coding bug-fixing rules or a set of test cases and offers a fast and scalable solution that can generalize across software applications. The promising results from preliminary evaluations demonstrate its feasibility and provide insights for future enhancements in this field. Overall, this refined summary provides a more detailed overview of the research work on automatic program repair using GANs and highlights its potential benefits such as cost savings and scalability as well as future directions for improvement.
