检索规则说明:AND代表“并且”;OR代表“或者”;NOT代表“不包含”;(注意必须大写,运算符两边需空一格)
检 索 范 例 :范例一: (K=图书馆学 OR K=情报学) AND A=范并思 范例二:J=计算机应用与软件 AND (U=C++ OR U=Basic) NOT M=Visual
作 者:丁雪儿 钮俊[1,2] 张开乐 毛昕怡 Ding Xue er;Niu Jun;Zhang Kaile;Mao Xinyi(Faculty of Electrical Engineering and Computer Science,Ningbo University,Ningbo,Zhejiang 315211;Key Laboratory of Embedded System and Service Computing(Tongji University),Ministry of Education,Shanghai 201804)
机构地区:[1]宁波大学信息科学与工程学院,浙江宁波315211 [2]嵌入式系统与服务计算教育部重点实验室(同济大学),上海201804
出 处:《计算机研究与发展》2022年第1期236-250,共15页Journal of Computer Research and Development
基 金:国家自然科学基金项目(61672384);嵌入式系统与服务计算教育部重点实验室开放课题(ESSCKF2019-07);宁波市自然科学基金项目(2019A610088)。
摘 要:复用已有高质量源代码可提高软件开发效率及软件质量.当前,基于用户提供的输入输出对的匹配判断是代码语义搜索的主要方法之一,但该方法难以刻画完整代码行为,且仅能处理单输入类型.提出一种针对多种形式类型匹配的代码语义搜索方法.首先将代码集内各个代码片段中数据对象个数及类型的加工过程转换为Petri网模型;其次根据用户查询中蕴含的数据类型及个数、输出数据类型等约束来构造Petri网初始标识和目标标识;然后在Petri网中通过可达图及诱发网分析判断是否存在相应的可达路径,从而获得代码匹配依据.分析及实验表明,该方法能有效实现多种形式的输入输出类型匹配的代码搜索,且相对于传统类型匹配方法,能明显提高搜索准确度和效率.Reusing existing high-quality source codes can improve efficiency of software development and quality of software.At present,code search based on input output queries provided by users is one of the main approaches in the field of code semantic search,but existing approaches are difficult to describe the complete behavior of codes and can only handle a single input type.This paper proposes a code semantic search approach based on the reachability analysis of Petri Nets for matching multiple forms of type.First,the semantic processes of code snippets consisting of the number of data objects and types of data objects in the code corpus are converted into improved Petri Net models.Second,the initial marking and target marking of Petri Net models are constructed according to the number of data objects and types of data objects contained in users queries.Matching code snippets is obtained by the analysis of reachable paths in reachability graphs and induced networks of Petri Nets.Analysis and experimental results show that this approach contributes to seeking out desired code snippets by queries that possess multiple forms of input output types provided by users,and compared with traditional approaches,it can significantly improve accuracy and efficiency of code search.
关 键 词:代码复用 语义搜索 类型匹配 PETRI网模型 可达分析
分 类 号:TP311[自动化与计算机技术—计算机软件与理论]
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在链接到云南高校图书馆文献保障联盟下载...
云南高校图书馆联盟文献共享服务平台 版权所有©
您的IP:52.15.143.11