An Approach to Automatic Test Case Generation for Unit Testing

被引:3
作者
Liu, Pan [1 ,2 ]
Xu, Zhenning [3 ]
Ai, Jun [4 ]
机构
[1] Shanghai Business Sch, Coll Informat & Comp, Shanghai, Peoples R China
[2] Engn Res Ctr Software Testing & Evaluat Fujian Pr, Xiamen, Fujian, Peoples R China
[3] Univ Southern Maine, Sch Business, Portland, ME 04103 USA
[4] Beihang Univ, Sch Reliabil & Syst Engn, Beijing, Peoples R China
来源
2018 IEEE 18TH INTERNATIONAL CONFERENCE ON SOFTWARE QUALITY, RELIABILITY AND SECURITY COMPANION (QRS-C) | 2018年
基金
中国国家自然科学基金;
关键词
the layer model; test case generation; unit testing; extended regular expression; test constraint;
D O I
10.1109/QRS-C.2018.00097
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
In the paper, we propose a method to automatically generate test cases for the program with nested loops. Our approach first constructs the layer model of the program by scanning procedure source code. Then, through the method of model refinement, the layer model is converted to the extended regular expression model. Next, we can get a set of test paths from the extended regular expression model according to algebraic operations and constraint conditions in the program. Finally, test cases of the program are constructed by using logical operations for these test paths. Compared with those traditional graph-based test case generation methods, our method can produce a set of executable test cases to satisfy a given test coverage criterion without having to build the control flow diagram of the program in unit testing. In addition, our method can also effectively avoid the state space explosion problem.
引用
收藏
页码:545 / 552
页数:8
相关论文
共 28 条
  • [1] Genetic Algorithms for Randomized Unit Testing
    Andrews, James H.
    Menzies, Tim
    Li, Felix C. H.
    [J]. IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2011, 37 (01) : 80 - 94
  • [2] [Anonymous], 2008, P 7 INT C ASP OR SOF
  • [3] [Anonymous], 2013, P ESEC FSE
  • [4] [Anonymous], CRYOBIOLOGY
  • [5] [Anonymous], 2017, IEEE SOFTWARE
  • [6] [Anonymous], SOFTWARE ENG TECHNOL
  • [7] [Anonymous], BOT REV
  • [8] [Anonymous], SIMPLE PRACTICAL APP
  • [9] [Anonymous], TOOL SUPPORTING PROG
  • [10] Software testing research: Achievements, challenges, dreams
    Bertolino, Antonia
    [J]. FOSE 2007: FUTURE OF SOFTWARE ENGINEERING, 2007, : 85 - 103