In model-driven engineering and beyond, software models are key development artifacts. In practice, they often grow to substantial size and complexity, undergoing thousands of modifications over time due to evolution, refactoring, and maintenance. The rise of AI has sparked interest in how software modeling activities can be automated. Recently, LLM-based approaches for software model completion have been proposed, however, the state of the art supports only single-location model completion by predicting changes at a specific location. Going beyond, we aim to bridge the gap toward handling coordinated changes that span multiple locations across large, complex models. Specifically, we propose a novel global embedding-based next focus predictor, NextFocus, which is capable of multi-location model completion for the first time. The predictor consists of a neural network with an attention mechanism that is trained on historical software model evolution data. Starting from an existing change, it predicts further model elements to change, potentially spanning multiple parts of the model. We evaluate our approach on multi-location model changes that have actually been performed by developers in real-world projects. NextFocus achieves promising results for multi-location model completion, even when changes are heavily spread across the model. It achieves an average Precision@k score of 0.98 for $k \leq 10$, significantly outperforming the three baseline approaches.
在本文中,我们提出了一种新的端到端的AI辅助代码完成方法,称为Pythia。它生成方法和API建议的排名列表,可供软件开发人员在编辑时使用。该系统目前部署为Visual Studio Code IDE中Intellicode扩展的一部分。Pythia利用了最先进的大规模深度学习模型,这些模型是在从抽象语法树中提取的代码上下文上训练的。它被设计为在高吞吐量下工作,预测100个$ms$数量级的最佳匹配代码完成。我们描述了该系统的架构,执行比较基于频率的方法和基于调用的马尔可夫链语言模型,并讨论了轻量级客户端设备上的Pythia模型服务的挑战。在2700个Python开源软件GitHub存储库上获得的离线评估结果显示,对于项目内和跨项目设置,前5名的准确率为92%,超过基线模型20%。
Multi-Location Program Repair Strategies Learned from Past Successful Experience
自动程序修复(Automated program repair,APR)在减少软件维护工作量和时间消耗方面具有巨大的潜力,近年来成为软件工程的研究热点,提出了许多方法。多位置程序修复由于其逻辑和结构的复杂性一直是该领域的一个挑战。虽然一些方法并不声称具有解决多位置错误的功能,但它们在实践中为这些缺陷生成正确的补丁。在本文中,我们首先对Defects4J中的多位置错误进行了观察,并将其分为两类(即,相似的和相关的多位置错误)基于其补丁中的修复动作。然后,我们总结了当前工具修复Defects4J中多位置错误的情况。我们分析了当前工具生成的22个补丁,并提出了两个可行的策略来修复多位置错误,通过两个详细的案例研究来说明它们。最后,通过修复两个从未修复过的漏洞,验证了该方法的可行性。通过借鉴以往的成功经验,指出了多位置程序修复的可能途径。