How to Write Better Test CasesWord下载.docx
《How to Write Better Test CasesWord下载.docx》由会员分享,可在线阅读,更多相关《How to Write Better Test CasesWord下载.docx(22页珍藏版)》请在冰豆网上搜索。
Whatriskwouldimpelyoutoinvestinbettertestcases?
Aslongastheycoverthesoftwarerequirements,isn'
tthatgoodenough?
Theanswertothesequestionsisthatpoortestcasesdoindeedexposeyoutoconsiderablerisk.Theymaycovertherequirementsintheory,butarehardtotestandhaveambiguousresults.Bettertestshavemorereliableresultsaswellasloweringcostsinthreecategories:
改进测试用例的价值在哪?
什么样的风险鼓舞着你投资更好的测试用例?
只要覆盖了软件需求就足够好了?
这些问题是答案是不好的测试用例的的确确会暴露相当大的风险。
理论上他们可能覆盖了需求,但是他们难以执行而且得出的含糊的结果。
更优秀的测试用例可以得出更可信的结果还节约了以下三种的成本:
1.Productivity-lesstimetowriteandmaintaincases
1,生产效率–用更少的时间去编写和维护用例
2.Testability-lesstimetoexecutethem
2,易测性-更少的执行时间
3.Schedulingreliability-betterreliabilityinestimates
3,可靠的安排-估算起来更可靠
Thispaperdescribeshowtoavoidthelossesthatareinevitablewithpoortestcases.Itwilllookunderthehoodofdifferentkindsoftestcasesandshowwhereandhowtobuildinthequalitythatcontrolsrisk.Itwillgivepracticaladviceonhowtoimproveproductivity,usability,schedulingreliability,andassetmanagement.Onceyouunderstandthewhatsandwhysoftestcases,youcanuseachecklistofstandards,liketheoneattachedasAppendixA,toidentifyareasofriskandimproveyourcurrentanfuturetestcases.
这篇论文描述了如何预防使用不好的测试用例造成的不可避免的损失。
他将探寻使用不同种类的测试用例的情况并且说明何时何地构建控制风险质量。
他将给如何提高生产效率、可用性、可靠的计划、资产管理给出可行的建议
Themostextensiveeffortinpreparingtotestsoftwareiswritingtestcases.Theincentivetobuildrobust
testcasesisspurredbythelikelihoodtheywillbereusedformaintenancereleases.Overhalfofall
softwaredevelopmentismaintenanceprojects.Howcanyouwritequalitytestcasesthatwilldeliver
economicaltestingthefirsttimeplusliveagainasregressiontests?
Let'
sgetstartedwiththeanswerby
liftingthehoodofatestcaseandlookingatwhat'
sinside.
Lookinginsidetestcases
Elementsoftestcases
Forourpurposes,atestcaseisasetofactionswithexpectedresultsbasedonrequirementsforthe
system.Thecaseincludestheseelements:
·
Thepurposeofthetestordescriptionofwhatrequirementisbeingtested
Themethodofhowitwillbetested
Thesetuptotest:
versionofapplicationundertest,hardware,software,operatingsystem,datafiles,
securityaccess,timeofday,logicalorphysicaldate,prerequisitessuchasothertests,andany
anotherothersetupinformationpertinenttotherequirement(s)beingtested
Actionsandexpectedresults,orinputsandoutputs
Anyproofsorattachments(optional)
Thesesameelementsneedtobeintestcasesforeveryleveloftesting--unit,integration,system,or
acceptancetesting.Theyarevalidforfunctional,performance,andusabilitytesting.The"
expected
results"
standarddoesnotapplytodiagnosticorothertestingofanexploratorynature.Evendiagnostic
testingneedstheotherelementsinitscases.However,ifthetestmeasuresperformancethatshouldfall
inarange,thisisanexpectedresult.
Analternatedescriptionoftestcasesisthatthedescription,purpose,andsetupisthecaseor
specification.Thestepstoaccomplishitarecalledascript.Yetanotherviewcallsthepurposeor
descriptionascenarioorusecase.Theseviewsareallcompatiblewiththequalityassessmentsand
improvementssuggestedinthispaper.
Qualityoftestcases
Thereisamisconceptionthatqualityofwritingissubjective,likelookingatapainting,wherebeautyisin
theeyeofthebeholder.Infact,qualityofwritingisobjectiveandmeasurable.Itissimpletosetupan
objectivechecklist,liketheoneinAppendixA,ofthestructuralelementsoftestcases--purpose,
DianneL.RunnelsHowtowritebettertestcasesPage2of12
method,setup,inputsandoutputs.Thenwalkthougheachcase.Istheelementthereornot?
Inaddition
totheirstructure,thecasesmustalsomeetthesestandardsofquality:
Accurate.Theytestwhattheirdescriptionssaytheywilltest.
Economical.Theyhaveonlythestepsorfieldsneededfortheirpurpose.Theydon'
tgiveaguidedtourof
thesoftware.
Repeatable,selfstanding.Atestcaseisacontrolledexperiment.Itshouldgetthesameresultsevery
timenomatterwhotestsit.Ifonlythewritercantestitandgettheresult,orIfthetestgetsdifferent
resultsfordifferenttesters,itneedsmoreworkinthesetuporactions.
Appropriate.Atestcasehastobeappropriateforthetestersandenvironment.Ifitistheoreticallysound
butrequiresskillsthatnoneofthetestershave,itwillsitontheshelf.Evenifyouknowwhoistestingthe
firsttime,youneedtoconsiderdowntheroad--maintenanceandregression.
Traceable.Youhaveto