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

自动推荐代码更新:我们做到了吗?

Automatically Recommend Code Updates: Are We There Yet?

Yue Liu, Chakkrit Tantithamthavorn, Yonghui Liu, Patanamon Thongtanunam, Li Li

AI总结:

本文首次系统评估最先进 CodeLM 的自动代码更新推荐能力,发现其在现实时间场景、新项目、大方法和复杂更新上表现不佳,凸显实用性与泛化差距。

摘要:

近年来,大型预训练代码语言模型(CodeLM)在多种软件工程任务上展现出良好效果。其中一项任务是自动代码更新推荐,即将过时的代码片段转换为已批准且修订后的对应版本。尽管已有许多基于 CodeLM 的方法被提出并声称具有高准确率,但它们在真实代码更新任务上的有效性和可靠性仍存疑。本文中,我们首次对最先进的 CodeLM 在自动推荐代码更新方面进行了大规模评估。我们在两个包含成对更新方法的多样化数据集上评估其性能,并考虑时间演化、项目特异性、方法规模和更新复杂性等因素。结果表明,虽然 CodeLM 在忽略时间信息的设置下表现良好,但在更现实的按时间场景中表现吃力,且对新项目的泛化能力较差。此外,方法越大、更新越复杂,CodeLM 的性能下降越明显。我们还观察到,许多 CodeLM 生成的“更新”实际上是空更新,尤其是在按时间设置下,而有意义的编辑仍具挑战。我们的发现凸显了 CodeLM 在真实代码更新推荐中感知有效性与实际有效性之间的显著差距,并强调需要进一步研究以提升其实用性、稳健性和泛化能力。

英文摘要:

In recent years, large pre-trained Language Models of Code (CodeLMs) have shown promising results on various software engineering tasks. One such task is automatic code update recommendation, which transforms outdated code snippets into their approved and revised counterparts. Although many CodeLM-based approaches have been proposed, claiming high accuracy, their effectiveness and reliability on real-world code update tasks remain questionable. In this paper, we present the first extensive evaluation of state-of-the-art CodeLMs for automatically recommending code updates. We assess their performance on two diverse datasets of paired updated methods, considering factors such as temporal evolution, project specificity, method size, and update complexity. Our results reveal that while CodeLMs perform well in settings that ignore temporal information, they struggle in more realistic time-wise scenarios and generalize poorly to new projects. Furthermore, CodeLM performance decreases significantly for larger methods and more complex updates. Furthermore, we observe that many CodeLM-generated "updates" are actually null, especially in time-wise settings, and meaningful edits remain challenging. Our findings highlight the significant gap between the perceived and actual effectiveness of CodeLMs for real-world code update recommendation and emphasize the need for more research on improving their practicality, robustness, and generalizability.

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

↑