下载
加入VIP
  • 专属下载特权
  • 现金文档折扣购买
  • VIP免费专区
  • 千万文档免费下载

上传资料

关闭

关闭

关闭

封号提示

内容

首页 计算器黑盒测试实验报告

计算器黑盒测试实验报告.doc

计算器黑盒测试实验报告

李贤思
2017-10-17 0人阅读 举报 0 0 暂无简介

简介:本文档为《计算器黑盒测试实验报告doc》,可适用于高等教育领域

计算器黑盒测试实验报告西南科技大学计算机学院实验报告实验名称计算器黑盒测试实验地点实验日期指导教师学生班级学生姓名学生学号提交日期软件教研室制一、测试目的设计测试用例、使用各种测试方法进行计算器的测试并对测试结果进行分析二、测试内容软件说明:实现一个小的计算器程序只需要完成加、减、乘、除运算设计测试用例并对测试结果进行分析同时计算器运行稳定。、设计测试用例、执行测试、测试结果分析、源代码三、测试步骤(一)、计算器界面、设计测试用例()等价类测试:、个等价类测试用例的分析过程如下:测试用例加减乘除预期输出整型*正常运算小数*正常运算负数()()*正常运算无效输入EtGkI*lFfse非法操作无法输入、对应测试的结果分析:整型:加()减()乘(*)除()小数加()减()乘(*)除()负数加减()()乘*除(其中算式写法错误导致正常运算错误)无效输入(加(Et):程序中无效数字无法正常输入程序无法进行。(减(Gk)程序中无效数字无法正常输入程序无法进行。(同上)(乘(I*l)程序中无效数字无法正常输入程序无法进行。(同上)(除(Ffse)程序中无效数字无法正常输入程序无法进行。(同上)(()边界值法设计测试:加法:、计算器个标准等价类测试用例的分析过程如下:测试用例被加数加数预期输出Test正常运算Test正常运算Test正常运算Test正常运算Test正常运算Test正常运算Test正常运算Test不能运算Test正常运算Test正常运算Test正常运算Test正常运算Test正常运算Test正常运算、对应测试与结果:测试结果运算均属正常对应的部分的示图如下:Test结果:Test结果:Test结果:Test结果:Test结果:Test结果:减法:、计算器个标准等价类测试用例的分析过程如下:测试用例被减数减数预期输出Test正常运算Test正常运算Test正常运算Test正常运算Test正常运算Test正常运算Test正常运算Test不能运算Test正常运算Test正常运算Test正常运算Test正常运算Test正常运算Test正常运算、对应测试与结果:测试结果运算均属正常对应的部分的示图如下:Test结果:Test结果:Test结果:Test结果:Test结果:乘法、计算器个标准等价类测试用例的分析过程如下:测试用例被乘数乘数预期输出Test正常运算Test正常运算Test正常运算Test正常运算Test正常运算Test正常运算Test正常运算Test不能运算Test正常运算Test正常运算Test正常运算Test正常运算Test正常运算Test正常运算、对应测试与结果:测试结果运算均属正常对应的部分的示图如下:Test结果:Test结果:Test结果:Test结果:Test结果:除法、计算器个标准等价类测试用例的分析过程如下:测试用例被除数除数预期输出Test正常运算Test正常运算Test正常运算Test正常运算Test正常运算Test正常运算Test正常运算Test正常运算Test正常运算Test正常运算Test正常运算Test正常运算Test正常运算Test正常运算、对应测试与结果:对应的部分的示图如下:Test结果:Test结果:Test结果:Test结果:附录:源代码CCalculateDlg::CCalculateDlg(CWnd*pParent*=*):CDialog(CCalculateDlg::IDD,pParent){{{AFXDATAINIT(CCalculateDlg)mparameter=}}AFXDATAINITNotethatLoadIcondoesnotrequireasubsequentDestroyIconinWinmhIcon=AfxGetApp()>LoadIcon(IDRMAINFRAME)CalculatePara=CalculateResult=Ispoint=falseSumpoint=}voidCCalculateDlg::DoDataExchange(CDataExchange*pDX){CDialog::DoDataExchange(pDX){{AFXDATAMAP(CCalculateDlg)DDXText(pDX,IDCEDIT,mparameter)}}AFXDATAMAP}BEGINMESSAGEMAP(CCalculateDlg,CDialog){{AFXMSGMAP(CCalculateDlg)ONWMSYSCOMMAND()ONWMPAINT()ONWMQUERYDRAGICON()ONBNCLICKED(IDCclear,Onclear)ONBNCLICKED(IDCcalculate,Oncalculate)ONBNCLICKED(IDCpara,Onpara)ONBNCLICKED(IDCpara,Onpara)ONBNCLICKED(IDCpara,Onpara)ONBNCLICKED(IDCpara,Onpara)ONBNCLICKED(IDCpara,Onpara)ONBNCLICKED(IDCpara,Onpara)ONBNCLICKED(IDCpara,Onpara)ONBNCLICKED(IDCpara,Onpara)ONBNCLICKED(IDCpara,Onpara)ONBNCLICKED(IDCpara,Onpara)ONBNCLICKED(IDCpoint,Onpoint)ONBNCLICKED(IDCminus,Onminus)ONBNCLICKED(IDCplus,Onplus)ONBNCLICKED(IDCsubtrack,Onsubtrack)ONBNCLICKED(IDCmultiply,Onmultiply)ONBNCLICKED(IDCdivide,Ondivide)}}AFXMSGMAPENDMESSAGEMAP()CCalculateDlgmessagehandlersBOOLCCalculateDlg::OnInitDialog(){CDialog::OnInitDialog()Add"About"menuitemtosystemmenuIDMABOUTBOXmustbeinthesystemcommandrangeASSERT((IDMABOUTBOXxFFF)==IDMABOUTBOX)ASSERT(IDMABOUTBOX<xF)CMenu*pSysMenu=GetSystemMenu(FALSE)if(pSysMenu!=){CStringstrAboutMenustrAboutMenuLoadString(IDSABOUTBOX)if(!strAboutMenuIsEmpty()){pSysMenu>AppendMenu(MFSEPARATOR)pSysMenu>AppendMenu(MFSTRING,IDMABOUTBOX,strAboutMenu)}}SettheiconforthisdialogTheframeworkdoesthisautomaticallywhentheapplication'smainwindowisnotadialogSetIcon(mhIcon,TRUE)SetbigiconSetIcon(mhIcon,FALSE)SetsmalliconTODO:AddextrainitializationherereturnTRUEreturnTRUEunlessyousetthefocustoacontrol}voidCCalculateDlg::OnSysCommand(UINTnID,LPARAMlParam){if((nIDxFFF)==IDMABOUTBOX){CAboutDlgdlgAboutdlgAboutDoModal()}else{CDialog::OnSysCommand(nID,lParam)}}Ifyouaddaminimizebuttontoyourdialog,youwillneedthecodebelowtodrawtheiconForMFCapplicationsusingthedocumentviewmodel,thisisautomaticallydoneforyoubytheframeworkvoidCCalculateDlg::OnPaint(){if(IsIconic()){CPaintDCdc(this)devicecontextforpaintingSendMessage(WMICONERASEBKGND,(WPARAM)dcGetSafeHdc(),)CentericoninclientrectangleintcxIcon=GetSystemMetrics(SMCXICON)intcyIcon=GetSystemMetrics(SMCYICON)CRectrectGetClientRect(rect)intx=(rectWidth()cxIcon)inty=(rectHeight()cyIcon)DrawtheicondcDrawIcon(x,y,mhIcon)}else{CDialog::OnPaint()}}ThesystemcallsthistoobtainthecursortodisplaywhiletheuserdragstheminimizedwindowHCURSORCCalculateDlg::OnQueryDragIcon(){return(HCURSOR)mhIcon}voidCCalculateDlg::Onclear(){UpdateData(true)mparameter=CalculatePara=CalculateResult=Ispoint=falseSumpoint=UpdateData(false)TODO:Addyourcontrolnotificationhandlercodehere}voidCCalculateDlg::Oncalculate(){UpdateData(true)CalculatePara=mparameterswitch(CalculateExpre){case'':CalculateResult=CalculateParamparameter=CalculateResultbreakcase'':CalculateResult=CalculateParamparameter=CalculateResultbreakcase'*':CalculateResult*=CalculateParamparameter=CalculateResultbreakcase'':if(CalculatePara){CalculateResult=CalculateParamparameter=CalculateResult}else{mparameter=MessageBox("除数不能为零!")}break}TODO:AddyourcontrolnotificationhandlercodehereCalculatePara=CalculateResult=Ispoint=falseSumpoint=UpdateData(false)}voidCCalculateDlg::Onpara(){UpdateData(true)if(!Ispoint){CalculatePara=mparameter*}else{CalculatePara=mparameterpow(,Sumpoint)Sumpoint}mparameter=CalculateParaUpdateData(false)TODO:Addyourcontrolnotificationhandlercodehere}voidCCalculateDlg::Onpara(){UpdateData(true)if(!Ispoint){CalculatePara=mparameter*}else{CalculatePara=mparameterpow(,Sumpoint)Sumpoint}mparameter=CalculateParaUpdateData(false)TODO:Addyourcontrolnotificationhandlercodehere}voidCCalculateDlg::Onpara(){UpdateData(true)if(!Ispoint){CalculatePara=mparameter*}else{CalculatePara=mparameterpow(,Sumpoint)Sumpoint}mparameter=CalculateParaUpdateData(false)TODO:Addyourcontrolnotificationhandlercodehere}voidCCalculateDlg::Onpara(){UpdateData(true)if(!Ispoint){CalculatePara=mparameter*}else{CalculatePara=mparameterpow(,Sumpoint)Sumpoint}mparameter=CalculateParaUpdateData(false)TODO:Addyourcontrolnotificationhandlercodehere}voidCCalculateDlg::Onpara(){UpdateData(true)if(!Ispoint){CalculatePara=mparameter*}else{CalculatePara=mparameterpow(,Sumpoint)Sumpoint}mparameter=CalculateParaUpdateData(false)TODO:Addyourcontrolnotificationhandlercodehere}voidCCalculateDlg::Onpara(){UpdateData(true)if(!Ispoint){CalculatePara=mparameter*}else{CalculatePara=mparameterpow(,Sumpoint)Sumpoint}mparameter=CalculateParaUpdateData(false)TODO:Addyourcontrolnotificationhandlercodehere}voidCCalculateDlg::Onpara(){UpdateData(true)if(!Ispoint){CalculatePara=mparameter*}else{CalculatePara=mparameterpow(,Sumpoint)Sumpoint}mparameter=CalculateParaUpdateData(false)TODO:Addyourcontrolnotificationhandlercodehere}voidCCalculateDlg::Onpara(){UpdateData(true)if(!Ispoint){CalculatePara=mparameter*}else{CalculatePara=mparameterpow(,Sumpoint)Sumpoint}mparameter=CalculateParaUpdateData(false)TODO:Addyourcontrolnotificationhandlercodehere}voidCCalculateDlg::Onpara(){UpdateData(true)if(!Ispoint){CalculatePara=mparameter*}else{CalculatePara=mparameterpow(,Sumpoint)Sumpoint}mparameter=CalculateParaUpdateData(false)TODO:Addyourcontrolnotificationhandlercodehere}voidCCalculateDlg::Onpara(){UpdateData(true)if(!Ispoint){CalculatePara=mparameter*}else{Sumpoint}mparameter=CalculateParaUpdateData(false)TODO:Addyourcontrolnotificationhandlercodehere}voidCCalculateDlg::Onpoint(){Ispoint=trueSumpoint=TODO:Addyourcontrolnotificationhandlercodehere}voidCCalculateDlg::Onminus(){UpdateData(true)mparameter=mparameterUpdateData(false)TODO:Addyourcontrolnotificationhandlercodehere}voidCCalculateDlg::Onplus(){UpdateData(true)CalculateResult=mparameterCalculateExpre=''mparameter=Ispoint=falseSumpoint=UpdateData(false)TODO:Addyourcontrolnotificationhandlercodehere}voidCCalculateDlg::Onsubtrack(){UpdateData(true)CalculateResult=mparameterCalculateExpre=''mparameter=Ispoint=falseSumpoint=UpdateData(false)TODO:Addyourcontrolnotificationhandlercodehere}voidCCalculateDlg::Onmultiply(){UpdateData(true)CalculateResult=mparameterCalculateExpre='*'mparameter=Ispoint=falseSumpoint=UpdateData(false)TODO:Addyourcontrolnotificationhandlercodehere}voidCCalculateDlg::Ondivide(){UpdateData(true)CalculateResult=mparameterCalculateExpre=''mparameter=Ispoint=falseSumpoint=UpdateData(false)TODO:Addyourcontrolnotificationhandlercodehere}

用户评价(0)

关闭

新课改视野下建构高中语文教学实验成果报告(32KB)

抱歉,积分不足下载失败,请稍后再试!

提示

试读已结束,如需要继续阅读或者下载,敬请购买!

文档小程序码

使用微信“扫一扫”扫码寻找文档

1

打开微信

2

扫描小程序码

3

发布寻找信息

4

等待寻找结果

我知道了
评分:

/27

计算器黑盒测试实验报告

VIP

在线
客服

免费
邮箱

爱问共享资料服务号

扫描关注领取更多福利