欢迎来到淘文阁 - 分享文档赚钱的网站! | 帮助中心 好文档才是您的得力助手!
淘文阁 - 分享文档赚钱的网站
全部分类
  • 研究报告>
  • 管理文献>
  • 标准材料>
  • 技术资料>
  • 教育专区>
  • 应用文书>
  • 生活休闲>
  • 考试试题>
  • pptx模板>
  • 工商注册>
  • 期刊短文>
  • 图片设计>
  • ImageVerifierCode 换一换

    软件测试实验报告二.docx

    • 资源ID:97950485       资源大小:31.44KB        全文页数:12页
    • 资源格式: DOCX        下载积分:15金币
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录   QQ登录  
    二维码
    微信扫一扫登录
    下载资源需要15金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    软件测试实验报告二.docx

    南昌航空大学实验报告2012年12月14日课程名称:软件测试与质量保证实验名称:功能性测试班级:姓名:同组人:指导教师评定:签名:一、实验目的掌握边界值、等价类和决策表测试的基本方法二、实验内容1、设计三角形问题的边界值测试用例2、对于nextdate函数设计决策表测试用例程序3、对于佣金问题设计出等价类测试用例三、概要设计1、设计三角形问题的边界值测试用例设计等价类Ri=a,b,c:有三条边a,b和c的等边三角形R2=a,b,c:有三条边a,b和c的等腰三角形R3=a,b,c:有三条边a,b和c的不等边三角形R4=a,b,c:三条边a,b和c不构成三角形2、对于nextdate函数设计决策表测试用例程序设计如下的等价类:M1=月份:每月有30天M3=月份:此月是12月M2=月份:每月有31天,12月除外M4=月份:此月是2月D1=日期:1W日期W27D2=日期:日期=28D3=日期:日期=29D5=日期:日期=30D4=日期:日期=30丫1=年:年是闰年丫2=年:年不是闰年3、对于佣金问题设计出等价类测试用例设计如下等价类:L1=枪机:1W枪机W70|_2=枪机=-1S1=枪托:1W枪托W80B1=枪管:1W枪管W90输入变量对应的无效类是:L3=枪机:枪机=0或枪机v-1L3=枪机:枪机70S2=枪托:枪托1S3=枪托:枪托80B2=枪管:枪管v1B2=枪管:枪管90四、详细设计1、设计三角形问题的边界值测试用例边界值分析测试用例:用例abc预期输出11001001等腰三角形21001002等腰三角形3100100100等边三角形4100100199等腰三角形5100100200非三角形61001100等腰三角形71002100等腰三角形8100100100等边三角形9100199100等腰三角形10100200100非三角形111100100等腰三角形122100100等腰三角形13100100100等边三角形14199100100等腰三角形15200100100非三角形2、对于nextdate函数设计决策表测试用例程序设计如下的决策表测试用例:月例工D刀俗日期年预期输出1 341520012001 年416 日44302001200 1年5月1曰54312001不可髓691152001200 1年1月16日1 O13120012001 ¥2 月 1 口1 1 1 41 21520012001 年1 2 月 1 6 口1 51 23120012002年1日1日1621520012001年2月16日1722820042004年2 月 29 日1822820012001年3月1日1922920042004年3 J3 1 日202292001不可也21 , 222302001为、口J育旨3、对于佣金问题设计出等价类测试用例设计如下等价类测试用例用例ID枪机枪托枪管预期输出SRI-14045枪机值不在有效值域1.70中SR235-145枪托值不在有效值域1.80中SR33540-1枪管值不在有效值域1.90中SR4-1-145枪机值不在有效值域1.70中枪托值不在有效值域L.80中SR5-140-1枪机值不在有效值域1.70中枪管值不在有效值域1.90中SR635-1-1枪托值不在有效值域1.80中枪管值不在有效值域1.90中SR7-1-1-1枪机值不在有效值域1.70中枪托值不在有效值域L.80中枪管值不在有效值域1.90中五、程序调试1、设计三角形问题的边界值测试用例 实验结果如下:The experiment result is.Isosceles triangele?Isosceles triangele?Equailateral triangle?Isosceles triangele?Not a triangle?Isosceles triangele?Isosceles triangele?Equailateral triangle?Isosceles triangele?Not a triangle?Isosceles triangele?Isosceles triangele?Equailateral triangle?Isosceles triangele?Not a triangle?After compared with the expected results15 is right,0 is wrong2、对于nextdate函数设计决策表测试用例程序 实验结果如下:Please input todayJ s 4 15 2001 Tomorrow date is 4 Please input today's 4 31 2001The date is wrong? Please input today's 4 31 2001 the date is wrong? Please input today's 1 15 2001TomorrowJ s date is 1 Please input today's 1 31 2001Tomorrow,s date is 2 Please input today, s 12 15 2001date is from16 2001date is fromdate is fromdate is from16 2001date is from1 2001date is fromMMMMMMMMMMMMDD VVVV.DD VVVV.DD VVVV.DD VVVV.DD VVVV.DD VVVV.Tomorrow's date is 12 16 2001Please input todaydate is from MM DD VVVV.12 31 2001Tomorrow , s date is 1 Please input today,s 2 15 2001Tomorrow,s date is 2 Please input today's 2 28 2004Tomorrow's date is 2 Please input today's 2 28 2001Tomorrowdate is 3 Please input today's 2 29 2004Tomorrow's date is 3 Please input today s 2 29 2001The date is wrong?Please input today's 2 30 2001The date is wrong?1 2002 date is16 2001date is29 2004date is1 2001 date is1 2004 date isdate isfromfromfromfromfromfromMMDDVVVV.MMDDVVVV.MMDDVVVV.MMDDVVVV.MMDDMMDDVVVV.3、对于佣金问题设计出等价类测试用例 实验结果如下:Please input locksJ number.-1Locks sold:0Stocks sold:0Barrels sold:0The sales:0.000000Commission is $0.000000Please input locks' number.35Please input stocksJ and barrelsJ number.-145Please input the locks' number.-1Locks sold:35Stocks sold:-lBarrels sold:45The sales:2670.000000Commission is $394.000000Please input locksJ number.Please input stocksJ and barrels9 number. .Please input the locksJ number.Locks sold:35Stocks sold40Barrels sold:-lThe sales:2750.000000Commission is $410,000000Please input locks * number.Locks sold:0Stocks sold:0Barrels sold:0The sales:0.000000Commission is $0.000000六、实验总结通过这次实验,让我掌握边界值、等价类和决策表测试的基本方法。七、附录TRIANGLE. C#include<stdio. h> void main ()int flag15 = 3,3, 2,3, 5,3, 3,2, 3,5, 3,3, 2, 3, 5,a15 = 100, 100,100,100,100,100,100,100, 100,100,1, 2, 100,199, 200,b15 = 100, 100,100,100,100,1, 2,100,199, 200,100,100, 100,100, 100,c15 = l, 2, 100,199,200,100,100,100,100, 100,100,100, 100,100, 100;int i,j=0;printf The experiment resultis.n);for(i=0;i<15;i+) if(isTriangle(ai, bi, ci)=flagi)j+;printf (resultsn);After compared with the expectedprintf (,z%d is right, %d is wrongn,z, j, 15j);int isTriangle(int a,int b,int c)(int flag;if(a<b+c && b<a+c && c<a+b)flag=l;elseflag=0;if (flag=l)(if(a=b && b=c)flag=2;printf (z,Equailateral triangle!nz,);else if (a!=b && b!=c && a!=c) flag=4;printf (z,Scalene triangle!n,z);else flag=3;printf (''Isosceles triangele! n,z);else flag=5;printf (/zNot a triangle!n,");)return flag;)DATE. C#include<stdio.h>void main()(int tomorrowDay, tomorrowMonth, tomorrowYear, day, month, year; 设置 程序需要的变量printf (''Please input today's date is from MM DD YYYY. n); scanf("%d %d %d,femonth, &day, feyear);switch (month) 通过switch来选择不同的月份下的情况case 1:case 3:case 5:case 7:case 8:case 10:上面的月份都是31天的,下面代码实现31天情况下的月份if(day<31) tomorrowDay=day+l;t omorrowMon t h=mon t h;tomorrowY ear=year;else(tomorrowDay=l;tomorrowMonth=month+l;tomorrowY ear=year;break;case 4:case 6:case 9:case 11:上面的月份都是30天的,下面代码实现30天情况下的月份 if(day<30)(tomorrowDay=day+l;tomorrowMonth=month;tomorrowYear=year;)elsetomorrowDay=l;tomorrowMonth=month+l;tomorrowYear=year;break;case 12:/由于12月一过,年份要加一,故单独把12月拿出if (day<31)(tomorrowDay=day+l;tomorrowMonth=month;tomorrowY ear=year;else(tomorrowDay=l;tomorrowMonth=l;if(year=2012) printf (,zThe 2012 is over!n/z);exit (0);elsetomorrowYear=year+l;break;case 2:根据是否闰年来判断二月的天数,故把二月单独拿出来 if(day<28)(tomorrowDay=day+l;tomorrowMonth=month+l;tomorrowYear=year+l;)else if (day=28)(if (year/4=0 && year/100!=0) | | year/400=0) tomorrowDay=29;tomorrowMonth=month;tomorrowYear=year;else(tomorrowDay=l;tomorrowMonth=3;tomorrowYear=year;else if (day=29) (tomorrowDay=l;tomorrowMonth=3; tomorrowYear=year;)else printf (,zFeb can not have %d dayn,day);)printf("Tomorrow'sdateis %d %d %dn,tomorrowMonth, tomorrowDay, tomorrowYear);)COMMISSI. C#include<stdio. h> void main () (int locks,stocks, barrels;float lockPrice,stockPrice, barrelPrice;int totalLocks, totalStocks, totalBarrels;float lockSales,stockSales, barrelSales; float sales, commission;lockPrice=45. 0;stockPrice=30. 0;barrelPrice=25. 0;totalLocks=0;totalStocks=0;totalBarrels=0;printf ("Please input locks, number. n/z); scanf (%d, &locks);while(locks!=-1)(printf C'Please input stocks' and barrels' number. . n/z); scanf (z,%d %d,z, festocks, febarrels);totalLocks=totalLocks+locks; totalStocks=totalStocks+stocks; totalBarrels=totalBarrels+barrels;printf (,zPlease input the locks, number. nz,); scanf(%d, felocks);printf (''Locks sold:%dnz,, totalLocks);printf (,zStocks sold:%dn,totalStocks);printf (,zBarrels sold:%dn,totalBarrels);lockSales=lockPrice*totalLocks;stockSales=stockPrice*totalStocks;barrelSales=barrelPrice5ictotalBarrels;sales=lockSales+stockSales+barrelSales; printf (z,The sales:%fnz,, sales);if (sales>1800. 0)(commission. 10*1000. 0;commission=comniission+0. 15*800. 0;commission=commission+0. 20*(sales-1800. 0);)else if (sales>1000. 0)(commission. 10*1000. 0;commission=commission+0 15*(sales-1000. 0);)elseconunission=0. 10*sales;printf (''Commission is commission);

    注意事项

    本文(软件测试实验报告二.docx)为本站会员(太**)主动上传,淘文阁 - 分享文档赚钱的网站仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知淘文阁 - 分享文档赚钱的网站(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于淘文阁 - 版权申诉 - 用户使用规则 - 积分规则 - 联系我们

    本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

    工信部备案号:黑ICP备15003705号 © 2020-2023 www.taowenge.com 淘文阁 

    收起
    展开