逻辑覆盖法测试用例

更新时间:2023-05-18 21:16:45 阅读: 评论:0

一、实验目的
掌握逻辑覆盖法设计测试用例、下载并安装功能测试工具且熟悉脚本的录制
二、实验内容
1.
下载LoadRunner 工具,下载安装,录制邮箱登陆的脚本,并回放。如需了解打开登录页面到登录成功的时间,要怎样修改脚本?2.用逻辑覆盖法设计下面问题的测试用例。
result=∑=|
工作汇报
|0N k k ,且result<max,max 为一个常量值。
三、实验环境
Windows XP、LoadRunner
四、实验步骤
1、LoadRunner 工具录制测试
一、截取代码如下:
檀木梳子的功效与作用vur_init()
{
web_url("aHR0cDovL21haWwuMTI2LmNvbS8=",
"URL=/checkurl/aHR0cDovL21haWwuMTI2LmNvbS8=/?type=1&key =983333520",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t20.inf",
"Mode=HTML",
LAST);
web_add_cookie("logType=df;DOMAIN=");
web_add_cookie("nts_mail_ur=zvlvjv:-1:1;DOMAIN=");
web_add_cookie("NETEASE_SSN=zvlvjv;DOMAIN=");
web_add_cookie("P_INFO=1630361621|0|mail163|11&17|1;DOMAIN=");
web_add_cookie("MAIL163_SSN=zvlvjv;DOMAIN=");
web_add_cookie("logType=df;DOMAIN=");
贵阳到成都web_add_cookie("nts_mail_ur=zvlvjv:-1:1;DOMAIN=");
web_add_cookie("NETEASE_SSN=zvlvjv;DOMAIN=");
web_add_cookie("P_INFO=1630361621|0|mail163|11&17|1; DOMAIN=");
web_add_cookie("MAIL163_SSN=zvlvjv;DOMAIN=");
web_url("",
"URL=/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t21.inf",
"Mode=HTML",
EXTRARES,
"Url=/index/2009/img/bgimg2.jpg",ENDITEM,
"Url=/index/2009/img/2010countdown.jpg",ENDITEM,
"Url=/ggimg/163/img/091109_indexbg_menghuan.jpg", ENDITEM,
"Url=/p/dm3style/js/0906031436/engine1.js",ENDITEM,
LAST);
lr_think_time(20);/
web_url("cmVzOi8vZTolNWN0aGV3b3J-MSU1Y3RoZXdvcmxkLmV4ZS9OQVZJRVJSLkhUTSMtMj E0NjY5NzIwOCNodHRwczovL3JlZy4xNjMuY29tL2xvZ2lucy5qc3A-dHlwZT0xJnByb2R1Y3Q9bWFpb DEyNiZ1cmw9aHR0cDovL2VudHJ5Lm1haWwuMTI2LmNvbS9jZ2kvbnRlc2Rvb3I-aGlkJTNEMTAwMTAx MDIlMjZsaWdodHdlaWdodCUzRDElMjZ2",
"URL=/checkurl/cmVzOi8vZTolNWN0aGV3b3J-MSU1Y3RoZXdvcmxk LmV4ZS9OQVZJRVJSLkhUTSMtMjE0NjY5NzIwOCNodHRwczovL3JlZy4xNjMuY29tL2xvZ2lucy5qc3A -dHlwZT0xJnByb2R1Y3Q9bWFpbDEyNiZ1cmw9aHR0cDovL2VudHJ5Lm1haWwuMTI2LmNvbS9jZ2kvbn Rlc2Rvb3I-aGlkJTNEMTAwMTAxMDIlMjZsaWdodHdlaWdodCUzRDElMjZ2ZXJpZnljb29raWUlM0QxJ TI2bGFuZ3VhZ2UlM0QwJTI2c3R5bGUlM0QtMQ==/?type=1&key=983333520",
我最喜欢的水果
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t22.inf",
"Mode=HTML",
EXTRARES,
"Url=/ErrorConfig/sina.json?t=3814","Referer=", ENDITEM,
"Url=/img/ia_1.gif","Referer=",ENDITEM,
LAST);
web_add_cookie("USERTRACK=222.76.5.196.1259676376299376;
DOMAIN=");
web_add_cookie("_ntes_nnid=62309a4e7ecf8d784d31cfc369e43fd8,0;
DOMAIN=");
web_add_cookie("_ntes_nuid=62309a4e7ecf8d784d31cfc369e43fd8;
DOMAIN=");
web_add_cookie("Province=0590;DOMAIN=");
web_add_cookie("City=0591;DOMAIN=");
web_add_cookie("P_INFO=1630361621|0|mail163|11&17|1; DOMAIN=");
web_add_cookie("vjuids=-2cefe9a48.1256d53573d.0.fd6deb9a5a3e1;
DOMAIN=");
web_add_cookie("vjlast=1630259596.1630259596.30;DOMAIN=");
web_add_cookie("ntes_ucc=;DOMAIN=");
web_add_cookie("NTES_UFC=20100000000000011000000000000000000000000000000000 00000000000000;DOMAIN=");
web_add_cookie("isGd=0;DOMAIN=");
web_add_cookie("isFs=0;DOMAIN=");
web_add_cookie("MUSIC_BOX_STATE=-1,,;DOMAIN=");
web_url("logins.jsp",
"URL=/logins.jsp?type=1&product=mail163&url=entry. /cgi/ntesdoor?hid%3D10010102%26lightweight%3D1%26verifycookie%3D1%2 6language%3D0%26style%3D-1",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t23.inf",
"Mode=HTML",
EXTRARES,
"Url=/img/newindex/b_bg.gif",
"Referer=/logins.jsp?type=1&product=mail163&url=entry. /cgi/ntesdoor?hid%3D10010102%26lightweight%3D1%26verifycookie%3D1%2 6language%3D0%26style%3D-1",ENDITEM,
"Url=/img/newindex/btn.gif",
"Referer=/logins.jsp?type=1&product=mail163&url=entry. /cgi/ntesdoor?hid%3D10010102%26lightweight%3D1%26verifycookie%3D1%2 6language%3D0%26style%3D-1",ENDITEM,
"Url=/img/newindex/top_titi.gif",
"Referer=/logins.jsp?type=1&product=mail163&url=entry. /cgi/ntesdoor?hid%3D10010102%26lightweight%3D1%26verifycookie%3D1%2 6language%3D0%26style%3D-1",ENDITEM,
"Url=/img/imgRight-2.gif",
"Referer=/logins.jsp?type=1&product=mail163&url=entry. /cgi/ntesdoor?hid%3D10010102%26lightweight%3D1%26verifycookie%3D1%2 6language%3D0%26style%3D-1",ENDITEM,
"Url=/img/newindex/t3.gif",
"Referer=/logins.jsp?type=1&product=mail163&url=entry.
会撒娇的女人最好命/cgi/ntesdoor?hid%3D10010102%26lightweight%3D1%26verifycookie%3D1%2 6language%3D0%26style%3D-1",ENDITEM,
"Url=/img/newindex/logo_bg2.gif",
"Referer=/logins.jsp?type=1&product=mail163&url=entry. /cgi/
ntesdoor?hid%3D10010102%26lightweight%3D1%26verifycookie%3D1%2 6language%3D0%26style%3D-1",ENDITEM,
"Url=/img/newindex/t2.gif",
"Referer=/logins.jsp?type=1&product=mail163&url=entry. /cgi/ntesdoor?hid%3D10010102%26lightweight%3D1%26verifycookie%3D1%2 6language%3D0%26style%3D-1",ENDITEM,
LAST);
lr_think_time(17);
web_submit_data("logins.jsp_2",
"Action=/logins.jsp",
三线表怎么做
"Method=POST",
"RecContentType=text/html",
"Referer=/logins.jsp?type=1&product=mail163&url=e ntry./cgi/ntesdoor?hid%3D10010102%26lightweight%3D1%26verifycookie% 3D1%26language%3D0%26style%3D-1",
"Snapshot=t24.inf",
"Mode=HTML",
ITEMDATA,
"Name=url",
贷款利率表"Value=entry./cgi/ntesdoor?hid=10010102&lightweight=1&verify cookie=1&language=0&style=-1",ENDITEM,
"Name=type","Value=1",ENDITEM,
"Name=product","Value=mail163",ENDITEM,
"Name=savelogin","Value=",ENDITEM,
"Name=outfoxer","Value=",ENDITEM,
"Name=domains","Value=",ENDITEM,
"Name=syscheckcode","Value=ed7cacd7d7c9c92b769ed4cce84771c67d6415dd", ENDITEM,
"Name=urname","Value=",ENDITEM,
"Name=password","Value=1232320",ENDITEM,
"Name=Submit","Value=",ENDITEM,
LAST);
世界大学排名前100名一览表}
2、逻辑覆盖法设计
一、根据所给的条件画出数据注流程图,如下所示:
|N|<k
result=
∑=||0N k k result<max 输出result 结果T
T
F
F
end
简化路径
(1)语句覆盖
要实现语句覆盖,覆盖程序中的所有可执行语句。只要通过路径MKNJP 就可以语句覆盖。
测试用例输入为:{Max=6、N=3、K=3}
程序执行的路径是:MKNJP

本文发布于:2023-05-18 21:16:45,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/82/686228.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:覆盖   实验   脚本
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图