An Empirical Study of the Performance of Code Similarity in Automatic Program Repair Tool


Xingyu Zheng, Zhiqiu Huang, Yongchao Wang and Yaoshen Yu, Nanjing University of Aeronautics and Astronautics, China


Recently, code similarity has been used in several automated program repair (APR) tools. It suggests that similarity has a great contribution to APR. However, code similarity is not fully utilized in some APR tools. For example, SimFix only uses structure similarity (Deckard) and name (variable and method) similarity to rank candidate code blocks that are used to extract patches and do not use similarity in patch filtering. In this paper, we combine the tool with longest common sequence (LCS) and term frequency-inverse document frequency (TFIDF) to rank candidate code blocks and filter incorrect patches. Then we design and set up a series of experiments based on the approach and collect the rank of the correct patch and time cost for each selected buggy program. In the candidate ranking phase, LCS and TFIDF improve the rank of the block, which contains the correct patch for several bugs. In the patch validation phase, LCS filters out 68% of incorrect patches on average. It shows that code similarity can greatly improve the performance of APR tools.


APR, empirical study, LCS, TFIDF.

Full Text  Volume 12, Number 15