arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2203.08912cs.SE
收藏

两全其美:将学习嵌入与工程特征相结合,以准确预测正确的补丁

The Best of Both Worlds: Combining Learned Embeddings with Engineered Features for Accurate Prediction of Correct Patches

Haoye Tian, Kui Liu, Yinghua Li, Abdoul Kader Kaboré, Anil Koyuncu, Andrew Habib, Li Li, Junhao Wen, Jacques Klein, Tegawendé F. Bissyandé

摘要:

大量关于自动程序修复的文献开发了自动生成补丁以针对oracle进行验证的方法(例如,测试套件)。因为这样的预言机可能是不完美的,所以生成的补丁尽管经过了预言机的验证,但实际上可能是不正确的。我们的实证工作调查不同的表示学习方法的代码更改,以获得嵌入,是服从补丁正确性识别的相似性计算,并评估正确的补丁相结合的学习嵌入与工程特征的准确分类的可能性。实验结果证明了学习嵌入的潜力,使豹(在这项工作中实现的补丁正确性预测框架)与学习算法在关于补丁正确性的推理中:具有与XGBoost相关联的基于BERT变换的学习嵌入的机器学习预测器在新数据集上的补丁正确性预测中实现了约0.803的AUC值2,我们收集了147个标记的补丁用于实验。我们的调查表明,与依赖于动态信息的最先进的PATCH-SIM相比,深度学习嵌入可以带来互补/更好的性能。通过结合深度学习的嵌入和工程特征,Panther(在这项工作中实现的Leopard的升级版本)在AUC,+Recall和-Recall方面的得分更高,并且可以准确地识别更多(不)正确的补丁,这些补丁无法通过仅使用学习的嵌入或工程特征的分类器进行预测。最后,我们使用一种可解释的ML技术SHAP来经验性地解释学习的嵌入和工程特征如何有助于补丁正确性预测。

英文摘要:

A large body of the literature on automated program repair develops approaches where patches are automatically 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. Our empirical work investigates different representation learning approaches for code changes to derive embeddings that are amenable to similarity computations of patch correctness identification, and assess the possibility of accurate classification of correct patch by combining learned embeddings with engineered features. Experimental results demonstrate the potential of learned embeddings to empower Leopard (a patch correctness predicting framework implemented in this work) with learning algorithms in reasoning about patch correctness: a machine learning predictor with BERT transformer-based learned embeddings associated with XGBoost achieves an AUC value of about 0.803 in the prediction of patch correctness on a new dataset of 2,147 labeled patches that we collected for the experiments. Our investigations show that deep learned embeddings can lead to complementary/better performance when comparing against the state-of-the-art, PATCH-SIM, which relies on dynamic information. By combining deep learned embeddings and engineered features, Panther (the upgraded version of Leopard implemented in this work) outperforms Leopard with higher scores in terms of AUC, +Recall and -Recall, and can accurately identify more (in)correct patches that cannot be predicted by the classifiers only with learned embeddings or engineered features. Finally, we use an explainable ML technique, SHAP, to empirically interpret how the learned embeddings and engineered features are contributed to the patch correctness prediction.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