Applied Sciences (Jul 2023)

Code Similarity and Location-Awareness Automatic Program Repair

  • Heling Cao,
  • Dong Han,
  • Fangzheng Liu,
  • Tianli Liao,
  • Chenyang Zhao,
  • Jianshu Shi

DOI
https://doi.org/10.3390/app13148519
Journal volume & issue
Vol. 13, no. 14
p. 8519

Abstract

Read online

Automatic program repair has drawn more and more attention since software quality is facing increasing challenges. In existing approaches, the unlimited search space is considered to be the main limitation in finding the correct patch. So how to reduce the search space to improve the efficiency of automatic program repair remains a problem to be solved. In this work, we represent a similarity-based and location-awareness-based automatic program repair (SLARepair). SLARepair takes the similarity between codes as important search information. The search space is further subdivided by the location-awareness strategy to improve search efficiency. In addition, to better guide the search process, a new fitness function is designed for genetic programming, which brings notable improvements. Moreover, the patch verification time is further reduced by utilizing the test case prioritization approach combined with test case filtering. Extensive experiments demonstrate that our SLARepair outperforms the state-of-the-art approaches on the Defects4J benchmark and achieves competitive performances.

Keywords