版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、word软件测试方案测试目的1. 练习和掌握软件测试管理的一般过程与步骤;2. 掌握测试管理的人工过程和能够通过相关管理软件实现以下工作:a) 配置软件资产信息、软件需求、软件模型和缺陷数据库;b) 创立和管理多个测试组和用户;c) 配置测试环境、编写详细测试方案、安排测试进度;d) 设计测试脚本、测试用例;e) 实施测试、执行测试和评估测试。测试选题对PriorDate程序计算当前输入日期的前一天的测试。测试人员何:软件测试方案及相关资料的编写与收集。侯:对特定问题编写程序代码,并对其进行黑盒测试。金:对特定问题编写程序代码,并对其进行白盒测试。测试方法使用白盒测试技术,测试内容包括语句覆盖
2、测试、分支覆盖测试、条件覆盖测试、分支/条件覆盖测试、条件组合覆盖测试及根本路径测试。测试资料白盒测试 测试规划基于产品的内部结构进行测试,检查内部操作是否按规定执行,软件各个局部功能是否得到充分使用,那么这种测试方法称为白盒测试(White-box Testing)方法。 白盒测试又称为结构测试、逻辑驱动测试或基于程序的测试,一般用来分析程序的内部结构。 白盒测试将被测程序看作一个翻开的盒子,测试者能够看到被测源程序,可以分析被测程序的内部结构,此时测试的焦点集中在根据其内部结构设计测试用例。 白盒测试要求是对某些程序的结构特性做到一定程度的覆盖,或者说这种测试是“基于覆
3、盖率的测试。 通常的程序结构覆盖有: 语句覆盖 判定覆盖 条件覆盖 判定/条件覆盖 路径覆盖软件测试过程单元测试:针对每个单元的测试, 以确保每个模块能正常工作为目标。集成测试:对已测试过的模块进行组装,进行集成测试。目的在于检验与软件设计相关的程 序结构问题。确认有效性测试:是检验所开发的软件能否满足所有功能和性能需求的最后手段。系统测试:检验软件产品能否与系统的其他局部比方,硬件、数据库及操作人员协调 工作。验收用户测试:检验软件产品质量的最后一道工序。主要突出用户的作用,同时软件开 发人员也应有一定程度的参与。数据整理测试所得到的用例测试报告、BUG报告,需要进行反应
4、和最后的归档,归档的工作按照工程方案中所规定的内容进行,反应的工作在测试项结束后,整理成测试总结报告后进行,具体的日期,在工程方案中有规定。不同阶段的测试,都需要重复以上的步骤。其他必要的数据整理的工作,由工程经理在进行过程中进行安排。PriorDate程序测试报告白盒问题描述: 定义一个PriorDate函数,PriorDate函数为了获得当前输入日期的前一个日期, 执行如下操作:如果输入日期day变量值大于1,那么把day变量的值减1;如果输入日期是212月份中某月的第一天,那么把day变量的值置为前一个月的最后一天,month变量的值减1;如果输入日期是1月的第一天,那么day变量的值置
5、为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+:#include <iostream> using namespace std; int main() int lastday,las
6、tmonth,lastyear; int day,month,year; bool c1=1,c2=1,c3=1; while(c1&&c2&&c3) cout<<"Enter today's date in form YYYY MM DD"<<endl; cout<<"例如2012年6月7号,输入形式为:2012 6 7"<<endl; cin>>year>>month>>day; c1=(day>=1)&&
7、(day<=31); c2=(month>=1)&&(month<=12); c3=(year>=1900)&&(year<=2050); if (!c1) cout<<"Value of day not in the range 131"<<"n" if (!c2) cout<<"Value of month not in the range 112"<<"n" if (!c3) cout<<
8、"Value of year not in the range 19002050"<<"n" switch(month) case 5: case 7: case 10: case 12: if(day>1) 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(day>1)
9、 lastday=day-1; lastmonth=month; lastyear=year; else lastday=31; lastmonth=month-1; lastyear=year; break; case 3: if(day>1) 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; lastye
10、ar=year; break; case 1: if(day>1) lastday=day-1; lastmonth=month; lastyear=year; else lastday=31; lastmonth=12; if(year!=1900) lastyear=year-1; else cout<<"lastyear is not in range"<<endl; break; default: cout<<"error!"<<endl; if(c1&&c2&&
11、;c3) cout<<"the lastday is:"<<lastyear<<" "<<lastmonth<<" "<<lastday<<"n"<<endl; return 0;测试方法:白盒测试语句覆盖、分支覆盖、条件覆盖、分支/条件覆盖、条件组合覆盖及根本路径测试方法测试用例设计: 程序的流程图如下列图:YUXWVTJPHGFECBAOYesYesNoYesYesYesYesYesNoNoNoNoNoNoNodef
12、aultSQLNMK开始天数1到31月份1到12打印输入天数出错打印输入月份出错年份1812到2012Month匹配打印输入年份出错day>1day>1day>1day>1语句语句5,7,10,122,4,6,8,9,11语句语句语句润年语句语句语句year!=1812语句语句语句c1&&c2&&c3打印结束31DIRYZ1. 语句覆盖 语句覆盖就是设计假设干个测试用例,运行被测程序,使得每一可执行语句至少执行一次。n 测试用例的设计格式如下:n 【输入的(a, b, x),输出的(a, b, x)】测试数据执行路径预期结果实际结果mon
13、th=13,day=32,year=2022 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=2022OBDFHLYthe las
14、tday is12 11 2022the lastday is12 11 2022month=12,day=1,year=2022OBDFHMYthe lastday is11 30 2022the lastday is11 30 2022month=11,day=12,year=2022 OBDFINYthe lastday is11 11 2022the lastday is11 11 2022month=11,day=1,year=2022 OBDFIPYthe lastday is10 31 2022the lastday is10 31 2022month=3,day=12,year
15、=2000 OBDFJQYthe lastday is3 11 2000the lastday is3 11 2000month=3,day=1,year=2022 OBDFJRYthe lastday is2 28 2022the lastday is2 28 2022month=1,day=12,year=2022 OBDFKSYthe lastday is1 11 2022the lastday is1 11 2022month=1,day=1,year=2022 OBDFKTWYthe lastday is12 31 2009the lastday is12 31 2009month=
16、1,day=1,year=1812OBDFKTXYlastyear is not in rangethe lastday is12 31 lastyear is not in rangethe lastday is12 31 -8589934602. 分支覆盖 执行足够的测试用例,使得程序中的每一个分支至少都通过一次 测试数据执行路径预期结果实际结果month=13,day=32,year=2022 OACEGZValue of day not in the range 1.31Value of month not in the range 1.12Value of year not in t
17、he 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=2022OBDFHLYthe lastday is12 11 2022the lastday is12 11 2022month=12,day=1,year=2022OBDFHMYthe lastday is11 30 2022the lastday is11 30 2022m
18、onth=11,day=12,year=2022 OBDFINYthe lastday is11 11 2022the lastday is11 11 2022month=11,day=1,year=2022 OBDFIPYthe lastday is10 31 2022the lastday is10 31 2022month=3,day=12,year=2000 OBDFJQYthe lastday is3 11 2000the lastday is3 11 2000month=3,day=1,year=2000 OBDFJRYthe lastday is2 29 2000the last
19、day is2 29 2000month=3,day=1,year=2022 OBDFJRYthe lastday is2 28 2022the lastday is2 28 2022month=1,day=12,year=2022 OBDFKSYthe lastday is1 11 2022the lastday is1 11 2022month=1,day=1,year=2022 OBDFKTWYthe lastday is12 31 2009the lastday is12 31 2009month=1,day=1,year=1812OBDFKTXYlastyear is not in
20、rangethe lastday is12 31 lastyear is not in rangethe lastday is12 31 -8589934603. 条件覆盖 执行足够的测试用例,使得判定中的每个条件获得各种可能的结果。 测试数据执行路径预期结果实际结果month=13,day=32,year=2022 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 i
21、n 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 day not in the range 1.31Value of month not in t
22、he range 1.12Value of year not in the range 1812.2012error!month=12,day=12,year=2022OBDFHLYthe lastday is12 11 2022the lastday is12 11 2022month=12,day=1,year=2022OBDFHMYthe lastday is11 30 2022the lastday is11 30 2022month=11,day=12,year=2022 OBDFINYthe lastday is11 11 2022the lastday is11 11 2022m
23、onth=11,day=1,year=2022 OBDFIPYthe lastday is10 31 2022the lastday is10 31 2022month=3,day=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=2022 OBDFJRYthe lastday is2 28 2022the lastday
24、is2 28 2022month=1,day=12,year=2022 OBDFKSYthe lastday is1 11 2022the lastday is1 11 2022month=1,day=1,year=2022 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 -8589934604.
25、 分支/条件覆盖 执行足够的测试用例,使得分支中每个条件取到各种可能的值,并使每个分支取到各种可能的结果。测试数据执行路径预期结果实际结果month=13,day=32,year=2022 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
26、 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 day not in the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!month=
27、12,day=12,year=2022OBDFHLYthe lastday is12 11 2022the lastday is12 11 2022month=12,day=1,year=2022OBDFHMYthe lastday is11 30 2022the lastday is11 30 2022month=11,day=12,year=2022 OBDFINYthe lastday is11 11 2022the lastday is11 11 2022month=11,day=1,year=2022 OBDFIPYthe lastday is10 31 2022the lastda
28、y is10 31 2022month=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=2000OBDFJRUYthe lastday is2 29 2000the lastday is2 29 2000month=3,day=1,year=2022 OBDFJRYthe lastday is2 28 2022
29、the lastday is2 28 2022month=1,day=12,year=2022 OBDFKSYthe lastday is1 11 2022the lastday is1 11 2022month=1,day=1,year=2022 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
30、-8589934605. 条件组合覆盖执行足够的例子,使得每个判定中条件的各种可能组合都至少出现一次。测试数据执行路径预期结果实际结果month=13,day=32,year=2022 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 n
31、ot 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 the range 1.31Value of month not in the range 1.12Value of year not in the range 1812.2012error!month=0
32、,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=0,year=2000OACFGZValue of day not in the range 1.31Value of month not in the range 1.12error!Value of
33、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,year=1800OADFKTXZValue of day not in the range 1.31Value of year not in the range 1812.2012Value of day no
34、t 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=2000OADFKTXZValue of day not in the range 1.31Value of day not in the range 1.31month=1,day=1,year=2000OBDFKTXY
35、the lastday is12 31 1999the lastday is12 31 1999month=12,day=12,year=2022OBDFHLYthe lastday is12 11 2022the lastday is12 11 2022month=12,day=1,year=2022OBDFHMYthe lastday is11 30 2022the lastday is11 30 2022month=11,day=12,year=2022 OBDFINYthe lastday is11 11 2022the lastday is11 11 2022month=11,day
36、=1,year=2022 OBDFIPYthe lastday is10 31 2022the lastday is10 31 2022month=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=2000OBDFJRUYthe lastday is2 29 2000the lastday is2 29 2000
37、month=3,day=1,year=2022OBDFJRUYthe lastday is2 29 2022the lastday is2 29 2022month=3,day=1,year=2001OBDFJRUYthe lastday is2 28 2001the lastday is2 28 2001month=3,day=1,year=2022 OBDFJRYthe lastday is2 28 2022the lastday is2 28 2022month=1,day=12,year=2022 OBDFKSYthe lastday is1 11 2022the lastday is
38、1 11 2022month=1,day=1,year=2022 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 -8589934606. 根本路径测试方法 设计足够的测试用例,覆盖程序中所有可能的路径,其中控制流图如下列图:123456798101114151312161718211920222
39、9252662324272830303031 测试数据执行路径预期结果实际结果month=13,day=32,year=2022 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.2012err
40、or!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 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
41、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=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,year=1800OADFKTXZValue of day not in the range 1.31Value of year not in the range 1812.2012Value of day not in the range 1.31V
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年同城仓储配送合同范本
- 2026年仓储货物寄存合同协议
- 2026年监控系统工程建设项目质量合同
- 2026年打印机驱动更新服务合同协议
- 2026年广告合规审核服务合同协议
- 软件开发合同协议2026年合同生效条款
- 2026年农村农业科研合作合同协议
- 生物技术专利实施许可合同协议2026
- 2026年物流国际货运合同协议
- 2026年教育保险合同
- 测绘测量设备保密制度范文
- 脑卒中后吞咽障碍的护理
- 麻醉机检查流程
- 广告标识牌采购投标方案
- 提升信息素养教学课件
- 2025CSCO子宫内膜癌新进展及指南更新要点
- 血站采血操作规范
- 学校“1530”安全教育记录表(2024年秋季全学期)
- DBJ50T-306-2018 建设工程档案编制验收标准
- 植物生物化学
- 产业研究报告-中国二手奢侈品行业发展现状、市场规模、投资前景分析(智研咨询)
评论
0/150
提交评论