Using pre-trained language models to resolve textual and semantic merge conflicts (experience paper)

Using pre-trained language models to resolve textual and semantic merge conflicts (experience paper)
复制标题

DOI:
10.1145/3533767.3534396
复制
发表时间:
2022-07
期刊:
Proceedings of the 31st ACM SIGSOFT International Symposium on Software Testing and Analysis
影响因子:
--
通讯作者:
Jialu Zhang;Todd Mytkowicz;Mike Kaufman;R. Piskac;Shuvendu K. Lahiri
Jialu Zhang;Todd Mytkowicz;Mike Kaufman;R. Piskac;Shuvendu K. Lahiri
中科院分区:
其他
文献类型:
--
作者:
Jialu Zhang;Todd Mytkowicz;Mike Kaufman;R. Piskac;Shuvendu K. Lahiri

文献摘要

被引文献

相似文献

程序合并是开发人员将他们的个人更改集成到公共代码库时的标准实践。当合并算法失败时,这被称为合并冲突。冲突要么表现为文本合并冲突(合并无法生成代码),要么表现为语义合并冲突(合并代码导致编译器错误或中断测试)。为大型代码项目解决这些冲突是昂贵的,因为它需要开发人员手动识别冲突的来源并纠正它们。在本文中,我们探索了使用k-shot学习与预训练的大型神经语言模型(LM)(如GPT-3)自动修复合并冲突(文本和语义)的可行性。利用这种语言模型的挑战之一是在一个小提示(2048个标记)中拟合示例和查询。我们评估了微软Edge的文本和语义合并冲突的LM和k-shot学习。我们的结果好坏参半:一方面,与早期的符号方法相比,LM为Edge的语义合并冲突解决提供了最先进的(SOTA)性能;另一方面,LM尚未消除专用领域特定语言(DSL)的好处对于程序合成的受限模式。
Program merging is standard practice when developers integrate their individual changes to a common code base. When the merge algorithm fails, this is called a merge conflict. The conflict either manifests as a textual merge conflict where the merge fails to produce code, or as a semantic merge conflict where the merged code results in compiler errors or broken tests. Resolving these conflicts for large code projects is expensive because it requires developers to manually identify the sources of conflicts and correct them. In this paper, we explore the feasibility of automatically repairing merge conflicts (both textual and semantic) using k-shot learning with pre-trained large neural language models (LM) such as GPT-3. One of the challenges in leveraging such language models is fitting the examples and the queries within a small prompt (2048 tokens). We evaluate LMs and k-shot learning for both textual and semantic merge conflicts for Microsoft Edge. Our results are mixed: on one-hand, LMs provide the state-of-the-art (SOTA) performance on semantic merge conflict resolution for Edge compared to earlier symbolic approaches; on the other hand, LMs do not yet obviate the benefits of special purpose domain-specific languages (DSL) for restricted patterns for program synthesis.