8

测试用例自动生成方法

 2 years ago
source link: https://gameinstitute.qq.com/community/detail/133753
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

测试用例自动生成方法

发表于13小时前
评论0 33浏览

想免费获取内部独家PPT资料库?观看行业大牛直播?点击加入腾讯游戏学堂游戏程序行业精英群

711501594

如今,单元测试已成为软件开发过程中必不可少的部分。当前常用的方法是针对待测程序,编写对应的测试用例实现对待测程序的单元测试。

本方法可以对待测程序通过静态分析,自动生成测试脚本,如下:

1、获取待测程序,遍历待测函数中的函数语句,获取待测函数中的测试条件

2、拆分测试条件,将测试条件拆分成树状结构,例如:测试条件为:x>0;x<=0,则将该测试条件拆分为:x<0;x=0;x>0三个分支

测试条件为y=0;y!=0,时,则拆分为:y=0;y!=0

3、记录由各个分支的测试条件构成的集合

4、根据集合生成用于测试待测程序的测试用例集合。

如社区发表内容存在侵权行为,您可以点击这里查看侵权投诉指引


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK