A Graph Database Based Method for Parsing and Searching Code Structure
-
摘要: 软件复用是在软件开发中避免重复劳动的解决方案.在复用一个已有的软件项目时,软件开发人员通常需要理解某些代码元素以及其间的关联关系,称之为代码结构.软件开发人员一般通过浏览软件源代码的方式理解代码结构.由于源代码往往规模较大且结构复杂,理解代码结构通常会耗费大量的时间与精力.因此,将软件开发人员想要理解的代码结构自动、清晰地展示出来是很有帮助的.提出一种基于图数据库的代码结构解析与搜索方法以实现这一目的.这一方法可对软件的代码结构进行解析,并在图数据库中对其进行有效的组织和管理.搜索时,软件开发人员输入自然语言查询语句,该方法中的搜索机制会分析查询语句,并从图数据库中截取出与其相对应的代码结构进行展示.该方法具有高度的可扩展性:不同粒度的结点与多样化的关联关系可以容易地存储进图数据库中,且面向不同搜索目的的代码结构搜索算法亦可以容易地集成进搜索机制中.这一方法已在相应的工具中得到了实现,其有效性在一个商业案例研究中得到了验证.Abstract: Software reuse is a solution to reduce duplication of effort in software development. When reusing an existing software project, software developers usually need to understand how code elements in it are worked and their correlation, which is called code structure. Software developers usually navigate among source code files to understand code structure. This task could be time-consuming and difficult, since source code of a software project is usually large and complex. Therefore, it is essential to demonstrate code structure in an automatic way that software developers can understand it clearly. For this purpose, this paper introduces a graph database based method for parsing and searching code structure. Code structure is extracted from source code files, and well-organized as a labeled and directed graph in graph database. Software developers input natural language queries. A search mechanism analyzes each of these queries, searches the whole code structure and determines which part of the code structure should be demonstrated. This method is of high extensibility: code elements at different granularity and various relationship types among them can be easily stored into the graph database, and analyzing algorithms for different search purposes can be easily integrated into the search mechanism. A tool is implemented based on this method. Experiment shows that with the help of this tool, the time software developers spending on understanding code structure reduces by 17%, which validates that our method does help improving the efficiency of software reuse. An industrial case study has been showed on how software developers get help from this method.
-
Keywords:
- code structure /
- graph database /
- natural language query /
- search mechanism /
- software reuse
-
-
期刊类型引用(13)
1. 程巍,王红英,娄岩. 基于“5G云+VR”的心脏解剖虚拟仿真教学系统的构建与应用. 中国医学教育技术. 2025(02): 223-228 . 百度学术
2. 费星瑞,谢逸. 基于HMM-NN的用户点击流识别. 计算机科学. 2022(07): 340-349 . 百度学术
3. 王同贺,华昊辰,曹军威. 共识边缘计算及其在能源互联网中的应用. 电力建设. 2021(02): 116-125 . 百度学术
4. 柴艳娜. 内核网络堆栈的Go语言实现与分析. 电子设计工程. 2021(13): 34-37+42 . 百度学术
5. 樊琦,李卓,陈昕. 基于边缘计算的分支神经网络模型推断延迟优化. 计算机应用. 2020(02): 342-346 . 百度学术
6. 向安玲,杨钰雯. 边缘计算在传媒领域的应用. 中国传媒科技. 2020(03): 113-116 . 百度学术
7. 常国锋. 基于信任域的环形网络介质访问时延控制仿真. 计算机仿真. 2020(03): 349-353 . 百度学术
8. 董召杰,林志达. 基于边缘计算的机巡图像缺陷识别算法研究. 自动化与仪器仪表. 2020(07): 77-80 . 百度学术
9. 张翠芳,姬楠楠. 基于模糊矩阵的多线程网络通信延迟检测技术研究. 科学技术与工程. 2020(27): 11198-11203 . 百度学术
10. 华昊辰,李宇童,王同贺,秦兆铭,曹军威. 一种基于混合随机H_2/H_∞方法的能源互联网边缘计算系统控制策略. 中国电机工程学报. 2020(21): 6875-6885 . 百度学术
11. 闫朝峰,刘清莉. 王者荣耀业务网络感知保障浅析. 通讯世界. 2019(09): 81-82 . 百度学术
12. 肖文华,刘必欣,刘巍,程钢,王跃华. 面向恶劣环境的边缘计算综述. 指挥与控制学报. 2019(03): 181-190 . 百度学术
13. 丁祥海,王志会. 边缘计算在计算机科学方向的进展研究. 信息与管理研究. 2019(06): 73-83 . 百度学术
其他类型引用(6)
计量
- 文章访问数: 1286
- HTML全文浏览量: 5
- PDF下载量: 759
- 被引次数: 19