编程现场上下文深度感知的代码行推荐
作者:
作者单位:

作者简介:

陶传奇(1984-),男,博士,副教授,CCF专业会员,主要研究领域为智能软件开发,移动应用测试.
周宇(1981-),男,博士,教授,博士生导师,CCF高级会员,主要研究领域为软件演化分析,软件智能化开发.
包盼盼(1993-),男,硕士,主要研究领域为代码推荐,软件智能化开发.
张智轶(1987-),男,讲师,CCF专业会员,主要研究领域为软件测试用例优化,软件智能化开发.
黄志球(1965-),男,博士,教授,博士生导师,CCF杰出会员,主要研究领域为软件质量工程,智能化软件开发.

通讯作者:

陶传奇,E-mail:taochuanqi@nuaa.edu.cn

中图分类号:

TP311

基金项目:

国家重点研发计划(2018YFB1003900);国家自然科学基金(61602267,61402229);计算机软件新技术国家重点实验室基金(KFKT2018B19)


Code Line Recommendation Based on Deep Context-awareness of Onsite Programming
Author:
Affiliation:

Fund Project:

National Key Research and Development Program of China (2018YFB1003900); National Natural Science Foundation of China (61602267, 61402229); Open Fund of the State Key Laboratory for Novel Software Technology (KFKT2018B19)

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    在软件开发的编程现场,有大量与当前开发任务相关的信息,比如代码上下文信息、用户开发意图等.如果能够根据已有的编程现场上下文给开发人员推荐当前代码行,不仅能够帮助开发人员更好地完成开发任务,还能提高软件开发的效率.而已有的一些方法通常是进行代码修复或者补全,又或者只是基于关键词匹配的搜索方法,很难达到推荐完整代码行的要求.针对上述问题,一种可行的解决方案是基于已有的海量源码数据,利用深度学习析取代码行的相关上下文因子,挖掘隐含的上下文信息,为精准推荐提供基础.因此,提出了一种基于深度学习的编程现场上下文深度感知的代码行推荐方法,能够在已有的大规模代码数据集中学习上下文之间潜在的关联关系,利用编程现场已有的源码数据和任务数据得到当前可能的代码行,并推荐Top-N给编程人员.代码行深度感知使用RNN Encoder-Decoder,该框架能够将编程现场已有的若干行上文代码行进行编码,得到一个包含已有代码行上下文信息的向量,然后根据该向量进行解码,得到预测的Top-N代码行输出.利用在开源平台上收集的大规模代码行数据集,对方法进行实验并测试,结果显示,该方法能够根据已有的上下文推荐相关的代码行给开发人员,Top-10的推荐准确率有60%左右,并且MRR值在0.3左右,表示用户满意的推荐项排在N个推荐结果中比较靠前的位置.

    Abstract:

    In the Onsite Programming of software development, there are a lot of information related to the current development task, such as code line context information, user development intention, etc. If the next code line or lines can be recommended to program developers according to the existing code lines, then it will not only help the developer to complete the development task better, but also improve the efficiency of software development. However, most existing approaches only focus on code repair or completion, which seldom considers how to meet the demand of recommending code lines based on contextual information. To solve this problem, a feasible solution is using deep learning methods to extract the relevant context factors of code lines through mining hidden context information based on the existing massive source data. Therefore, this study proposes a novel approach based on deep learning for onsite programming. In this approach, the contextual relationships among various code lines are learned from existing large-scale code data sets and then Top-N code lines are recommended to programmers. The approach utilizes the RNN encoder-decoder framework, which can encode several lines of code to a vector with context-aware information, and then obtain the Top-N new code lines based on the context vector. Finally, the approach is empirically evaluated with a large-scale code line data set collected from the open source platform. The study results show that the proposed approach can recommend the relevant code lines to developers according to the existing context, and the accuracy value is approaching to 60%. In addition, the MRR value is about 0.3, indicating that the recommended items are ranked in the top of the N recommended results.

    参考文献
    相似文献
    引证文献
引用本文

陶传奇,包盼盼,黄志球,周宇,张智轶.编程现场上下文深度感知的代码行推荐.软件学报,2021,32(11):3351-3371

复制
分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2018-12-18
  • 最后修改日期:2020-03-10
  • 录用日期:
  • 在线发布日期: 2020-10-12
  • 出版日期: 2021-11-06
您是第位访问者
版权所有:中国科学院软件研究所 京ICP备05046678号-3
地址:北京市海淀区中关村南四街4号,邮政编码:100190
电话:010-62562563 传真:010-62562533 Email:jos@iscas.ac.cn
技术支持:北京勤云科技发展有限公司

京公网安备 11040202500063号