首页 | 本学科首页   官方微博 | 高级检索  
     

Java自动化基本路径测试研究
引用本文:冯俊池,赵颖,连尧,尹党辉,安丰亮.Java自动化基本路径测试研究[J].计算机测量与控制,2018,26(4):70-73.
作者姓名:冯俊池  赵颖  连尧  尹党辉  安丰亮
作者单位:后勤科学与技术研究所,后勤科学与技术研究所,后勤科学与技术研究所,后勤科学与技术研究所,后勤科学与技术研究所
摘    要:针对Java单元测试自动化程度和测试效率较低的问题,对基于Java程序的基本路径测试方法进行研究,提出了基于Java代码的基本路径生成方法和程序插桩方法,给出了插桩节点和控制流图节点的定义。首先,通过对Java源代码进行分析,构建程序的控制流图,进而对控制流图进行遍历生成基本路径集合;然后,对被测程序进行插桩,以获取程序的执行路径,插桩过程中保持节点和基本路径中的节点一致,使得插桩后的被测程序执行时得到的路径能够和基本路径集合进行自动化比对;最后,通过以测试数据为输入执行被测程序,对执行路径和基本路径进行比较,判断测试数据集对基本路径的覆盖度。通过实验,验证了所提出方法的有效性。

关 键 词:基本路径  控制流图  单元测试  程序插桩
收稿时间:2017/10/18 0:00:00
修稿时间:2017/11/9 0:00:00

Research on Automated Basis Path Testing of Java
Affiliation:Institute of Logistic Science and Technology,Institute of Logistic Science and Technology,Institute of Logistic Science and Technology,Institute of Logistic Science and Technology,Institute of Logistic Science and Technology
Abstract:The level of Java unit testing automation is low, and so is the testing efficiency. The basis path testing method based on Java program is studied. The basic path generation method based on Java source code and program instrumentation method is provided. The definition of instrumentation node and control flow graph node is given. Firstly, the control flow graph of program under test is built based on the analysis of Java source code, and then the control flow graph is traversed to generate the basis path set. Secondly, the program under test is instrumented to obtain the program execution path. The instrumentation node is consistent with the node of basis path, so the path obtained during execution can be compared with the basic path set automatically. Lastly, run the program under test with the test data as input, and compare the execution path with basis path to compute the basis path coverage of test data set. The effectiveness of the proposed method is verified by experiments.
Keywords:basis path  control flow graph  unit testing  program instrumentation
点击此处可从《计算机测量与控制》浏览原始摘要信息
点击此处可从《计算机测量与控制》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号