软件测试实验报告(测试计划+黑盒测试+白盒测试)_第1页
软件测试实验报告(测试计划+黑盒测试+白盒测试)_第2页
软件测试实验报告(测试计划+黑盒测试+白盒测试)_第3页
软件测试实验报告(测试计划+黑盒测试+白盒测试)_第4页
软件测试实验报告(测试计划+黑盒测试+白盒测试)_第5页
已阅读5页,还剩14页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、软件测试计划测试目的1. 练习和掌握软件测试管理的一般过程与步骤;2. 掌握测试管理的人工过程和能够通过相关管理软件实现以下工作:a) 配置软件资产信息、软件需求、软件模型和缺陷数据库;b) 创建和管理多个测试组和用户;c) 配置测试环境、编写详细测试计划、安排测试进度;d) 设计测试脚本、测试用例;e) 实施测试、执行测试和评估测试。测试选题选题一:关于三角形问题的测试;选题二:对PriorDate程序(计算当前输入日期的前一天)的测试。测试人员何:软件测试计划及相关资料的编写与收集。侯:对特定问题编写程序代码,并对其进行黑盒测试。金:对特定问题编写程序代码,并对其进行白盒测试。测试方法对于

2、选题一,使用黑盒测试技术,测试内容包括等价类划分测试、边界值分析测试、决策表方法使用。对于选题二,使用白盒测试技术,测试内容包括语句覆盖测试、分支覆盖测试、条件覆盖测试、分支/条件覆盖测试、条件组合覆盖测试及基本路径测试。测试资料黑盒测试 测试规划是基于产品的功能,目的是检查程序各个功能是否能够实现,并检查其中的功能错误,这种测试方法称为黑盒测试(Black-box Testing)方法。 黑盒测试又称为功能测试、数据驱动测试和基于规格说明的测试。它是一种从用户观点出发的测试,一般被用来确认软件功能的正确性和可操作性。 黑盒测试的基本观点是:任何程序都可以看作是从输入定义域映射到输出值域的函数

3、过程,被测程序被认为是一个打不开的黑盒子,黑盒中的内容(实现过程)完全不知道,只明确要做到什么。 黑盒测试主要根据规格说明书设计测试用例,并不涉及程序内部构造和内部特性,只依靠被测程序输入和输出之间的关系或程序的功能设计测试用例。 黑盒测试的特点:(1)黑盒测试与软件的具体实现过程无关,在软件实现的过程发生变化时,测试用例仍然可以使用。(2)黑盒测试用例的设计可以和软件实现同时进行,这样能够压缩总的开发时间。 黑盒测试的具体技术方法: 边界值分析法 等价类划分法 因果图法 决策表法白盒测试 测试规划基于产品的内部结构进行测试,检查内部操作是否按规定执行,软件各个部分功能是否得到充分使用,则这种

4、测试方法称为白盒测试(White-box Testing)方法。 白盒测试又称为结构测试、逻辑驱动测试或基于程序的测试,一般用来分析程序的内部结构。 白盒测试将被测程序看作一个打开的盒子,测试者能够看到被测源程序,可以分析被测程序的内部结构,此时测试的焦点集中在根据其内部结构设计测试用例。 白盒测试要求是对某些程序的结构特性做到一定程度的覆盖,或者说这种测试是“基于覆盖率的测试”。 通常的程序结构覆盖有: 语句覆盖 判定覆盖 条件覆盖 判定/条件覆盖 路径覆盖黑盒测试与白盒测试的比较软件测试过程单元测试:针对每个单元的测试, 以确保每个模块能正常工作为目标。集成测试:对已测试过的模块进行组装,

5、进行集成测试。目的在于检验与软件设计相关的程 序结构问题。确认(有效性)测试:是检验所开发的软件能否满足所有功能和性能需求的最后手段。系统测试:检验软件产品能否与系统的其他部分(比如,硬件、数据库及操作人员)协调 工作。验收(用户)测试:检验软件产品质量的最后一道工序。主要突出用户的作用,同时软件开 发人员也应有一定程度的参与。数据整理测试所得到的用例测试报告、BUG报告,需要进行反馈和最后的归档,归档的工作按照项目计划中所规定的内容进行,反馈的工作在测试项结束后,整理成测试总结报告后进行,具体的日期,在项目计划中有规定。不同阶段的测试,都需要重复以上的步骤。其他必要的数据整理的工作,由项目经

