Java自动化基本路径测试研究
DOI:
作者:
作者单位:

后勤科学与技术研究所,后勤科学与技术研究所,后勤科学与技术研究所,后勤科学与技术研究所,后勤科学与技术研究所

作者简介:

通讯作者:

中图分类号:

基金项目:


Research on Automated Basis Path Testing of Java
Author:
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

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    针对Java单元测试自动化程度和测试效率较低的问题,对基于Java程序的基本路径测试方法进行研究,提出了基于Java代码的基本路径生成方法和程序插桩方法,给出了插桩节点和控制流图节点的定义。首先,通过对Java源代码进行分析,构建程序的控制流图,进而对控制流图进行遍历生成基本路径集合;然后,对被测程序进行插桩,以获取程序的执行路径,插桩过程中保持节点和基本路径中的节点一致,使得插桩后的被测程序执行时得到的路径能够和基本路径集合进行自动化比对;最后,通过以测试数据为输入执行被测程序,对执行路径和基本路径进行比较,判断测试数据集对基本路径的覆盖度。通过实验,验证了所提出方法的有效性。

    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.

    参考文献
    相似文献
    引证文献
引用本文

冯俊池,赵颖,连尧,尹党辉,安丰亮. Java自动化基本路径测试研究计算机测量与控制[J].,2018,26(4):70-73.

复制
分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2017-10-18
  • 最后修改日期:2017-11-09
  • 录用日期:2017-11-10
  • 在线发布日期: 2018-04-23
  • 出版日期: