软件测试实验一Word格式文档下载.docx
- 文档编号:18541891
- 上传时间:2022-12-25
- 格式:DOCX
- 页数:19
- 大小:21.59KB
软件测试实验一Word格式文档下载.docx
《软件测试实验一Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《软件测试实验一Word格式文档下载.docx(19页珍藏版)》请在冰豆网上搜索。
DoubleLinkedListTest{
Test
publicvoid
test<
>
{
DoubleLinkedList
doubleLinkedList1
=
new
DoubleLinkedList<
doubleLinkedList1.clear<
Object
object
Object<
doubleLinkedList1.indexOf<
object>
doubleLinkedList1.add<
Collection<
String>
collection
ArrayList<
<
collection.add<
"
1"
2"
3"
doubleLinkedList
collection>
//
//
assertEquals<
true,actual>
true,
doubleLinkedList.contains<
false,
null>
3,
doubleLinkedList.size<
doubleLinkedList.add<
4"
doubleLinkedList.remove<
String
s
null;
s>
doubleLinkedList.get<
0>
0,
999"
4,
4>
try
{
doubleLinkedList.entry<
-1>
}
catch
Exception
e>
TODO:
handleexception
}
5>
doubleLinkedList.indexOf<
-1,
99"
doubleLinkedList.lastIndexOf<
doubleLinkedList.repOK<
doubleLinkedList.inList<
1>
doubleLinkedList1.inList<
doubleLinkedList2
doubleLinkedList1.repOK<
Object[]
objects
={object};
doubleLinkedList.toArray<
objects>
doubleLinkedList3
objects1
={object,object,object,object,object,object,object};
objects1>
collection.clear<
doubleLinkedList3.addAll<
doubleLinkedList1.addAll<
1,
55,
Class<
?
c=DoubleLinkedList.class;
Method[]methods=c.getDeclaredMethods<
for<
Methodm:
methods>
System.out.println<
m.getName<
3>
.previous.repOK<
DateTest:
publicclassDateTest{
publicvoidtest<
Datedate=newDate<
1,2,8>
Datedate1=newDate<
1,31,4>
Datedate2=newDate<
12,31,4>
date.getDay<
date.getMonth<
date.getYear<
date.increment<
date1.increment<
date2.increment<
date.toString<
date.printDate<
date.equals<
date1>
date2>
date1.equals<
date>
DayTest
getDay<
Yearyear=new
Year<
Monthmonth1=new
Month<
4,year>
Dayday=new
Day<
3,month1>
Dayday1=new
28,month1>
day.getCurrentPos<
3>
day1.setCurrentPos<
32>
day1.increment<
false>
day.increment<
true>
isValid1<
try{
Monthmonth=null;
Yearyear1=new
11>
2,month>
catch<
Exceptiono>
o
instanceof
IllegalArgumentException,
true>
isValid2<
Monthmonth2=new
10,year1>
month2.setCurrentPos<
13>
2,month2>
}catch<
isValid3<
-1,month2>
isValid4<
35,month2>
equals<
Monthmonth3=new
11,year1>
3,month2>
4,month2>
Dayday2=new
4,month3>
Dayday3=new
Objecto=new
day.equals<
o>
false>
day1>
day1.equals<
day2>
day3>
day.getDay<
MonthTest
publicclassMouthTest
Month
month=
Year
year=
month<
year1=
newYear<
6>
month2=
newMonth<
6,year1>
month3=
-3,year1>
Exceptione>
e
month1<
15,year1>
month2<
year2=
year2.setCurrentPos<
month5=
7,year2>
month3<
7,
year>
getMonth<
m1=
1,year1>
m2=
1,year2>
m3=
12,year2>
m1.getMonthSize<
31>
m2.getMonthSize<
m1.getMonth<
1>
m3.increment<
m1.increment<
Objecto=
2,year2>
m4=
m1.equals<
m2>
m3>
m4>
YearTest
publicclassYearTest
Yearyear1=newYear<
Yearyear2=newYear<
Yearyear3=newYear<
2>
s=new
getYear<
year1.getYear<
increment<
Yearyear=newYear<
year.increment<
year1.increment<
year1.equals<
year2>
year3>
isValid<
Yearyear0=newYear<
oinstanceof
isLeap<
Yeara1=newYear<
Yeara2=newYear<
100>
Yeara3=newYear<
Yeara4=newYear<
400>
Yeara5=newYear<
Yeara6=newYear<
-401>
Yeara7=newYear<
-2>
Yeara8=newYear<
-101>
Yeara9=newYear<
-5>
a1.isLeap<
a2.isLeap<
a3.isLeap<
a4.isLeap<
a5.isLeap<
a6.isLeap<
a7.isLeap<
a8.isLeap<
a9.isLeap<
3)}Vector
Vector是一个可扩展容器
测试类中创建vector实例
importstatic
org.junit.Assert.*;
VectorTest{
Vectorvector
newVector<
Vectorvector4
1,2>
Vectorvector2
-1,1>
einstanceof
IllegalArgumentException>
Object>
object1
object2
object3
object1>
object2>
Vectorvector3
Vector<
vector.ensureCapacity<
vector3.ensureCapacity<
vector4.ensureCapacity<
2,
vector3.size<
vector3.contains<
vector3.indexOf<
vector3.setElementAt<
object2,1>
object2,2>
ArrayIndexOutOfBoundsException>
vector3.removeElement<
object3>
vector3.addElement<
vector3.removeElementAt<
vector3.get<
null,1>
五.总结与分析
1.知识薄弱,测试类容易重复
2.分支覆盖
3.画树状图有利于分析代码
教师评语:
签名:
日期:
成绩:
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 软件 测试 实验
![提示](https://static.bdocx.com/images/bang_tan.gif)