源代码变量名的自动语义标注  被引量:1

Automatic semantic annotation for source code variable names

在线阅读下载全文

作  者:陈凯[1] 沈备军[1] 王永剑[2] 金波[2] 

机构地区:[1]上海交通大学软件学院,上海200240 [2]公安部第三研究所,上海201204

出  处:《计算机应用研究》2016年第11期3349-3352,3357,共5页Application Research of Computers

基  金:国家自然科学基金资助项目(61472242);信息网络安全公安部重点实验室开放课题资助项目(C14609)

摘  要:大规模开源代码社区为开发者提供了丰富的软件资产,但要理解和利用这些代码却十分耗时耗力。为寻求代码理解、分析和挖掘的语义支撑,针对源代码变量名进行了研究,提出了一种基于字段相似度与语义关联度的自动语义标注方法,并实现了相应的工具。该方法首先建立英文、中文、拼音语料库,并构建字段相似度模型生成多种候选标注方案;然后利用马尔可夫转移矩阵和语义网Word Net构建概率模型评选出最优的标注方案,从而实现源代码变量名的自动语义识别。使用Git Hub开源项目代码进行标注准确度实验,结果表明,初次标注准确度达到68.1%,随着用户反馈增加逐步提升到73.3%。Large scale open source community provides abundant assets of software for developers. However, it is time-consu- ming to understand and reuse the code. In order to seek a semantic support for code understanding, analyzing and mining, this paper focused on program variable names and proposed an automatic semantic annotation approach based on word similarity and semantic relevance. Meanwhile it developed an automatic annotation tool. This approach built English, Chinese and Pinyin corpus firstly, constructed a segment similarity model to generate multiple candidate annotation schemes, then constructed a probability model using Markov transfer matrix and WordNet to select optimal scheme. It conducted an evaluation by annota- ting open source projects from GitHub. The results show that the approach can achieve annotation accuracy at 68.1% firstly, and improves to 73.3% by user's feedback.

关 键 词:源代码 变量名 语义识别 自动标注 

分 类 号:TP311[自动化与计算机技术—计算机软件与理论] TP391[自动化与计算机技术—计算机科学与技术]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象