锦上添花:爱立信的自动代码摘要生成
Icing on the Cake: Automatic Code Summarization at Ericsson
AI总结:
针对爱立信Java方法自动摘要生成需求,评估ASAP基线方法并提出四种轻量级方法,实验表明其性能相当或更优且对方法名变化更鲁棒,提升商业环境部署适用性。
摘要:
本文介绍了我们在全球电信公司爱立信内部对Java方法自动摘要生成的研究成果。我们评估了一种名为自动语义增强提示(ASAP)的方法的性能,该方法使用大型语言模型(LLM)为Java方法生成前置摘要注释。ASAP通过集成静态程序分析和信息检索技术来识别相似的示例方法及其开发者编写的Javadoc,从而增强LLM的提示上下文,并作为我们研究的基线。相比之下,我们探索并比较了四种更简单方法的性能,这些方法不需要静态程序分析、信息检索或ASAP方法中存在的示例。我们的方法仅依赖Java方法体作为输入,使其轻量级且更适合在商业软件开发环境中快速部署。我们在爱立信的一个软件项目上进行了实验,并使用两个广泛使用的开源Java项目Guava和Elasticsearch复制了该研究,以确保结果的可靠性。性能通过八个捕获相似性各方面的指标进行衡量。值得注意的是,我们的一种更简单的方法在爱立信项目和开源项目上的表现均与ASAP方法相当或更好。此外,我们进行了消融研究,以检查方法名对我们提出的四种方法和ASAP方法生成Javadoc摘要的影响。通过掩盖方法名并观察生成的摘要,我们发现与基线相比,我们的方法受方法名缺失的影响在统计上显著更小。这表明我们的方法对方法名的变化更鲁棒,并且可能比ASAP方法更全面地从方法体中推导摘要。
英文摘要:
This paper presents our findings on the automatic summarization of Java methods within Ericsson, a global telecommunications company. We evaluate the performance of an approach called Automatic Semantic Augmentation of Prompts (ASAP), which uses a Large Language Model (LLM) to generate leading summary comments for Java methods. ASAP enhances the $LLM's$ prompt context by integrating static program analysis and information retrieval techniques to identify similar exemplar methods along with their developer-written Javadocs, and serves as the baseline in our study. In contrast, we explore and compare the performance of four simpler approaches that do not require static program analysis, information retrieval, or the presence of exemplars as in the ASAP method. Our methods rely solely on the Java method body as input, making them lightweight and more suitable for rapid deployment in commercial software development environments. We conducted experiments on an Ericsson software project and replicated the study using two widely-used open-source Java projects, Guava and Elasticsearch, to ensure the reliability of our results. Performance was measured across eight metrics that capture various aspects of similarity. Notably, one of our simpler approaches performed as well as or better than the ASAP method on both the Ericsson project and the open-source projects. Additionally, we performed an ablation study to examine the impact of method names on Javadoc summary generation across our four proposed approaches and the ASAP method. By masking the method names and observing the generated summaries, we found that our approaches were statistically significantly less influenced by the absence of method names compared to the baseline. This suggests that our methods are more robust to variations in method names and may derive summaries more comprehensively from the method body than the ASAP approach.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。