探索并释放大语言模型在 CI/CD 配置翻译中的能力
Exploringand Unleashing the Power of Large Language Models in CI/CD Configuration Translation
AI总结:
本研究针对 Travis CI 到 GitHub Actions 的配置翻译,利用 811 条迁移记录量化了开发工作量,评估了四个 LLM 的翻译效果并归纳出 1121 个问题,最终证明基于指南的提示结合迭代细化策略可将构建成功率提升至 75.5%。
摘要:
持续集成(CI)是现代协作软件开发的基石,目前有众多 CI 平台可供使用。由于在维护开销、可靠性以及与代码托管平台的集成深度方面存在差异,使得在不同 CI 平台之间进行迁移成为一种常见做法。迁移的核心步骤是翻译 CI 配置,由于 CI 配置本身的复杂性,以及需要理解不同 CI 平台之间的语义差异和关系,这一过程极具挑战性。随着大语言模型(LLMs)的出现,软件工程领域的最新进展凸显了其在 CI 配置翻译方面的潜力。在本文中,我们针对基于 LLM 的 CI 配置翻译开展了一项研究,重点关注从 Travis CI 迁移到 GitHub Actions 的过程。首先,利用 811 条迁移记录,我们量化了其中涉及的工作量,发现开发者平均需要阅读 38 行 Travis 配置,并编写 58 行 GitHub Actions 配置,且近一半的迁移需要多次提交。我们进一步分析了四个 LLM 各自生成的翻译,并识别出 1,121 个问题,将其归为四类:逻辑不一致(38%)、平台差异(32%)、环境错误(25%)和语法错误(5%)。最后,我们评估了三种增强策略,结果表明,将基于指南的提示与迭代细化相结合取得了最佳性能,构建成功率达到 75.5%——相比使用基础提示的 GPT-4o 几乎提高了三倍。
英文摘要:
Continuous Integration (CI) is a cornerstone of modern collaborative software development, and numerous CI platforms are available. Differences in maintenance overhead, reliability, and integration depth with code-hosting platforms make migration between CI platforms a common practice. A central step in migration is translating CI configurations, which is challenging due to the intrinsic complexity of CI configurations and the need to understand semantic differences and relationships across CI platforms. With the advent of large language models (LLMs), recent advances in software engineering highlight their potential for CI configuration translation. In this paper, we present a study on LLM-based CI configuration translation, focusing on the migration from Travis CI to GitHub Actions. First, using 811 migration records, we quantify the effort involved and find that developers read an average of 38 lines of Travis configuration and write 58 lines of GitHub Actions configuration, with nearly half of the migrations requiring multiple commits. We further analyze translations produced by each of the four LLMs and identify 1,121 issues grouped into four categories: logic inconsistencies (38%), platform discrepancies (32%), environment errors (25%), and syntax errors (5%). Finally, we evaluate three enhancement strategies and show that combining guideline-based prompting with iterative refinement achieves the best performance, reaching a Build Success Rate of 75.5%-nearly a threefold improvement over GPT-4o with a basic prompt.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。