Software Engineering (SE) is the systematic design, development, and maintenance of software applications, underpinning the digital infrastructure of our modern mainworld. Very recently, the SE community has seen a rapidly increasing number of techniques employing Large Language Models (LLMs) to automate a broad range of SE tasks. Nevertheless, existing information of the applications, effects, and possible limitations of LLMs within SE is still not well-studied. In this paper, we provide a systematic survey to summarize the current state-of-the-art research in the LLM-based SE community. We summarize 30 representative LLMs of Source Code across three model architectures, 15 pre-training objectives across four categories, and 16 downstream tasks across five categories. We then present a detailed summarization of the recent SE studies for which LLMs are commonly utilized, including 155 studies for 43 specific code-related tasks across four crucial phases within the SE workflow. Besides, we summarize existing attempts to empirically evaluate LLMs in SE, such as benchmarks, empirical studies, and exploration of SE education. We also discuss several critical aspects of optimization and applications of LLMs in SE, such as security attacks, model tuning, and model compression. Finally, we highlight several challenges and potential opportunities on applying LLMs for future SE studies, such as exploring domain LLMs and constructing clean evaluation datasets. Overall, our work can help researchers gain a comprehensive understanding about the achievements of the existing LLM-based SE studies and promote the practical application of these techniques. Our artifacts are publicly available and will continuously updated at the living repository: \url{https://github.com/iSEngLab/AwesomeLLM4SE}.
翻译:软件工程(SE)是软件应用的系统化设计、开发与维护,支撑着我们现代世界的数字基础设施。近期,软件工程领域涌现出大量利用大语言模型(LLM)自动化处理各类软件工程任务的技术。然而,关于LLM在软件工程中的应用、效果及潜在局限性的现有信息尚未得到充分研究。本文旨在通过系统性综述,总结当前基于LLM的软件工程研究的最新进展。我们归纳了涵盖3种模型架构的30种代表性源代码LLM、4类共15种预训练目标,以及5类共16种下游任务。随后,我们详细梳理了近期软件工程研究中LLM的常见应用场景,涵盖软件工程流程四个关键阶段的43项具体代码相关任务(共计155项研究)。此外,我们总结了现有在软件工程中对LLM进行实证评估的尝试,包括基准测试、实证研究及软件工程教育探索。同时,我们探讨了LLM在软件工程中的优化与应用关键层面,如安全攻击、模型调优与模型压缩。最后,我们指出了未来软件工程研究中应用LLM的若干挑战与潜在机遇,例如探索领域专用LLM及构建清洁评估数据集。总体而言,本工作有助于研究者全面理解现有基于LLM的软件工程研究成果,并推动这些技术的实际应用。我们的成果已公开,并将在持续更新的存储库中维护:\url{https://github.com/iSEngLab/AwesomeLLM4SE}。