6、理在进行过程中进行安排。三角形问题测试报告(黑盒)问题描述:完成一段程序,要求实现这样的功能。输入三个整数a,b,c,分别作为三角形的三条边,取值范围为1-100,判断由三条边构成的三角形类型为等边三角形、等腰三角形、一般三角形以及不构成三角形。判断结果打印输出。程序代码(开发环境:Windows7、Eclipse):import java.util.Scanner;public class Triangle public static void main(String args) double a, b, c;Scanner input = new Scanner(System.in);Sy

7、stem.out.println(输入三角形的三边:);a = input.nextDouble();b = input.nextDouble();c = input.nextDouble();input.close();if (a 0 & b 0 & c 0) if (a + b c & a + c b & b + c a) System.out.println(能构成三角形.);if (a * a + b * b = c * c | a * a + c * c = b * b| b * b + c * c = a * a) if (a = b | a = c | b = c) System

8、.out.println(为等腰直角三角形.); else System.out.println(一般直角三角形.); else if (a = b & b = c & a = c) System.out.println(为等边三角形.); else if (a = b & a != c) | (a = c & a != b)| (b = c & a != c) System.out.println(为等腰三角形.); else System.out.println(为一般三角形.); else System.out.println(不能构成三角形.); else System.out.pri

9、ntln(不能构成三角形.);测试方法:黑盒测试(等价类划分+边界值分析+决策表方法)测试用例设计: 1.等价类划分方法在多数情况下,是从输入域划分等价类的,但并非不能从被测程序的输出域反过来定义等价类,事实上,这对于三角形问题却是最简单的划分方法。 在三角形问题中,有四种可能的输出:等边三角形、等腰三角形、一般三角形和非三角形。利用这些信息能够确定下列输出(值域)等价类。 R1 = : 边为a,b,c的等边三角形 R2 = : 边为a,b,c的等腰三角形 R3 = : 边为a,b,c的一般三角形 R4 = : 边为a,b,c不能组成三角形 输入有效等价类编号无效等价类编号a,b,c: 边为a

10、,b,c的一般三角形 1a输入值超出预定义5a,b,c: 边为a,b,c的等边三角形 2b输入值超出预定义6a,b,c: 边为a,b,c的等腰三角形3c输入值超出预定义7a,b,c: 边为a,b,c不能组成三角形 42.边界值分析方法在三角形问题描述中,三角形每边边长的取范围值设值为1, 100 。项边界值用例设计思路数值a,b,c0, 101假设某软件的数据输入域要求输入的数据值,1为最小值、100作为最大值;然后使用刚好小于1和大于100的 数值来作为边界条件。数值b0, 101假设某软件的数据输入域要求输入的数据值,1为最小值、100作为最大值;然后使用刚好小于1和大于100的 数值来作

11、为边界条件。数值c0, 101假设某软件的数据输入域要求输入的数据值,1为最小值、100作为最大值;然后使用刚好小于1和大于100的 数值来作为边界条件。3.决策表方法(1) 确定规则个数。例如,三角形问题的决策表有 4 个条件:c1:a、b、c构成三角形? c2:a=b? c3:a=c? c4:b=c?每个条件可以取两个值,故有16种规则。 (2) 列出所有的条件桩和动作桩。 (3) 填入输入项。 (4) 填入动作项,得到初始决策表。 (5) 化简。合并相似规则后得到三角形问题的决策表 规则选项规则1-8规则9规则10规则11规则12规则13规则14规则15规则16条件:c1: a,b,c构

12、成 三角形?c2: a=b?c3: a=c?c4: b=c? N- YYYY YYYN YYNY YYNN YNYY YNYN YNNY YNNN动作:a1: 非三角形a2: 一般三角形a3: 等腰三角形a4: 等边三角形a5: 不可能 用例列表及其执行结果:用例编号采用方法输入a,b,c覆盖等价类号码预期结果执行结果Test1等价类划分10 10 101等边三角形等边三角形Test2等价类划分10 10 52等腰三角形等腰三角形Test3等价类划分3 4 53一般三角形一般三角形Test4等价类划分4 1 24非三角形非三角形Test5边界值分析方法60 60 1等腰三角形等腰三角形Test

13、6边界值分析方法60 60 2等腰三角形等腰三角形Test7边界值分析方法60 60 60等边三角形等边三角形Test8边界值分析方法50 50 99等腰三角形等腰三角形Test9边界值分析方法50 50 100非三角形非三角形Tes10决策表4 1 2 非三角形非三角形Test11决策表1 4 2非三角形非三角形Test12决策表2 2 3 等腰三角形等腰三角形Test13决策表5 5 5等边三角形等边三角形Test14决策表3 4 5一般三角形一般三角形PriorDate程序测试报告(白盒)问题描述: 定义一个PriorDate函数,PriorDate函数为了获得当前输入日期的前一个日期,

14、 执行如下操作:如果输入日期day变量值大于1,则把day变量的值减1;如果输入日期是212月份中某月的第一天,则把day变量的值置为前一个月的最后一天,month变量的值减1;如果输入日期是1月的第一天,则day变量的值置为31,month变量的值置为12,year变量的值减1。关于最后一天的判断:如果是有31天的月份(1,3,5,7,8,10,12),day变量值为31;如果是有30天的月份(4,6,9,11),day变量值为30;如果是有29天的月份(闰年的2月),day变量值为29;如果是有28天的月份(非闰年的2月),day变量值为28。程序代码(开发环境:Windows7、VC+)

15、:#include using namespace std; int main() int lastday,lastmonth,lastyear; int day,month,year; bool c1=1,c2=1,c3=1; while(c1&c2&c3) coutEnter todays date in form YYYY MM DDendl; cout例如2012年6月7号,输入形式为:2012 6 7yearmonthday; c1=(day=1)&(day=1)&(month=1900)&(year=2050); if (!c1) coutValue of day not in t

16、he range 131n; if (!c2) coutValue of month not in the range 112n; if (!c3) coutValue of year not in the range 190020501) lastday=day-1; lastmonth=month; lastyear=year; else lastday=30; lastmonth=month-1; lastyear=year; break; case 2: case 4: case 6: case 8: case 9: case 11: if(day1) lastday=day-1; l

17、astmonth=month; lastyear=year; else lastday=31; lastmonth=month-1; lastyear=year; break; case 3: if(day1) lastday=day-1; lastmonth=month; lastyear=year; else if(year%4=0&year%100!=0|year%400=0) lastday=29; lastmonth=2; lastyear=year; else lastday=28; lastmonth=2; lastyear=year; break; case 1: if(day

18、1) lastday=day-1; lastmonth=month; lastyear=year; else lastday=31; lastmonth=12; if(year!=1900) lastyear=year-1; else coutlastyear is not in rangeendl; break; default: couterror!endl; if(c1&c2&c3) coutthe lastday is:lastyear lastmonth lastdayn1day1day1day1语句语句5,7,10,122,4,6,8,9,11语句语句语句润年语句语句语句year!

19、=1812语句语句语句c1&c2&c3打印结束31DIRYZ1. 语句覆盖 语句覆盖就是设计若干个测试用例,运行被测程序,使得每一可执行语句至少执行一次。n 测试用例的设计格式如下:n 【输入的(a, b, x),输出的(a, b, x)】测试数据执行路径预期结果实际结果month=13,day=32,year=2013 OACEGZValue of day not in the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!Value of day not

20、 in the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!month=12,day=12,year=2010OBDFHLYthe lastday is12 11 2010the lastday is12 11 2010month=12,day=1,year=2010OBDFHMYthe lastday is11 30 2010the lastday is11 30 2010month=11,day=12,year=2010 OBDFINYthe last

21、day is11 11 2010the lastday is11 11 2010month=11,day=1,year=2010 OBDFIPYthe lastday is10 31 2010the lastday is10 31 2010month=3,day=12,year=2000 OBDFJQYthe lastday is3 11 2000the lastday is3 11 2000month=3,day=1,year=2010 OBDFJRYthe lastday is2 28 2010the lastday is2 28 2010month=1,day=12,year=2010

22、OBDFKSYthe lastday is1 11 2010the lastday is1 11 2010month=1,day=1,year=2010 OBDFKTWYthe lastday is12 31 2009the lastday is12 31 2009month=1,day=1,year=1812OBDFKTXYlastyear is not in rangethe lastday is12 31 lastyear is not in rangethe lastday is12 31 -2. 分支覆盖 执行足够的测试用例,使得程序中的每一个分支至少都通过一次 测试数据执行路径预期

23、结果实际结果month=13,day=32,year=2013 OACEGZValue of day not in the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!Value of day not in the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!month=12,day=12,year=2010OBDFH

24、LYthe lastday is12 11 2010the lastday is12 11 2010month=12,day=1,year=2010OBDFHMYthe lastday is11 30 2010the lastday is11 30 2010month=11,day=12,year=2010 OBDFINYthe lastday is11 11 2010the lastday is11 11 2010month=11,day=1,year=2010 OBDFIPYthe lastday is10 31 2010the lastday is10 31 2010month=3,da

25、y=12,year=2000 OBDFJQYthe lastday is3 11 2000the lastday is3 11 2000month=3,day=1,year=2000 OBDFJRYthe lastday is2 29 2000the lastday is2 29 2000month=3,day=1,year=2010 OBDFJRYthe lastday is2 28 2010the lastday is2 28 2010month=1,day=12,year=2010 OBDFKSYthe lastday is1 11 2010the lastday is1 11 2010

26、month=1,day=1,year=2010 OBDFKTWYthe lastday is12 31 2009the lastday is12 31 2009month=1,day=1,year=1812OBDFKTXYlastyear is not in rangethe lastday is12 31 lastyear is not in rangethe lastday is12 31 -3. 条件覆盖 执行足够的测试用例,使得判定中的每个条件获得各种可能的结果。 测试数据执行路径预期结果实际结果month=13,day=32,year=2013 OACEGZValue of day

27、not in the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!Value of day not in the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!month=0,day=0,year=1800OACEGZValue of day not in the range 1.31Value of month not

28、 in the range 1.12Value of year not in the range 1812.2012error!Value of day not in the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!month=12,day=12,year=2010OBDFHLYthe lastday is12 11 2010the lastday is12 11 2010month=12,day=1,year=2010OBDFHMYthe lastd

29、ay is11 30 2010the lastday is11 30 2010month=11,day=12,year=2010 OBDFINYthe lastday is11 11 2010the lastday is11 11 2010month=11,day=1,year=2010 OBDFIPYthe lastday is10 31 2010the lastday is10 31 2010month=3,day=12,year=2000 OBDFJQYthe lastday is3 11 2000the lastday is3 11 2000month=3,day=1,year=200

30、0 OBDFJRYthe lastday is2 29 2000the lastday is2 29 2000month=3,day=1,year=2010 OBDFJRYthe lastday is2 28 2010the lastday is2 28 2010month=1,day=12,year=2010 OBDFKSYthe lastday is1 11 2010the lastday is1 11 2010month=1,day=1,year=2010 OBDFKTWYthe lastday is12 31 2009the lastday is12 31 2009month=1,da

31、y=1,year=1812OBDFKTXYlastyear is not in rangethe lastday is12 31 lastyear is not in rangethe lastday is12 31 -4. 分支/条件覆盖 执行足够的测试用例,使得分支中每个条件取到各种可能的值,并使每个分支取到各种可能的结果。测试数据执行路径预期结果实际结果month=13,day=32,year=2013 OACEGZValue of day not in the range 1.31Value of month not in the range 1.12Value of year not

32、 in the range 1812.2012error!Value of day not in the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!month=0,day=0,year=1800OACEGZValue of day not in the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!Value of d

