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

JUTA: 一个Java自动化单元测试工具
引用本文:严俊, 郭涛, 阮辉, 玄跻峰. JUTA: 一个Java自动化单元测试工具[J]. 计算机研究与发展, 2010, 47(10): 1840-1848.
作者姓名:严俊  郭涛  阮辉  玄跻峰
作者单位:1(中国科学院软件研究所 北京 100190) 2(中国信息安全测评中心 北京 100085) 3(大连理工大学数学科学学院 辽宁大连 116024) (junyan@acm.org)
基金项目:国家自然科学基金项目,国家"八六三"高技术研究发展计划基金项目,中国科学院知识创新工程领域前沿项目 
摘    要:描述了一个Java自动化的单元测试工具JUTA.JUTA首先调用工具Soot解析单个Java方法的源码,并将源码解析成一个控制流图.在此基础上,采用符号执行的方法分析控制流图上的路径.工具能够自动地产生满足覆盖率标准的程序的测试用例.这种方法产生的所有测试用例都是可执行的,并且一般来说具有较小的测试用例数.如果用户能够合理地给出描述程序错误的断言,框架JUTA能够自动地检查源码中部分特定类型的错误.实验结果表明工具对Java单元代码的动态测试和静态测试均能在可接受的时间内给出有效的结果.

关 键 词:Java单元测试  动态测试  静态测试  程序分析  符号执行

JUTA: An Automated Unit Testing Framework for Java
Yan Jun, Guo Tao, Ruan Hui, Xuan Jifeng. JUTA: An Automated Unit Testing Framework for Java[J]. Journal of Computer Research and Development, 2010, 47(10): 1840-1848.
Authors:Yan Jun  Guo Tao  Ruan Hui  Xuan Jifeng
Affiliation:1(Institute of Software, Chinese Academy of Sciences, Beijing 100190) 2(China Information Technology Security Evaluation Center, Beijing 100085) 3(School of Mathematical Sciences, Dalian University of Technology, Dalian, Liaoning 116024)
Abstract:Testing is very important and time consuming in the development of high-quality software systems. This paper proposes an automatic testing tool JUTA for unit testing of Java programs. The approach is based on sharp analysis of the programs. JUTA firstly employs the Java optimization framework Soot to parse a single Java method into byte code and translates it into a control flow graph (CFG). It then performs depth-first or breadth-first search on the CFG to extract paths from it. Some techniques such as path length restriction are used to prevent path number explosion. Finally JUTA analyzes the paths based on the combination of symbolic execution and constraint solving. The goal of path analysis lies in two folds. It can generate a set of test cases satisfying the test criterion such as statement coverage. The test set typically has small number of test cases that are all executable. In addition to test generation for dynamic testing, it can also be used in static testing. JUTA can reveal certain kinds of errors from the source code automatically if the user provides proper assertions to describe the errors. The experimental results show that this tool is efficient for both dynamic and static testing.
Keywords:Java unit testing  dynamic testing  static testing  program analysis  symbolic execution
本文献已被 万方数据 等数据库收录!
点击此处可从《计算机研究与发展》浏览原始摘要信息
点击此处可从《计算机研究与发展》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

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