一、课程名称
软件测试技术与软件质量
二、课程的目的与任务
软件测试是信息系统开发中的一个重要步骤,随着软件变得日益复杂,软件测试也变得越来越重要。本课程主要介绍软件测试技术的发展历史与现状、测试的基本理论与技术和测试工具软件的使用。本课程的目的是让学生深刻理解软件测试思想和基本理论;熟悉多种软件的测试方法、相关技术和测试过程;并熟悉几种常用的主流测试工具软件,从而为学生以后就业和工作打下专业基础。
三、总体要求
1 .学生和指导老师都要遵守课堂纪律,不得无故缺课、迟到或早退。 2 .教师应对实验内容进行讲解,同时学生要对实验内容进行预习。
3 .指导老师对学生要严格要求,对学生的设计要认真指导,认真解答学生所指出的问题,并根据具体情况作必要的集中讲授。
4 .每个学生要在实验结束后的一周内,按要求撰写实验报告(纸质),由学习委员集中交给指导老师。
《软件测试技术与软件质量》指导书
四、实验安排
序号 1 2 3 实 验 项 目 实验一 Junit下的单元测试 实验二 QTP下的功能测试与自动化测试 实验三 LoadRunner下的性能测试 实验学时 3 5 4 每组人数 1 1 1 实验类型 验证 验证 验证 开出要求 必做 必做 必做
五、实验目的、内容与要求
实验一 Junit下的单元测试
(一)实验目的
1.掌握单元测试的基本方法和基本原理; 2.掌握Junit测试的基本方法,熟悉基本流程; 3.能够设计测试用例,能够分析用例的执行结果。 (二)实验内容与要求
1.完成下面计算器类的测试类,基于Junit4; 2.每个方法都进行测试,给出测试结论,并分析;
3.根据测试结论,修改源码,再进行测试,给出结果和分析; 4.给出自己的总结。
1
《软件测试技术与软件质量》指导书
package 姓名简称+学好后4位(例如:chenxp1201) public class Calculator1201 {
private static int result; // 静态变量,用于存储运行结果 public void add(int n) //加 {
result = result + n;} public void substract(int n)//减 {
result = result - 1; }
public void multiply(int n)//乘 { }
public void divide(int n)//除 {
result = result / n; }
public void square(int n)//平方 {
result = n * n; }
public void squareRoot(int n)//开方 {
for (; ;) ; } public void link(int n)//链接 {
result = result*10+n; } public void clear() ...{ // 将结果清零 result = 0; }
public int getResult() ...{ return result; } }
result = result * n;
2
《软件测试技术与软件质量》指导书
3
《软件测试技术与软件质量》指导书
4
《软件测试技术与软件质量》指导书
实验二 QTP下的功能测试与自动化测试
(一)实验目的
1.了解QTP的主要功能,熟悉QTP的使用环境; 2.掌握掌握QTPr的两种测试脚本录制方法;
3.掌握在测试脚本中插入同步点、建立检查点的方法。 4、掌握数据驱动测试脚本的转换方法,实现多组数据自动测试。 (二)实验内容与要求
使用QTP自带飞机票预定程序Flight4a,完成订票过程的功能测试与自动测试,具体过程与要求如下:
1.AgentName:学号后4位;4136 2.Password:mercury; 3.点击确定; 4.点击新建;
5.输入日期:07+(学号后2位)+12;07,09,12 6.出发地:London; 7.到达地:Paris; 8.点击Flights图标;
9.Name:你的姓名简写(姓+名字第一个字母,例如:chenxp);zhangy 10.Insert order; 11.点工具栏“打开”;
12.选择“AgentName”,输入刚输入的姓名; 13.查看查询结果,关掉窗口; 14.停止录制; 15.删除记录; 16.回放.
5
《软件测试技术与软件质量》指导书
参数化之前,截图如下
6
《软件测试技术与软件质量》指导书
二、对于步骤一的4-10,做如下操作: 1.参数化出发地; 2.参数化到达地; 3.参数化航班; 4.自动测试,50+次; 5.分析QTP的Result;
6.打开软件Flight4a,利用Report分析结果。
7
《软件测试技术与软件质量》指导书
实验三 LoadRunner下的性能测试
(一)实验目的
1.掌握LoadRunner搭建性能测试环境的基本流程; 2.掌握LoadRunner进行功能测试的基本流程; 3.了解LoadRunner性能测试的基本分析方法; 1
(三)实验内容与要求
使用LoadRunner模拟10个并发用户,对web应用程序Flight4a进行性能测试,并进行分析,具体流程如下:
一、VUG(Start > Programs > LoadRunner > Samples> Web > Start Web Server.) (一)
1、 创建一个空的VUser脚本:New->New Single Protocal Script->Web(HTTP/HTML) 2、 开始录制;
3、 Enter flight details.//账号密码jojo:bean 4、 Click Flights. The Find Flight page opens: 5、 ➤ Departure City: 第(学号开方)个
6、 ➤ Departure Date: Keep the default, current date 7、 ➤ Arrival City: 第(学号开方+1)个
8、 ➤ Return Date: Keep the default, tomorrow’s date 9、 ➤ Seating Preference: Aisle
10、 Keep the rest of the default settings and click Continue. The Search Results page opens.
11、 Click Continue to accept the default flight selections. The Payment Details page opens.
12、 Enter (你的学号) in the Credit Card box and type 08/30 in the Exp Date box.
13、 Click Continue. The Invoice page opens, displaying your invoice 14、 Check the itinerary.
15、 Click Itinerary in the left pane. The Itinerary page opens. 16、 Click Sign Off in the left pane.
17、 Click Stop on the floating toolbar to stop the recording process. (二)
18、 Open the run-time settings. 19、 Open the Run Logic settings
20、 Set the number of iterations to 2.
21、 Select the Log node.Select Extended log and enable Parameter substitution. This option will be
22、 relevant for the following lesson at which point it will be discussed
(三)LoadRunner网络教程63-69页(Start > Programs > LoadRunner->教程)
8
《软件测试技术与软件质量》指导书
二、Controller
1、Open the controller;
2、Add available scripts:browse->LoadRunner installation->Tutorial 目录; 3、Check to see that the basic_script appears in the Group Name column of the Scenario Groups pane.
4、Change the Group Name:你的姓名简写:例如:chenxp 5、Add a load generator and test
6、select schedule type and run mode(默认)
7、Set schedule:start 8 ervery 30ss,run for10min,stop all Vusers 2 every 30ss 8、Open the run-time settings:
9、Enable think time :min:50%,max:150%
10、Enable loggint:Extend log,Data returned by server
11、观察负载:Select the windows Resource Minitor(Run) 12、Select the monitored server 13、Open the Controller Run view.
14、Click the Start Scenario button or select Scenario > Start to begin running the test.
三、分析每个结果图,给出分析
9
《软件测试技术与软件质量》指导书
10
《软件测试技术与软件质量》指导书
11
《软件测试技术与软件质量》指导书
12
因篇幅问题不能全部显示,请点此查看更多更全内容
Copyright © 2019- awee.cn 版权所有 湘ICP备2023022495号-5
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务