- 1、本文档共56页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
1
软件测试实验指导手册
实验1:开发者测试
一、实验目的
理解和掌握使用Eclemma软件测试工具对Java语言编写的程序进行语句覆盖测试。
二、实验环境
装有Eclipse的计算机。
三、实验内容
2
3
4
5
参考答案代码和覆盖率截图如下:
importdemo.*;
importorg.junit.Assert;
importorg.junit.Test;
publicclassDemoTest{
@Test
publicvoidtest(){
Datedate1=newDate(12,5,2029);
Datedate2=newDate(12,5,2029);Datedate3=newDate(12,31,2019);Datedate4=newDate(2,28,2020);
Datedate5=newDate(3,31,2020);
Yearyear1=newYear(2019);
Monthmonth=newMonth(1,year1);
6
Dayday=newDay(1,month);
//testdate
Assert.assertTrue(date1.equals(date2));
Assert.assertFalse(date1.equals(date3));
Assert.assertFalse(date1.equals(year1));
System.out.println(Nextday.nextDay(date1));
Nextday.nextDay(date3);
Nextday.nextDay(date4);
Nextday.nextDay(date5);
date1.printDate();
Assert.assertFalse(month.equals(1));
Assert.assertFalse(day.equals(1));
try{
Datedate6=newDate(1,1,0);
}catch(IllegalArgumentExceptione){
e.getMessage();}
try{
Datedate7=newDate(1,1,-1);
Assert.assertTrue(date7.getYear().increment());}catch(Exceptione){
Assert.assertTrue(einstanceofIllegalArgumentException);}
try{
Monthmonth1=newMonth(0,year1);
Monthmonth2=newMonth(1,year1);
Assert.assertFalse(month2.equals(date1));
Assert.assertFalse(month2.equals(month1));}catch(Exceptione){
Assert.assertTrue(einstanceofIllegalArgumentException);}
try{
Monthmonth1=newMonth(1,year1);
7
Dayday1=newDay(-1,month1);
Assert.assertTrue(day1.equals(1));
}catch(Exceptione){
Assert.assertTrue(einstanceofIllegalArgumentException);}
}
}
实验2:嵌入式软件测试
一、实验目的
依照2019测试大赛题目-新版单车.pdf中的需求文档和测试要求,尽可能多的找出待测件的问题。
问题报告单至少包含两个以上问题。
报告单存为xlsx文件,发送至邮箱,文件名为学号+姓名。报告上交截至时间:2022年5月27日(下周四)晚八点前。
8
二、共享单车控制器需求文档及测试要求
1、系统概述
共享单车系统由服务器、GPS模块、锁具控制器组成,系统工作原理图如图1所示,锁具控制器从服务器接收开关锁指令,控制锁具开锁或关锁,并将执行结果回馈给服务器;定时从GPS接收单车的位置信息,进行行程信息的统计,并定时将行程信息上报给服务器。
服务器
开关锁指令TCP回开关锁
开关锁指令
TCP
回
TCP指令
TCP行程信息
馈
馈
·
9
GPS
GPS模块RS232
锁具控制器
位置信息
图1共享单车系统结构图
本次测试的对象为锁具控制器。
2、
文档评论(0)