本文已被:浏览 1846次 下载 2661次
Received:August 31, 2018 Revised:September 26, 2018
Received:August 31, 2018 Revised:September 26, 2018
中文摘要: 为满足Java静态分布式检测系统对Java程序源代码解耦分包的需求,解决代码检测单节点单进程运行耗时过长问题,实现分布式检测系统单任务多节点并行运行的目的,本文提出了Java源代码文件间依赖性分析方法.该方法以生成源代码文件抽象语法树的方式抽取文件文本信息,遍历分析抽象语法树,获取文件与其他源代码文件类依赖关系,再通过定位类所在的文件方式得到文件与文件之间依赖关系.同时,以无入边顶点的带环有向图表示文件间依赖关系图,本文提出的方法基于该图进行了文件间解耦的分析.最后,通过对示例程序逐步剖析的实验以及对数个开源工具源代码解耦拆分的实验,验证了本文提出的文件间依赖性分析方法的可行性.
中文关键词: 文件依赖性分析 Java程序 JavaParser 依赖关系图 分布式静态检测
Abstract:In order to meet the requirements of Java static distributed detection system for decoupling and subcontracting Java program source code package, Java source code file dependency analysis method was proposed. This method is part of single-task multi-node parallel-running distributed detection system which could solve the problem that it takes long time for single-task single-node single-process code detection. The method extracted the Java source code file text information by generating its abstract syntax tree. Then, the method traverses and parses the abstract syntax tree to obtain the file's dependent classes which were not declared in the file. Finally, the dependency relationship between two files was obtained by locating the files where the dependent classes were declared in. The directed cyclic graph with no incident edge vertices was proposed to represent the dependency graph among files. The Java program source code package was decoupled by analyzing the dependency graph. At last, the feasibility of the proposed Java source code file dependency analysis method is verified by two experiments. The first experiment is the step-by-step result analysis of a sample program package. The second experiment is verifying the correctness of decoupling result of several open source tools' source code packages.
文章编号: 中图分类号: 文献标志码:
基金项目:国家电网公司科学技术项目(调度自动化软件安全漏洞与风险实验能力提升关键技术研究)
引用文本:
韩承锋,唐云善,杨维永.适用于分布式静态检测的Java代码依赖性分析技术.计算机系统应用,2019,28(3):133-139
HAN Cheng-Feng,TANG Yun-Shan,YANG Wei-Yong.Java Code Dependency Analysis Technique for Distributed Static Detection System.COMPUTER SYSTEMS APPLICATIONS,2019,28(3):133-139
韩承锋,唐云善,杨维永.适用于分布式静态检测的Java代码依赖性分析技术.计算机系统应用,2019,28(3):133-139
HAN Cheng-Feng,TANG Yun-Shan,YANG Wei-Yong.Java Code Dependency Analysis Technique for Distributed Static Detection System.COMPUTER SYSTEMS APPLICATIONS,2019,28(3):133-139