33、ay not in the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!month=12,day=12,year=2010OBDFHLYthe lastday is12 11 2010the lastday is12 11 2010month=12,day=1,year=2010OBDFHMYthe lastday is11 30 2010the lastday is11 30 2010month=11,day=12,year=2010 OBDFINYth

34、e lastday is11 11 2010the lastday is11 11 2010month=11,day=1,year=2010 OBDFIPYthe lastday is10 31 2010the lastday is10 31 2010month=3,day=12,year=2000 OBDFJQYthe lastday is3 11 2000the lastday is3 11 2000month=3,day=1,year=2004OBDFJRUYthe lastday is2 29 2004the lastday is2 29 2004month=3,day=1,year=

35、2000OBDFJRUYthe lastday is2 29 2000the lastday is2 29 2000month=3,day=1,year=2010 OBDFJRYthe lastday is2 28 2010the lastday is2 28 2010month=1,day=12,year=2010 OBDFKSYthe lastday is1 11 2010the lastday is1 11 2010month=1,day=1,year=2010 OBDFKTWYthe lastday is12 31 2009the lastday is12 31 2009month=1

36、,day=1,year=1812OBDFKTXYlastyear is not in rangethe lastday is12 31 lastyear is not in rangethe lastday is12 31 -5. 条件组合覆盖执行足够的例子,使得每个判定中条件的各种可能组合都至少出现一次。测试数据执行路径预期结果实际结果month=13,day=32,year=2013 OACEGZValue of day not in the range 1.31Value of month not in the range 1.12Value of year not in the ran

37、ge 1812.2012error!Value of day not in the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!month=0,day=0,year=1800 OACEGZValue of day not in the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!Value of day not in

38、the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!month=0,day=1,year=1800OBCEGZValue of month not in the range 1.12Value of year not in the range 1812.2012error!Value of month not in the range 1.12Value of year not in the range 1812.2012error!month=0,day

39、=0,year=2000OACFGZValue of day not in the range 1.31Value of month not in the range 1.12error!Value of day not in the range 1.31Value of month not in the range 1.12error!month=0,day=1,year=2000OBCFGZValue of month not in the range 1.12error!Value of month not in the range 1.12error!month=1,day=0,yea

40、r=1800OADFKTXZValue of day not in the range 1.31Value of year not in the range 1812.2012Value of day not in the range 1.31Value of year not in the range 1812.2012month=1,day=1,year=1800OBDEKTXZValue of year not in the range 1812.2012Value of year not in the range 1812.2012month=1,day=0,year=2000OADF

41、KTXZValue of day not in the range 1.31Value of day not in the range 1.31month=1,day=1,year=2000OBDFKTXYthe lastday is12 31 1999the lastday is12 31 1999month=12,day=12,year=2010OBDFHLYthe lastday is12 11 2010the lastday is12 11 2010month=12,day=1,year=2010OBDFHMYthe lastday is11 30 2010the lastday is

42、11 30 2010month=11,day=12,year=2010 OBDFINYthe lastday is11 11 2010the lastday is11 11 2010month=11,day=1,year=2010 OBDFIPYthe lastday is10 31 2010the lastday is10 31 2010month=3,day=12,year=2000 OBDFJQYthe lastday is3 11 2000the lastday is3 11 2000month=3,day=1,year=2004OBDFJRUYthe lastday is2 29 2

43、004the lastday is2 29 2004month=3,day=1,year=2000OBDFJRUYthe lastday is2 29 2000the lastday is2 29 2000month=3,day=1,year=2008OBDFJRUYthe lastday is2 29 2008the lastday is2 29 2008month=3,day=1,year=2001OBDFJRUYthe lastday is2 28 2001the lastday is2 28 2001month=3,day=1,year=2010 OBDFJRYthe lastday is2 28 2010the lastday is2 28 2010month=1,day=12,year=2010 OBDFKSYthe lastday is1 11 2010the lastday is1 11 2010month=1,day=1,year=2010 OBDFKTWYthe lastday is12 31 2009the l

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论