论文标题

trans^3:一个基于变压器的框架,用于统一代码摘要和代码搜索

TranS^3: A Transformer-based Framework for Unifying Code Summarization and Code Search

论文作者

Wang, Wenhua, Zhang, Yuqun, Zeng, Zhengran, Xu, Guandong

论文摘要

代码摘要和代码搜索已在SofWaredEvelvement和Maintenance中广泛采用。但是,很少有人研究了统一它们的效果。在本文中,我们提出了基于变压器的框架Trans^3,将代码摘要与代码搜索集成在一起。对于代码摘要,trans^3启用了一个参与者 - 批判性网络,在Actor网络中,我们通过基于变压器和Tree-Transformer的编码器编码收集的代码片段,并解码给定代码片段以生成其注释。同时,我们通过评论家网络的反馈来迭代演员网络,以提高生成评论的质量。此外,我们导入生成的注释以编码搜索以增强其准确性。为了评估Trans^3的表决权,我们进行了一组实验研究和案例研究,其中实验结果表明,Trans^3可以在代码汇总和代码搜索中明显超过多个最先进的方法,并且研究结果进一步增强了从开发者的观点的转移^3的效率。

Code summarization and code search have been widely adopted in sofwaredevelopmentandmaintenance. However, fewstudieshave explored the efcacy of unifying them. In this paper, we propose TranS^3 , a transformer-based framework to integrate code summarization with code search. Specifcally, for code summarization,TranS^3 enables an actor-critic network, where in the actor network, we encode the collected code snippets via transformer- and tree-transformer-based encoder and decode the given code snippet to generate its comment. Meanwhile, we iteratively tune the actor network via the feedback from the critic network for enhancing the quality of the generated comments. Furthermore, we import the generated comments to code search for enhancing its accuracy. To evaluatetheefectivenessof TranS^3 , we conduct a set of experimental studies and case studies where the experimental results suggest that TranS^3 can signifcantly outperform multiple state-of-the-art approaches in both code summarization and code search and the study results further strengthen the efcacy of TranS^3 from the developers' points of view.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源