欢迎来到天天文库
浏览记录
ID:46944209
大小:2.04 MB
页数:8页
时间:2019-11-30
《软件测试题目与答案》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、软件测试课堂测验第一次测验:ConsideranapplicationAppthattakestwoinputsnameandage,wherenameisanonemptystringcontainingatmost20alphabeticcharactersandageisanintegerthatmustsatisfytheconstraint0≤age≤120.TheAppisrequiredtodisplayanerrormessageiftheinputvalueprovidedforageisoutofr
2、ange.Theapplicationtruncatesanynamethatismorethan20-characterinlengthandgeneratesanerrormessageifanemptystringissuppliedforname.(1)Pleasefindouttheequivalenceclasses(等价类).(30分)(2)Constructtestcasesusingtheequivalenceclassesderivedin(1)(20分)答案:Consideramethodfp,b
3、riefforfindPrice,thattakestwoinputscodeandqty.Theitemcodeisrepresentedbytheintegercodeandthequantitypurchasedbyanotherintegervariableqty.fpaccessesadatabasetofindanddisplaytheunitprice,thedescription,andthetotalpriceoftheitemcorrespondingtocode.fpisrequiredtodis
4、playanerrormessage,andreturn,ifeitherofthetwoinputsisincorrect.Assumingthatanitemcodemustbeintherange99…999andquantityintherange1…100.Pleasegiveyourtestcasesusingboundary-valueanalysis.(50分)答案:第二次:1.DevelopadecisiontableforthedescriptionsbelowNochargesarereimbur
5、sed(报销)tothepatientuntilthedeductible(扣除)hasbeenmet.Afterthedeductiblehasbeenmet,theamounttobereimburseddependsonwhetherornotthedoctororhospitalisa"PreferredProvider."ForpreferredprovidersDoctor'sofficevisitsarereimbursedat65%andHospitalvisitsarereimbursedat95%.
6、Forotherprovidersreimburse50%forDoctor'sOfficevisitsor80%forHospitalvisits.答案:2.DevelopadecisiontablefortheYesterDatefunction.答案:第三次:Cause-EffectTesting:Inagivennetwork,thesendfilecommandisusedtosendafiletoauseronadifferentfileserver.Thesendfilecommandtakesthree
7、arguments:thefirstargumentshouldbeanexistingfileinthesender’shomedirectory,thesecondargumentshouldbethenameofthereceiver’sfileserver,andthethirdargumentshouldbethereceiver’suserid.Ifalltheargumentsarecorrect,thenthefileissuccessfullysent;otherwisethesenderobtain
8、sanerrormessage.答案:中国象棋走马下法:1.如果落点在棋盘外,则不移动棋子;2.如果落点与起点不构成日字形,则不移动棋子;3.如果落点处有自己放棋子,则不移动棋子;4.如果在落点方向的邻近交叉点有棋子(绊马腿),则不移动棋子;5.如果不属于1-4,且落点处无棋子,则移动棋子;6.如果不属于1-4,且落点处为对方棋子
此文档下载收益归作者所有