计算机科学 ›› 2014, Vol. 41 ›› Issue (9): 71-74.doi: 10.11896/j.issn.1002-137X.2014.09.012

• 2013’服务化软件 • 上一篇    下一篇

基于程序切片的测试用例生成系统研究与实现

王志文,黄小龙,王海军,刘烃,俞乐晨   

  1. 西安交通大学电子与信息工程学院 西安710049;西安交通大学电子与信息工程学院 西安710049;西安交通大学电子与信息工程学院 西安710049;西安交通大学电子与信息工程学院 西安710049;西安交通大学电子与信息工程学院 西安710049
  • 出版日期:2018-11-14 发布日期:2018-11-14
  • 基金资助:
    本文受国家自然科学基金(91118005,1,61221063,4,61202392),国家科技支撑计划(2011BAK08B02),教育部博士点基金(20110201120010),中央高校基本科研业务费专项资金资助

Program Slicing-guied Test Case Generation System

WANG Zhi-wen,HUANG Xiao-long,WANG Hai-jun,LIU Ting and YU Le-chen   

  • Online:2018-11-14 Published:2018-11-14

摘要: 介绍了一种基于程序行为切片的测试用例生成系统的实现方案,系统在不扫描全部程序路径的情况下,生成可以覆盖全部程序行为的测试用例集。系统分为静态分析、动态符号执行以及测试用例生成3个模块。在静态分析模块中根据输入的程序代码分析程序的控制流和信息流,提取程序的控制依赖和数据依赖,并计算程序的潜在依赖;动态符号执行模块求解约束条件、生成测试用例和分析代码执行过程;测试用例生成模块根据执行路径和依赖关系计算被路径覆盖的程序行为切片和未被覆盖的程序行为切片,然后根据未被覆盖的程序行为切片,引导符号执行生成能覆盖新的程序行为切片的测试用例。实验证明,本系统生成的测试用例集可以保证覆盖所有的程序行为,同时能显著减少生成的测试用例数量。

关键词: 软件测试,测试用例集生成,动态符号执行,程序切片

Abstract: A program slicing-guided test case generation system was introduced in this paper,which could generate the set of test case covering all program behavior without scanning all paths of the program.It consists of three modules:the static analysis,dynamic symbolic execution and test case generation.In the static analysis module,the control flow and information flow of input program are analyzed to extract the control dependency and data dependency,and the potential dependency is also computed.The dynamic symbol execution module is applied to solve the constraints,generate test case and monitor the execution path.In the test case generation module,the covered and uncovered program slices of the execution test scase are computed to guide the new test case generation.In the experiments,the test case set generated by our system,can cover all program behaviors and significantly reduce the number of test cases.

Key words: Software testing,Test case set generation,Dynamic symbolic execution,Program slicing

[1] Majumdar R,Sen K.Hybrid concolic testing[C]∥29th International Conference on Software Engineering,2007,ICSE 2007.IEEE,2007:416-426
[2] Bohme M.Software regression as change of input partitioning[C]∥2012 34th International Conference onSoftware Enginee-ring (ICSE).IEEE,2012:1523-1526
[3] Bhme M,Oliveira B C S,Roychoudhury A.Partition-based regression verification[C]∥Proceedings of the 2013 International Conference on Software Engineering.IEEE Press,2013:302-311
[4] Psreanu C S,Rungta N.Symbolic PathFinder:symbolic exe-cution of Java bytecode[C]∥Proceedings of the IEEE/ACM international conference on Automated software engineering.ACM,2010:179-180
[5] Godefroid P,Klarlund N,Sen K.DART:directed automated random testing[J].ACM Sigplan Notices,2005,40(6):213-223
[6] Sen K,Marinov D,Agha G.CUTE:a concolic unit testing engine for C[M].ACM,2005
[7] Cadar C,Dunbar D,Engler D R.KLEE:Unassisted and Auto-matic Generation of High-Coverage Tests for Complex Systems Programs[C]∥OSDI.2008,8:209-224
[8] Gyimóthy T,Beszédes á,Forgács I.An efficient relevant slicing method for debugging[C]∥Software Engineering—ESEC/FSE’99.Springer Berlin Heidelberg,1999:303-321
[9] Qi D,Nguyen H D T,Roychoudhury A.Path exploration based on symbolic output[C]∥Proceeding of the ACM SIGSOFT Symposium on the Foundations of Software Engineering.2011:278-288
[10] Weiser M.Program slicing[C]∥Proceedings of the 5th international conference on Software engineering.IEEE Press,1981:439-449
[11] Nystrom N,Clarkson M R,Myers A C.Polyglot:Anextensible compiler framework for Java[C]∥Compiler Construction.Springer Berlin Heidelberg,2003:138-152
[12] Ferrante J,Ottenstein K J,Warren J D.The program dependence graph and its use in optimization[J].ACM Transactions on Programming Languages and Systems (TOPLAS),1987,9(3):319-349

No related articles found!
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!