一句话:系统评估多种代码变更表示学习嵌入,用机器学习预测自动程序修复补丁是否正确。
自动程序修复生成的补丁通常仅通过测试套件等不完美 oracle 验证,因而可能实际错误。本文研究学习代码表示以编码补丁正确性深层特征的收益,系统评估面向代码变更的多种表示学习与嵌入方法,包括预训练和重训练神经网络产生的嵌入,并用于相似度计算与机器学习预测。在去重后的 1000 个带标签补丁数据集上,采用 BERT transformer 嵌入结合逻辑回归的预测器取得约 0.8 的 AUC。结果表明,学习到的表示与依赖动态信息的先进方法 PATCH-SIM 相比具有合理性能,且可能与文献中手工设计的特征互补。
A large body of the literature of automated program repair develops approaches where patches are generated to be validated against an oracle (e.g., a test suite). Because such an oracle can be imperfect, the generated patches, although validated by the oracle, may actually be incorrect. While the state of the art explore research directions that require dynamic information or that rely on manually-crafted heuristics, we study the benefit of learning code representations in order to learn deep features that may encode the properties of patch correctness. Our empirical work mainly investigates different representation learning approaches for code changes to derive embeddings that are amenable to similarity computations. We report on findings based on embeddings produced by pre-trained and re-trained neural networks. Experimental results demonstrate the potential of embeddings to empower learning algorithms in reasoning about patch correctness: a machine learning predictor with BERT transformer-based embeddings associated with logistic regression yielded an AUC value of about 0.8 in the prediction of patch correctness on a deduplicated dataset of 1000 labeled patches. Our investigations show that learned representations can lead to reasonable performance when comparing against the state-of-the-art, PATCH-SIM, which relies on dynamic information. These representations may further be complementary to features that were carefully (manually) engineered in the literature.
@inproceedings{paperbot5935,
title = {Evaluating representation learning of code changes for predicting patch correctness in program repair},
author = {Haoye Tian and Kui Liu and Abdoul Kader Kaboré and Anil Koyuncu and Li Li and Jacques Klein and Tegawendé F. Bissyandé},
booktitle = {ASE},
year = {2020},
doi = {10.1145/3324884.3416532}
}