Chapter 4 Examining the Specification.docx
- 文档编号:10283954
- 上传时间:2023-05-24
- 格式:DOCX
- 页数:13
- 大小:87.02KB
Chapter 4 Examining the Specification.docx
《Chapter 4 Examining the Specification.docx》由会员分享,可在线阅读,更多相关《Chapter 4 Examining the Specification.docx(13页珍藏版)》请在冰点文库上搜索。
Chapter4ExaminingtheSpecification
Chapter4.ExaminingtheSpecification
INTHISCHAPTER
∙GettingStarted
∙PerformingaHigh-LevelReviewoftheSpecification
∙Low-LevelSpecificationTestTechniques
Thischapterwillintroduceyoutoyourfirstrealhands-ontestingbutitmaynotbewhatyouexpect.Youwon'tbeinstallingorrunningsoftwareandyouwon'tbepoundingonthekeyboardhopingforacrash.Inthischapter,you'lllearnhowtotesttheproduct'sspecificationtofindbugsbeforetheymakeitintothesoftware.
Testingtheproductspecisn'tsomethingthatallsoftwaretestershavetheluxuryofdoing.Sometimesyoumightcomeintoaprojectmidwaythroughthedevelopmentcycleafterthespecificationiswrittenandthecodingstarted.Ifthat'sthecase,don'tworryyoucanstillusethetechniquespresentedheretotestthefinalspecification.
Ifyou'refortunateenoughtobeinvolvedontheprojectearlyandhaveaccesstoapreliminaryspecification,thischapterisforyou.Findingbugsatthisstagecanpotentiallysaveyourprojecthugeamountsoftimeandmoney.
Highlightsofthischapterinclude
∙Whatisblack-boxandwhite-boxtesting
∙Howstaticanddynamictestingdiffer
∙Whathigh-leveltechniquescanbeusedforreviewingaproductspecification
∙Whatspecificproblemsyoushouldlookforwhenreviewingaproductspecificationindetail
GettingStarted
ThinkbacktothefourdevelopmentmodelspresentedinChapter2,"TheSoftwareDevelopmentProcess":
big-bang,code-and-fix,waterfall,andspiral.Ineachmodel,exceptbig-bang,thedevelopmentteamcreatesaproductspecificationfromtherequirementsdocumenttodefinewhatthesoftwarewillbecome.
Typically,theproductspecificationisawrittendocumentusingwordsandpicturestodescribetheintendedproduct.AnexcerptfromtheWindowsCalculator(seeFigure4.1)productspecmightreadsomethinglikethis:
TheEditmenuwillhavetwoselections:
CopyandPaste.Thesecanbechosenbyoneofthreemethods:
pointingandclickingtothemenuitemswiththemouse,usingaccess-keys(Alt+EandthenCforCopyandPforPaste),orusingthestandardWindowsshortcutkeysofCtrl+CforCopyandCtrl+VforPaste.
TheCopyfunctionwillcopythecurrententrydisplayedinthenumbertextboxintotheWindowsClipboard.ThePastefunctionwillpastethevaluestoredintheWindowsClipboardintothenumbertextbox.
Figure4.1.ThestandardWindowsCalculatordisplayingthedrop-downEditmenu.
[Viewfullsizeimage]
Asyoucansee,ittookquiteafewwordsjusttodescribetheoperationoftwomenuitemsinasimplecalculatorprogram.Athoroughlydetailedspecfortheentireapplicationcouldbeahundredpageslong.
Itmayseemlikeoverkilltocreateameticulousdocumentforsuchsimplesoftware.Whynotjustletaprogrammerwriteacalculatorprogramonhisown?
Theproblemisthatyouwouldhavenoideawhatyou'deventuallyget.Theprogrammer'sideaofwhatitshouldlooklike,whatfunctionalityitshouldhave,andhowtheuserwoulduseitcouldbecompletelydifferentfromyours.Theonlywaytoassurethattheendproductiswhatthecustomerrequiredandtoproperlyplanthetesteffortistothoroughlydescribetheproductinaspecification.
Theotheradvantageofhavingadetailedspec,andthebasisofthischapter,isthatasatesteryou'llalsohaveadocumentasatestableitem.Youcanuseittofindbugsbeforethefirstlineofcodeiswritten.
Black-BoxandWhite-BoxTesting
Twotermsthatsoftwaretestersusetodescribehowtheyapproachtheirtestingareblack-boxtestingandwhite-boxtesting.Figure4.2showsthedifferencebetweenthetwoapproaches.Inblack-boxtesting,thetesteronlyknowswhatthesoftwareissupposedtodohecan'tlookintheboxtoseehowitoperates.Ifhetypesinacertaininput,hegetsacertainoutput.Hedoesn'tknowhoworwhyithappens,justthatitdoes.
Figure4.2.Withblack-boxtesting,thesoftwaretesterdoesn'tknowthedetailsofhowthesoftwareworks.
TIP
Black-boxtestingissometimesreferredtoasfunctionaltestingorbehavioraltesting.Don'tgetcaughtupinwhattheactualtermsare,asyourteammayusesomethingdifferent.It'syourjobtounderstandtheirmeaningandhowthey'reusedbyyourteam.
ThinkabouttheWindowsCalculatorshowninFigure4.1.Ifyoutype3.14159andpressthesqrtbutton,youget1.772453102341.Withblack-boxtesting,itdoesn'tmatterwhatgyrationsthesoftwaregoesthroughtocomputethesquarerootofpi.Itjustdoesit.Asasoftwaretester,youcanverifytheresultonanother"certified"calculatoranddetermineiftheWindowsCalculatorisfunctioningcorrectly.
Inwhite-boxtesting(sometimescalledclear-boxtesting),thesoftwaretesterhasaccesstotheprogram'scodeandcanexamineitforcluestohelphimwithhistestinghecanseeinsidethebox.Basedonwhathesees,thetestermaydeterminethatcertainnumbersaremoreorlesslikelytofailandcantailorhistestingbasedonthatinformation.
NOTE
Thereisarisktowhite-boxtesting.It'sveryeasytobecomebiasedandfailtoobjectivelytestthesoftwarebecauseyoumighttailortheteststomatchthecode'soperation.
StaticandDynamicTesting
Twoothertermsusedtodescribehowsoftwareistestedarestatictestinganddynamictesting.Statictestingreferstotestingsomethingthat'snotrunningexaminingandreviewingit.Dynamictestingiswhatyouwouldnormallythinkofastestingrunningandusingthesoftware.
Thebestanalogyforthesetermsistheprocessyougothroughwhencheckingoutausedcar.Kickingthetires,checkingthepaint,andlookingunderthehoodarestatictestingtechniques.Startingitup,listeningtotheengine,anddrivingdowntheroadaredynamictestingtechniques.
StaticBlack-BoxTesting:
TestingtheSpecification
Testingthespecificationisstaticblack-boxtesting.Thespecificationisadocument,notanexecutingprogram,soit'sconsideredstatic.It'salsosomethingthatwascreatedusingdatafrommanysourcesusabilitystudies,focusgroups,marketinginput,andsoon.Youdon'tnecessarilyneedtoknowhoworwhythatinformationwasobtainedorthedetailsoftheprocessusedtoobtainit,justthatit'sbeenboileddownintoaproductspecification.Youcanthentakethatdocument,performstaticblack-boxtesting,andcarefullyexamineitforbugs.
EarlieryousawanexampleofaproductspecificationfortheWindowsCalculator.Thisexampleusedastandardwrittendocumentwithapicturetodescribethesoftware'soperation.Althoughthisisthemostcommonmethodforwritingaspec,therearelotsofvariations.Yourdevelopmentteammayemphasizediagramsoverwordsoritmayuseaself-documentingcomputerlanguagesuchasAda.Whatevertheirchoice,youcanstillapplyallthetechniquespresentedinthischapter.Youwillhavetotailorthemtothespecformatyouhave,buttheideasarestillthesame.
Whatdoyoudoifyourprojectdoesn'thaveaspec?
Maybeyourteamisusingthebig-bangmodeloraloosecode-and-fixmodel.Asatester,thisisadifficultposition.Yourgoalistofindbugsearlyideallyfindingthembeforethesoftwareiscodedbutifyourproductdoesn'thaveaspec,thismayseemimpossibletodo.Althoughthespecmaynotbewrittendown,someone,orseveralpeople,knowwhatthey'retryingtobuild.Itmaybethedeveloper,aprojectmanager,oramarketer.Usethemasthewalking,talking,productspecandapplythesametechniquesforevaluatingthis"mental"specificationasthoughitwaswrittenonpaper.Youcaneventakethisastepfurtherbyrecordingtheinformationyougatherandcirculatingitforreview.
Tellyourprojectteam,"ThisiswhatIplantotestandsubmitbugsagainst."You'llbeamazedathowmanydetailsthey'llimmediatelyfillin.
TIP
Youcantestaspecificationwithstaticblack-boxtechniquesnomatterwhattheformatofthespecification.Itcanbeawrittenorgraphicaldocumentoracombinationofboth.Youcaneventestanunwrittenspecificationbyquestioningthepeoplewhoaredesigningandwritingthesoftware.
PerformingaHigh-LevelReviewoftheSpecification
Definingasoftwareproductisadifficultprocess.Thespecmustdealwithmanyunknowns,takeamultitudeofchanginginputs,andattempttopullthemalltogetherintoadocumentthatdescribesanewproduct.Theprocessisaninexactscienceandispronetohavingproblems.
Thefirststepintestingthespecificationisn'ttojumpinandlookforspecificbugs.Thefirststepistostandbackandviewitfromahighlevel.Examinethespecforlargefundamentalproblems,oversights,andomissions.Youmightconsiderthismoreresearchthantesting,butultimatelytheresearchisameanstobetterunderstandwhatthesoftwareshoulddo.Ifyouhaveabetterunderstandingofthewhysandhowsbehindthespec,you'llbemuchbetteratexaminingitindetail.
PretendtoBetheCustomer
Theeasiestthingforatestertodowhenhefirstreceivesaspecificationforreviewistopretendtobethecustomer.Dosomeresearchaboutwhothecustomerswillbe.Talktoyourmarketingorsalespeopletogethintsonwhattheyknowabouttheenduser.Iftheproductisaninternalsoftwareproject,findoutwhowillbeusingitandtalktothem.
It'simportanttounderstandthecustomer'sexpectations.Rememberthatthedefinitionofqualitymeans"meetingthecustomer'sneeds."Asatester,youmustunderstandthoseneedstotestthatthesoftwaremeetsthem.Todothiseffectivelydoesn'tmeanthatyoumustbeanexpertinthefieldofnuclearphysicsifyou'retestingsoftwareforapowerplant,orthatyoumustbeaprofessionalpilotifyou'retestingaflight
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Chapter Examining the Specification