A Practitioner's Guide To Software Design @Team LiB 11 By Lee Copeland

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 355 [warning: Documents this large are best viewed by clicking the View PDF Link!]

APractitioner'sGuidetoSoftwareTestDesign
byLeeCopeland ISBN:158053791x
ArtechHouse©2004
Thistextpresentsalltheimportanttestdesigntechniquesinasingle
placeandinaconsistent,andeasy-to-digestformat.Itenablesyouto
choosethebesttestcasedesign,findsoftwaredefects,developoptimal
strategies,andmore.
TableofContents
APractitioner'sGuidetoSoftwareTestDesign
Preface
Chapter1 - TheTestingProcess
Chapter2 - CaseStudies
SectionI-BlackBoxTestingTechniques
Chapter3 - EquivalenceClassTesting
Chapter4 - BoundaryValueTesting
Chapter5 - DecisionTableTesting
Chapter6 - PairwiseTesting
Chapter7 - State-TransitionTesting
Chapter8 - DomainAnalysisTesting
Chapter9 - UseCaseTesting
SectionII-WhiteBoxTestingTechniques
Chapter10 - ControlFlowTesting
Chapter11 - DataFlowTesting
SectionIII-TestingParadigms
Chapter12 - ScriptedTesting
Chapter13 - ExploratoryTesting
Chapter14 - TestPlanning
SectionIV-SupportingTechnologies
Chapter15 - DefectTaxonomies
Chapter16 - WhentoStopTesting
SectionV-SomeFinalThoughts
AppendixA - Brown&DonaldsonCaseStudy
AppendixB - StatelessUniversityRegistrationSystemCaseStudy
Bibliography
Index
ListofFigures
ListofTables
ListofExamples
BackCover
Here’sacomprehensive,up-to-dateandpracticalintroductiontosoftwaretest
design.Thisinvaluablebookpresentsalltheimportanttestdesigntechniquesina
singleplaceandinaconsistent,andeasy-to-digestformat.Animmediatelyuseful
handbookfortestengineers,developers,qualityassuranceprofessionals,and
requirementsandsystemsanalysts,itenablesyouto:choosethebesttestcase
design,findsoftwaredefectsinlesstimeandwithfewerresources,anddevelop
optimalstrategiesthathelpreducethelikelihoodofcostlyerrors.Italsoassistsyou
inestimatingtheeffort,timeandcostofgoodtesting.
Numerouscasestudiesandexamplesofsoftwaretestingtechniquesareincluded,
helpingyoutofullyunderstandthepracticalapplicationsofthesetechniques.From
well-establishedtechniquessuchasequivalenceclasses,boundaryvalueanalysis,
decisiontables,andstate-transitiondiagrams,tonewtechniqueslikeusecase
testing,pairwisetesting,andexploratorytesting,thebookisanindispensable
resourcefortestingprofessionalsseekingtoimprovetheirskillsandanexcellent
referenceforcollege-levelcoursesinsoftwaretestdesign.
AbouttheAuthor
LeeCopelandisaninternationallyknownconsultantinsoftwaretesting,withover
30yearsofexperienceasaninformationsystemsprofessional.Hehashelda
numberoftechnicalandmanagerialpositionswithcommercialandnonprofit
organizationsintheareasofsoftwaredevelopment,testing,andprocess
improvement.Hehastaughtseminarsandconsultedextensivelythroughoutthe
UnitedStatesandinternationally.
APractitioner'sGuidetoSoftwareTestDesign
LeeCopeland
ArtechHousePublishers
Boston•London
LibraryofCongressandBritishCIPinformationavailableonrequest685CantonStreet
Norwood,MA02062
(781)769-9750
www.artechhouse.com
46GillinghamStreet
LondonSW1V1AH
+44(0)207596-8750
Copyright©2004STQEPublishing
Allrightsreserved.Nopartofthisbookshallbereproduced,storedinaretrievalsystem,or
transmittedbyanymeans,electronic,mechanical,photocopying,recording,orotherwise
withoutwrittenpermissionfromthepublisher.
InternationalStandardBookNumber:1-58053-791-X
PrintedintheUnitedStatesofAmerica
FirstPrinting:November2003
Trademarks
Alltermsmentionedinthisbookthatareknowntobetrademarksorservicemarkshavebeen
appropriatelycapitalized.ArtechHousePublishersandSTQEPublishingcannotattesttothe
accuracyofthisinformation.Useofaterminthisbookshouldnotberegardedasaffectingthe
validityofanytrademarkorservicemark.
WarningandDisclaimer
Everyefforthasbeenmadetomakethisbookascompleteandaccurateaspossible,butno
warrantyorfitnessisimplied.Theinformationprovidedisonan"asis"basis.Theauthorsand
thepublishershallhaveneitherliabilitynorresponsibilitytoanypersonorentitywithrespectto
anylossordamagesarisingfromtheinformationcontainedinthisbook.
Dedication
TomywifeSuzanne,andourwonderfulchildrenandgrandchildren
ShawnandMartha
AndrewandCassandra
David
Cathleen
KatelynnandKiley
MelissaandJay
Ross,Elizabeth,andMiranda
BrianandHeather
CassidyandCaden
ThomasandJeni
Carrie
Sundari
Rajan
andtoWayne,Jerry,Dani,Ron,andRayannefortheirencouragementovertheyears.
LeeCopelandisaninternationallyknownconsultantinsoftwaretesting,withover30yearsof
experienceasaninformationsystemsprofessional.Hehasheldanumberoftechnicaland
managerialpositionswithcommercialandnonprofitorganizationsintheareasofsoftware
development,testing,andprocessimprovement.Hehastaughtseminarsandconsulted
extensivelythroughouttheUnitedStatesandinternationally.
AsaconsultantforSoftwareQualityEngineering,Leetravelstheworldpromotingeffective
softwaretestingtohisclients.Inaddition,heistheprogramchairforSTAREASTand
STARWEST,theworld'spremierconferencesonsoftwaretesting.
Preface
APractitioner'sGuidetoSoftwareTestDesigncontainstoday'simportantcurrenttestdesign
approachesinoneuniquebook.Untilnow,softwaretestershadtosearchthroughanumberof
books,periodicals,andWebsitestolocatethisvitalinformation.
ImportanceofTestDesign
"Theactofcareful,complete,systematic,testdesignwillcatchasmanybugsastheact
oftesting....Personally,Ibelievethatit'sfarmoreeffective."
-BorisBeizer
Thebookfocusesonlyonsoftwaretestdesign,notrelatedsubjectssuchastestplanning,test
management,testteamdevelopment,etc.Whilethoseareimportantinsoftwaretesting,they
haveoftenovershadowedwhattestersreallyneed—themorepracticalaspectsoftesting,
specificallytestcasedesign.Otherexcellentbookscanguideyouthroughtheoverallprocess
ofsoftwaretesting.OneofmyfavoritesisSystematicSoftwareTestingbyRickCraigand
StefanJaskiel.
APractitioner'sGuidetoSoftwareTestDesignillustrateseachtestdesignapproachthrough
detailedexamplesandstep-by-stepinstructions.Theseleadthereadertoaclear
understandingofeachtestdesigntechnique.
Today'sTestingChallenges
Foranysystemofinterestingsizeitisimpossibletotestallthedifferentlogicpathsandallthe
differentinputdatacombinations.Oftheinfinitenumberofchoices,eachoneofwhichisworthy
ofsomeleveloftesting,testerscanonlychooseaverysmallsubsetbecauseofresource
constraints.Thepurposeofthisbookistohelpyouanalyze,design,andchoosesuchsubsets,
toimplementthoseteststhataremostlikelytodiscoverdefects.
Itisvitaltochoosetestcaseswisely.Missingadefectcanresultinsignificantlossestoyour
organizationifadefectivesystemisplacedintoproduction.
APractitioner'sGuidetoSoftwareTestDesigndescribesasetofkeytestdesignstrategies
thatimproveboththeefficiencyandeffectivenessofsoftwaretesters.
StructureandApproach
APractitioner'sGuidetoSoftwareTestDesignexplainsthemostimportanttestdesign
techniquesinusetoday.Someofthesetechniquesareclassicsandwellknownthroughoutthe
testingcommunity.Somehavebeenaroundforawhilebutarenotwellknownamongtest
engineers.Stillothersarenotwidelyknown,butshouldbebecauseoftheireffectiveness.This
bookbringstogetherallthesetechniquesintoonevolume,helpingthetestdesignerbecome
moreefficientandeffectiveintesting.
Eachtestdesigntechniqueisapproachedfromapractical,ratherthanatheoreticalbasis.
Eachtestdesigntechniqueisfirstintroducedthroughasimpleexample,thenexplainedindetail.
Whenpossible,additionalexamplesofitsusearepresented.Thetypesofproblemsonwhich
theapproachcanbeused,alongwithitslimitations,aredescribed.Eachtestdesigntechnique
chapterendswithasummaryofitskeypoints,alongwithexercisesthereadercanusefor
practice,andreferencesforfurtherreading.Testerscanusethetechniquespresented
immediatelyontheirprojects.
ANotefromtheAuthor
Iloveagooddoubleintegralsign
asmuchasthenexttester,butwe'regoingtoconcentrateonthepractical,notthe
theoretical.
Eachtestdesignapproachisdescribedinaself-containedchapter.Becausethechaptersare
focused,concise,andindependenttheycanberead"outoforder."Testerscanreadthe
chaptersthataremostrelevanttotheirworkatthemoment.
Audience
Thisbookwaswrittenspecificallyfor:
Softwaretestengineerswhohavetheprimaryresponsibilityfortestcasedesign.This
bookdetailsthemostefficientandeffectivemethodsforcreatingtestcases.
Softwaredeveloperswho,withtheadventofExtremeProgrammingandotheragile
developmentmethods,arebeingaskedtodomoreandbettertestingofthesoftware
theywrite.Manydevelopershavenotbeenexposedtothedesigntechniques
describedinthisbook.
Testanddevelopmentmanagerswhomustunderstand,atleastinprinciple,thework
theirstaffperforms.Notonlydoesthisbookprovideanoverviewofimportanttest
designmethods,itwillassistmanagersinestimatingtheeffort,time,andcostofgood
testing.
Qualityassuranceandprocessimprovementengineerswhoarechargedwithdefining
andimprovingtheirsoftwaretestingprocess.
Instructorsandprofessorswhoaresearchingforanexcellentreferenceforacoursein
softwaretestdesigntechniques.
Appreciation
Thefollowingreviewershaveprovidedinvaluableassistanceinthewritingofthisbook:Anne
Meilof,ChuckAllison,DalePerry,DannyFaught,DorothyGraham,GeoffQuentin,James
Bach,JonHagar,PaulGerrard,RexBlack,RickCraig,RobertRose-Coutré,SidSnook,and
WayneMiddleton.Mysincerethankstoeachofthem.Anyfaultsinthisbookshouldbe
attributeddirectlytothem.(Justkidding!)
SomeFinalComments
ThisbookcontainsanumberofreferencestoWebsites.Thesereferenceswerecorrectwhen
themanuscriptwassubmittedtothepublisher.Unfortunately,theymayhavebecomebrokenby
thetimethebookisinthereaders'hands.
Ithasbecomestandardpracticeforauthorstoincludeapithyquotationonthetitlepageof
eachchapter.Unfortunately,thepracticehasbecomesoprevalentthatallthegoodquotations
havebeenused.Justforfun,Ihavechoseninsteadtoincludeoneachchaptertitlepagea
winningentryfromthe2003Bulwer-LyttonFictionContest(http://www.bulwer-lytton.com).
Since1982,theEnglishDepartmentatSanJoseStateUniversityhassponsoredthisevent,a
competitionthatchallengeswriterstocomposetheopeningsentencetotheworstofall
possiblenovels.ItwasinspiredbyEdwardGeorgeBulwer-LyttonwhobeganhisnovelPaul
Cliffordwith:
"Itwasadarkandstormynight;therainfellintorrents—exceptatoccasionalintervals,
whenitwascheckedbyaviolentgustofwindwhichsweptupthestreets(foritisin
Londonthatourscenelies),rattlingalongthehousetops,andfiercelyagitatingthescanty
flameofthelampsthatstruggledagainstthedarkness."
MyappreciationtoDr.ScottRiceofSanJoseStateUniversityforpermissiontousethese
exemplaryillustrationsofbadwriting.Hopefully,nothinginthisbookwillwinthisprestigious
award.
Acknowledgements
ThecaricatureofMickJaggerisownedandcopyrightedbyMartinO'Loughlinandusedby
permission.
ClipArtcopyrightbyCorelCorporationandusedunderalicensingagreement.
References
Beizer,Boris(1990).SoftwareTestingTechniques(SecondEdition).VanNostrand
Reinhold.
Craig,RickD.andStefanP.Jaskiel(2002).SystematicSoftwareTesting.ArtechHouse
Publishers.
Chapter1:TheTestingProcess
Overview
Theflockofgeeseflewoverheadina'V'formationnotinanold-fashioned-looking
TimesNewRomankindofa'V',branchedoutslightlyatthetwooppositearmsatthetop
ofthe'V',norinamoremodern-looking,straightandcrisp,linearArialsortof'V'
(althoughsincetheywereflying,Arialmighthavebeenappropriate),butinaslightly
asymmetric,tiltingoff-to-one-sidesortofitalicizedCourierNew-like'V'andLaFonte
knewthathewasjustthetypeofmantoknowthedifference.[1]
—JohnDotson
[1]Ifyouthinkthisquotationhasnothingtodowithsoftwaretestingyouarecorrect.Foran
explanationpleaseread"SomeFinalComments"inthePreface.
Testing
Whatistesting?Whilemanydefinitionshavebeenwritten,atitscoretestingistheprocessof
comparing"whatis"with"whatoughttobe."AmoreformaldefinitionisgivenintheIEEE
Standard610.12-1990,"IEEEStandardGlossaryofSoftwareEngineeringTerminology"which
defines"testing"as:
"Theprocessofoperatingasystemorcomponentunderspecifiedconditions,observingor
recordingtheresults,andmakinganevaluationofsomeaspectofthesystemor
component."
The"specifiedconditions"referredtointhisdefinitionareembodiedintestcases,thesubject
ofthisbook.
Key
Point Atitscore,testingistheprocessofcomparing"whatis"with"whatoughttobe."
RickCraigandStefanJaskielproposeanexpandeddefinitionofsoftwaretestingintheirbook,
SystematicSoftwareTesting.
"Testingisaconcurrentlifecycleprocessofengineering,usingandmaintainingtestwarein
ordertomeasureandimprovethequalityofthesoftwarebeingtested."
Thisviewincludestheplanning,analysis,anddesignthatleadstothecreationoftestcasesin
additiontotheIEEE'sfocusontestexecution.
Differentorganizationsanddifferentindividualshavevariedviewsofthepurposeofsoftware
testing.BorisBeizerdescribesfivelevelsoftestingmaturity.(Hecalledthemphasesbuttoday
weknowthepoliticallycorrecttermis"levels"andtherearealwaysfiveofthem.)
Level0-"There'snodifferencebetweentestinganddebugging.Otherthaninsupportof
debugging,testinghasnopurpose."Defectsmaybestumbleduponbutthereisnoformalized
efforttofindthem.
Level1-"Thepurposeoftestingistoshowthatsoftwareworks."Thisapproach,whichstarts
withthepremisethatthesoftwareis(basically)correct,mayblindustodiscoveringdefects.
GlenfordMyerswrotethatthoseperformingthetestingmaysubconsciouslyselecttestcases
thatshouldnotfail.Theywillnotcreatethe"diabolical"testsneededtofinddeeplyhidden
defects.
Level2-"Thepurposeoftestingistoshowthatthesoftwaredoesn'twork."Thisisavery
differentmindset.Itassumesthesoftwaredoesn'tworkandchallengesthetestertofindits
defects.Withthisapproach,wewillconsciouslyselecttestcasesthatevaluatethesystemin
itsnooksandcrannies,atitsboundaries,andnearitsedges,usingdiabolicallyconstructedtest
cases.
Level3-"Thepurposeoftestingisnottoproveanything,buttoreducetheperceivedriskof
notworkingtoanacceptablevalue."Whilewecanproveasystemincorrectwithonlyonetest
case,itisimpossibletoeverproveitcorrect.Todosowouldrequireustotesteverypossible
validcombinationofinputdataandeverypossibleinvalidcombinationofinputdata.Ourgoals
aretounderstandthequalityofthesoftwareintermsofitsdefects,tofurnishtheprogrammers
withinformationaboutthesoftware'sdeficiencies,andtoprovidemanagementwithan
evaluationofthenegativeimpactonourorganizationifweshippedthissystemtocustomersin
itspresentstate.
Level4-"Testingisnotanact.Itisamentaldisciplinethatresultsinlow-risksoftwarewithout
muchtestingeffort."Atthismaturitylevelwefocusonmakingsoftwaremoretestablefromits
inception.Thisincludesreviewsandinspectionsofitsrequirements,design,andcode.In
addition,itmeanswritingcodethatincorporatesfacilitiesthetestercaneasilyuseto
interrogateitwhileitisexecuting.Further,itmeanswritingcodethatisself-diagnosing,that
reportserrorsratherthanrequiringtesterstodiscoverthem.
CurrentChallenges
WhenIaskmystudentsaboutthechallengestheyfaceintestingtheytypicallyreply:
Notenoughtimetotestproperly
Toomanycombinationsofinputstotest
Notenoughtimetotestwell
Difficultyindeterminingtheexpectedresultsofeachtest
Nonexistentorrapidlychangingrequirements
Notenoughtimetotestthoroughly
Notrainingintestingprocesses
Notoolsupport
Managementthateitherdoesn'tunderstandtestingor(apparently)doesn'tcareabout
quality
Notenoughtime
Thisbookdoesnotcontain"magicpixiedust"thatyoucanusetocreateadditionaltime,better
requirements,ormoreenlightenedmanagement.Itdoes,however,containtechniquesthatwill
makeyoumoreefficientandeffectiveinyourtestingbyhelpingyouchooseandconstructtest
casesthatwillfindsubstantiallymoredefectsthanyouhaveinthepastwhileusingfewer
resources.
TestCases
Tobemosteffectiveandefficient,testcasesmustbedesigned,notjustslappedtogether.The
word"design"hasanumberofdefinitions:
1. Toconceiveorfashioninthemind;invent:designagoodreasontoattendtheSTAR
testingconference.Toformulateaplanfor;devise:designamarketingstrategyfor
thenewproduct.
2. Toplanoutinsystematic,usuallydocumentedform:designabuilding;designatest
case.
3. Tocreateorcontriveforaparticularpurposeoreffect:agamedesignedtoappealto
allages.
4. Tohaveasagoalorpurpose;intend.
5. Tocreateorexecuteinanartisticorhighlyskilledmanner.
Key
Point
Tobemosteffectiveandefficient,testcasesmustbedesigned,notjustslapped
together.
Eachofthesedefinitionsappliestogoodtestcasedesign.Regardingtestcasedesign,Roger
Pressmanwrote:
"Thedesignoftestsforsoftwareandotherengineeringproductscanbeaschallengingas
theinitialdesignoftheproductitself.Yet...softwareengineersoftentreattestingasan
afterthought,developingtestcasesthat'feelright'buthavelittleassuranceofbeing
complete.Recallingtheobjectivesoftesting,wemustdesignteststhathavethehighest
likelihoodoffindingthemosterrorswithaminimumamountoftimeandeffort."
Welldesignedtestcasesarecomposedofthreeparts:
Inputs
Outputs
Orderofexecution
Key
Point Testcasesconsistofinputs,outputs,andorderofexecution.
Inputs
Inputsarecommonlythoughtofasdataenteredatakeyboard.Whilethatisasignificant
sourceofsysteminput,datacancomefromothersources—datafrominterfacingsystems,
datafrominterfacingdevices,datareadfromfilesordatabases,thestatethesystemisin
whenthedataarrives,andtheenvironmentwithinwhichthesystemexecutes.
Outputs
Outputshavethissamevariety.Oftenoutputsarethoughtofasjustthedatadisplayedona
computerscreen.Inaddition,datacanbesenttointerfacingsystemsandtoexternaldevices.
Datacanbewrittentofilesordatabases.Thestateortheenvironmentmaybemodifiedbythe
system'sexecution.
Alloftheserelevantinputsandoutputsareimportantcomponentsofatestcase.Intestcase
design,determiningtheexpectedoutputsisthefunctionofan"oracle."
Anoracleisanyprogram,process,ordatathatprovidesthetestdesignerwiththeexpected
resultofatest.Beizerlistsfivetypesoforacles:
KiddieOracles-Justruntheprogramandseewhatcomesout.Ifitlooksaboutright,it
mustberight.
RegressionTestSuites-Runtheprogramandcomparetheoutputtotheresultsofthe
sametestsrunagainstapreviousversionoftheprogram.
ValidatedData-Runtheprogramandcomparetheresultsagainstastandardsuchas
atable,formula,orotheraccepteddefinitionofvalidoutput.
PurchasedTestSuites-Runtheprogramagainstastandardizedtestsuitethathas
beenpreviouslycreatedandvalidated.Programslikecompilers,Webbrowsers,and
SQL(StructuredQueryLanguage)processorsareoftentestedagainstsuchsuites.
ExistingProgram-Runtheprogramandcomparetheoutputtoanotherversionofthe
program.
OrderofExecution
Therearetwostylesoftestcasedesignregardingorderoftestexecution.
Cascadingtestcases-Testcasesmaybuildoneachother.Forexample,thefirsttest
caseexercisesaparticularfeatureofthesoftwareandthenleavesthesystemina
statesuchthatthesecondtestcasecanbeexecuted.Intestingadatabaseconsider
thesetestcases:
1. Createarecord
2. Readtherecord
3. Updatetherecord
4. Readtherecord
5. Deletetherecord
6. Readthedeletedrecord
Eachofthesetestscouldbebuiltontheprevioustests.Theadvantageisthateach
testcaseistypicallysmallerandsimpler.Thedisadvantageisthatifonetestfails,the
subsequenttestsmaybeinvalid.
Independenttestcases-Eachtestcaseisentirelyselfcontained.Testsdonotbuildon
eachotherorrequirethatothertestshavebeensuccessfullyexecuted.Theadvantage
isthatanynumberoftestscanbeexecutedinanyorder.Thedisadvantageisthateach
testtendstobelargerandmorecomplexandthusmoredifficulttodesign,create,and
maintain.
TypesOfTesting
Testingisoftendividedintoblackboxtestingandwhiteboxtesting.
Blackboxtestingisastrategyinwhichtestingisbasedsolelyontherequirementsand
specifications.Unlikeitscomplement,whiteboxtesting,blackboxtestingrequiresno
knowledgeoftheinternalpaths,structure,orimplementationofthesoftwareundertest.
Whiteboxtestingisastrategyinwhichtestingisbasedontheinternalpaths,structure,and
implementationofthesoftwareundertest.Unlikeitscomplement,blackboxtesting,whitebox
testinggenerallyrequiresdetailedprogrammingskills.
Anadditionaltypeoftestingiscalledgrayboxtesting.Inthisapproachwepeekintothe"box"
undertestjustlongenoughtounderstandhowithasbeenimplemented.Thenwecloseupthe
boxanduseourknowledgetochoosemoreeffectiveblackboxtests.
TestingLevels
Typicallytesting,andthereforetestcasedesign,isperformedatfourdifferentlevels:
UnitTesting-Aunitisthe"smallest"pieceofsoftwarethatadevelopercreates.Itis
typicallytheworkofoneprogrammerandisstoredinasinglediskfile.Different
programminglanguageshavedifferentunits:InC++andJavatheunitistheclass;inC
theunitisthefunction;inlessstructuredlanguageslikeBasicandCOBOLtheunitmay
betheentireprogram.
Key
Point Theclassicaltestinglevelsareunit,integration,system,andacceptance.
IntegrationTesting-Inintegrationweassembleunitstogetherintosubsystemsand
finallyintosystems.Itispossibleforunitstofunctionperfectlyinisolationbuttofail
whenintegrated.AclassicexampleisthisCprogramanditssubsidiaryfunction:
/*mainprogram*/
voidoops(int);
intmain(){
oops(42);/*calltheoopsfunctionpassinganinteger*/
return0;
}
/*functionoops(inaseparatefile)*/
#include<stdio.h>
voidoops(doublex){/*expectsadouble,notanint!*/
printf("%f\n",x);/*Willprintgarbage(0ismostlikely)*/
}
Iftheseunitsweretestedindividually,eachwouldappeartofunctioncorrectly.Inthis
case,thedefectonlyappearswhenthetwounitsareintegrated.Themainprogram
passesanintegertofunctionoopsbutoopsexpectsadoublelengthintegerandtrouble
ensues.Itisvitaltoperformintegrationtestingastheintegrationprocessproceeds.
SystemTesting-Asystemconsistsofallofthesoftware(andpossiblyhardware,user
manuals,trainingmaterials,etc.)thatmakeuptheproductdeliveredtothecustomer.
Systemtestingfocusesondefectsthatariseatthishighestlevelofintegration.
Typicallysystemtestingincludesmanytypesoftesting:functionality,usability,security,
internationalizationandlocalization,reliabilityandavailability,capacity,performance,
backupandrecovery,portability,andmanymore.Thisbookdealsonlywithfunctionality
testing.Whiletheothertypesoftestingareimportant,theyarebeyondthescopeof
thisvolume.
AcceptanceTesting-Acceptancetestingisdefinedasthattesting,whichwhen
completedsuccessfully,willresultinthecustomeracceptingthesoftwareandgivingus
theirmoney.Fromthecustomer'spointofview,theywouldgenerallylikethemost
exhaustiveacceptancetestingpossible(equivalenttothelevelofsystemtesting).From
thevendor'spointofview,wewouldgenerallyliketheminimumleveloftestingpossible
thatwouldresultinmoneychanginghands.Typicalstrategicquestionsthatshouldbe
addressedbeforeacceptancetestingare:Whodefinestheleveloftheacceptance
testing?Whocreatesthetestscripts?Whoexecutesthetests?Whatisthepass/fail
criteriafortheacceptancetest?Whenandhowdowegetpaid?
Notallsystemsareamenabletousingtheselevels.Theselevelsassumethatthereisa
significantperiodoftimebetweendevelopingunitsandintegratingthemintosubsystemsand
thenintosystems.InWebdevelopmentitisoftenpossibletogofromconcepttocodeto
productioninamatterofhours.Inthatcase,theunit-integration-systemlevelsdon'tmakemuch
sense.ManyWebtestersuseanalternatesetoflevels:
Codequality
Functionality
Usability
Performance
Security
TheImpossibilityOfTestingEverything
InhismonumentalbookTestingObject-OrientedSystems,RobertBinderprovidesanexcellent
exampleoftheimpossibilityoftesting"everything."Considerthefollowingprogram:
intblech(intj){
j=j-1;//shouldbej=j+1
j=j/30000;
returnj;
}
Notethatthesecondlineisincorrect!Thefunctionblechacceptsanintegerj,subtractsone
fromit,dividesitby30000(integerdivision,wholenumbers,noremainder)andreturnsthe
valuejustcomputed.Ifintegersareimplementedusing16bitsonthiscomputerexecutingthis
software,thelowestpossibleinputvalueis-32768andthehighestis32767.Thusthereare
65,536possibleinputsintothistinyprogram.(Yourorganization'sprogramsareprobably
larger.)Willyouhavethetime(andthestamina)tocreate65,536testcases?Ofcoursenot.
Sowhichinputvaluesdowechoose?Considerthefollowinginputvaluesandtheirabilityto
detectthisdefect.
Input(j) ExpectedResult ActualResult
1 0 0
42 0 0
40000 1 1
-64000 -2 -2
Oops!Notethatnoneofthetestcaseschosenhavedetectedthisdefect.Infactonlyfourof
thepossible65,536inputvalueswillfindthisdefect.Whatisthechancethatyouwillchooseall
four?Whatisthechanceyouwillchooseoneofthefour?Whatisthechanceyouwillwinthe
Powerballlottery?Isyouranswerthesametoeachofthesethreequestions?
Summary
Testingisaconcurrentlifecycleprocessofengineering,using,andmaintainingtestware
inordertomeasureandimprovethequalityofthesoftwarebeingtested.(Craigand
Jaskiel)
Thedesignoftestsforsoftwareandotherengineeringproductscanbeaschallenging
astheinitialdesignoftheproductitself.Yet...softwareengineersoftentreattesting
asanafterthought,developingtestcasesthat'feelright'buthavelittleassuranceof
beingcomplete.Recallingtheobjectivesoftesting,wemustdesignteststhathavethe
highestlikelihoodoffindingthemosterrorswithaminimumamountoftimeandeffort.
(Pressman)
Blackboxtestingisastrategyinwhichtestingisbasedsolelyontherequirementsand
specifications.Whiteboxtestingisastrategyinwhichtestingisbasedontheinternal
paths,structure,andimplementationofthesoftwareundertest.
Typicallytesting,andthereforetestcasedesign,isperformedatfourdifferentlevels:
Unit,Integration,System,andAcceptance.
Practice
1. Whichfourinputstotheblechroutinewillfindthehiddendefect?Howdidyou
determinethem?Whatdoesthissuggesttoyouasanapproachtofindingother
defects?
References
Beizer,Boris(1990).SoftwareTestingTechniques(SecondEdition).VanNostrand
Reinhold.
Binder,RobertV.(2000).TestingObject-OrientedSystems:Models,Patterns,and
Tools.Addison-Wesley.
Craig,RickD.andStefanP.Jaskiel(2002).SystematicSoftwareTesting.ArtechHouse
Publishers.
IEEEStandard610.12-1990,IEEEStandardGlossaryofSoftwareEngineering
Terminology,1991.
Myers,Glenford(1979).TheArtofSoftwareTesting.JohnWiley&Sons.
Pressman,RogerS.(1982).SoftwareEngineering:APractitioner'sApproach(Fourth
Edition).McGraw-Hill.
Chapter2:CaseStudies
Theyhadbutonelastremainingnighttogether,sotheyembracedeachotherastightlyas
thattwo-flavorentwinedstringcheesethatisorangeandyellowish-white,theorange
probablybeingablandCheddarandthewhite...Mozzarella,althoughitcouldpossibly
beProvoloneorjustplainAmerican,asitreallydoesn'ttastedistinctlydissimilarfromthe
orange,yettheywouldhaveyoubelieveitdoesbycoloringitdifferently.
—MariannSimms
WhyCaseStudies?
Twocasestudiesareprovidedintheappendicesofthisbook.AppendixAdescribes"Brown&
Donaldson,"anonlinebrokeragefirm.AppendixBdescribesthe"StatelessUniversity
RegistrationSystem."Examplesfromthesecasestudiesareusedtoillustratethetestcase
designtechniquesdescribedinthisbook.Inaddition,someofthebook'sexercisesarebased
onthecasestudies.Thefollowingsectionsbrieflydescribethecasestudies.Readthedetailed
informationinAppendixAandBwhenrequired.
Brown&Donaldson
Brown&Donaldson(B&D)isafictitiousonlinebrokeragefirmthatyoucanusetopracticethe
testdesigntechniquespresentedinthisbook.B&DwasoriginallycreatedforSoftwareQuality
Engineering'sWeb/eBusinessTestingcourse(formoredetailsseehttp://www.sqe.com).
ScreenshotsofvariouspagesareincludedinAppendixA.Referencewillbemadetosomeof
thesethroughoutthebook.TheactualB&DWebsiteisfoundathttp://bdonline.sqe.com.Any
resemblancetoanyactualonlinebrokerageWebsiteispurelycoincidental.
YoucanactuallytrytheB&DWebsite.First-timeuserswillneedtocreateaBDonlineaccount.
Thisaccountisnotreal—anytransactionsrequestedorexecutedviathisaccountwillnot
occurintherealworld,onlyinthefictitiousworldofB&D.Onceyouhavecreatedanaccount,
youwillbypassthisstepandloginwithyourusernameandpassword.Whilecreatinganew
accountyouwillbeaskedtosupplyanauthorizationcode.Theauthorizationcodeiseight1s.
ThisWebsitealsocontainsanumberofdownloadabledocumentsfromtheB&Dcasestudy,
whichcanbeusedtoassistyouindevelopingtestplansforyourownWebprojects.
StatelessUniversityRegistrationSystem
Everystatehasastateuniversity.Thiscasestudydescribesanonlinestudentregistration
systemforthefictitiousStatelessUniversity.Pleasedonotattempttocashoutyourstocks
fromBrown&DonaldsontoenrollatStatelessU.
ThedocumentinAppendixBdescribestheplanneduserinterfacefortheStatelessUniversity
RegistrationSystem(SURS).Itdefinestheuserinterfacescreensintheorderinwhichtheyare
typicallyused.Itstartswiththeloginscreen.Thenitprovidesthedatabaseset-upfields,the
addition/change/deletionofstudents,theaddition/change/deletionofcourses,andthe
addition/change/deletionofclasssections.Thefinaldataentryscreenprovidestheselectionof
specificcoursesectionsforeachstudent.Additionaladministrativefunctionsarealsodefined.
SectionI:BlackBoxTestingTechniques
ChapterList
Chapter3:EquivalenceClassTesting
Chapter4:BoundaryValueTesting
Chapter5:DecisionTableTesting
Chapter6:PairwiseTesting
Chapter7:State-TransitionTesting
Chapter8:DomainAnalysisTesting
Chapter9:UseCaseTesting
PartOverview
Definition
Blackboxtestingisastrategyinwhichtestingisbasedsolelyontherequirementsand
specifications.Unlikeitscomplement,whiteboxtesting,blackboxtestingrequiresno
knowledgeoftheinternalpaths,structure,orimplementationofthesoftwareundertest(SUT).
Thegeneralblackboxtestingprocessis:
Therequirementsorspecificationsareanalyzed.
ValidinputsarechosenbasedonthespecificationtodeterminethattheSUTprocesses
themcorrectly.InvalidinputsmustalsobechosentoverifythattheSUTdetectsthem
andhandlesthemproperly.
Expectedoutputsforthoseinputsaredetermined.
Testsareconstructedwiththeselectedinputs.
Thetestsarerun.
Actualoutputsarecomparedwiththeexpectedoutputs.
AdeterminationismadeastotheproperfunctioningoftheSUT.
Applicability
Blackboxtestingcanbeappliedatalllevelsofsystemdevelopment—unit,integration,system,
andacceptance.
Aswemoveupinsizefrommoduletosubsystemtosystemtheboxgetslarger,withmore
complexinputsandmorecomplexoutputs,buttheapproachremainsthesame.Also,aswe
moveupinsize,weareforcedtotheblackboxapproach;therearesimplytoomanypaths
throughtheSUTtoperformwhiteboxtesting.
Disadvantages
Whenusingblackboxtesting,thetestercanneverbesureofhowmuchoftheSUThasbeen
tested.Nomatterhowcleverordiligentthetester,someexecutionpathsmayneverbe
exercised.Forexample,whatistheprobabilityatesterwouldselectatestcasetodiscover
this"feature"?
if(name=="Lee"&&employeeNumber=="1234"&&
employmentStatus=="RecentlyTerminatedForCause"){
sendLeeacheckfor$1,000,000;
}
Key
Point
Whenusingblackboxtesting,thetestercanneverbesureofhowmuchofthe
systemundertesthasbeentested.
Tofindeverydefectusingblackboxtesting,thetesterwouldhavetocreateeverypossible
combinationofinputdata,bothvalidandinvalid.Thisexhaustiveinputtestingisalmostalways
impossible.Wecanonlychooseasubset(oftenaverysmallsubset)oftheinputcombinations.
InTheArtofSoftwareTesting,GlenfordMyersprovidesanexcellentexampleofthefutilityof
exhaustivetesting:Howwouldyouthoroughlytestacompiler?Bywritingeverypossiblevalid
andinvalidprogram.Theproblemissubstantiallyworseforsystemsthatmustrememberwhat
hashappenedbefore(i.e.,thatremembertheirstate).Inthosesystems,notonlymustwetest
everypossibleinput,wemusttesteverypossiblesequenceofeverypossibleinput.
Key
Point
Eventhoughwecan'ttesteverything,formalblackboxtestingdirectsthetesterto
choosesubsetsofteststhatarebothefficientandeffectiveinfindingdefects.
Advantages
Eventhoughwecan'ttesteverything,formalblackboxtestingdirectsthetestertochoose
subsetsofteststhatarebothefficientandeffectiveinfindingdefects.Assuch,thesesubsets
willfindmoredefectsthanarandomlycreatedequivalentnumberoftests.Blackboxtesting
helpsmaximizethereturnonourtestinginvestment.
References
Myers,GlenfordJ.(1979).TheArtofSoftwareTesting.JohnWiley&Sons.
Chapter3:EquivalenceClassTesting
OnthefourthdayofhisexplorationoftheAmazon,Byronclimbedoutofhisinnertube,
checkedthelatestnewsonhispersonaldigitalassistant(hereafterPDA)outfittedwith
wirelesstechnology,andrealizedthatthegnawinghefeltinhisstomachwasnotfear
no,hewasnotafraid,ratherelatednorwasittensionno,hewasactuallyrather
relaxedsoitwasinallprobabilityaparasite.
—ChuckKeelan
Introduction
Equivalenceclasstestingisatechniqueusedtoreducethenumberoftestcasestoa
manageablelevelwhilestillmaintainingreasonabletestcoverage.Thissimpletechniqueisused
intuitivelybyalmostalltesters,eventhoughtheymaynotbeawareofitasaformaltestdesign
method.Manytestershavelogicallydeduceditsusefulness,whileothershavediscoveredit
simplybecauseoflackoftimetotestmorethoroughly.
Considerthissituation.Wearewritingamoduleforahumanresourcessystemthatdecides
howweshouldprocessemploymentapplicationsbasedonaperson'sage.Ourorganization's
rulesare:
0–16Don'thire
16–18Canhireonapart-timebasisonly
18–55Canhireasafull-timeemployee
55–99Don'thire[*]
[*]Note:Ifyou'vespottedaproblemwiththeserequirements,don'tworry.Theyarewritten
thiswayforapurposeandwillberepairedinthenextchapter.
Observation
WiththeserulesourorganizationwouldnothavehiredDoogieHouser,M.D.orCol.Harlan
Sanders,onetooyoung,theothertooold.
Shouldwetestthemoduleforthefollowingages:0,1,2,3,4,5,6,7,8,...,90,91,92,93,
94,95,96,97,98,99?Ifwehadlotsoftime(anddidn'tmindthemind-numbingrepetitionand
werebeingpaidbythehour)wecertainlycould.Iftheprogrammerhadimplementedthis
modulewiththefollowingcodeweshouldtesteachage.(Ifyoudon'thaveaprogramming
backgrounddon'tworry.Theseexamplesaresimple.Justreadthecodeanditwillmakesense
toyou.)
If(applicantAge==0)hireStatus="NO";
If(applicantAge==1)hireStatus="NO";
…
If(applicantAge==14)hireStatus="NO";
If(applicantAge==15)hireStatus="NO";
If(applicantAge==16)hireStatus="PART";
If(applicantAge==17)hireStatus="PART";
If(applicantAge==18)hireStatus="FULL";
If(applicantAge==19)hireStatus="FULL";
…
If(applicantAge==53)hireStatus="FULL";
If(applicantAge==54)hireStatus="FULL";
If(applicantAge==55)hireStatus="NO";
If(applicantAge==56)hireStatus="NO";
…
If(applicantAge==98)hireStatus="NO";
If(applicantAge==99)hireStatus="NO";
Giventhisimplementation,thefactthatanysetoftestspassestellsusnothingaboutthenext
testwecouldexecute.Itmaypass;itmayfail.
Luckily,programmersdon'twritecodelikethis(atleastnotveryoften).Abetterprogrammer
mightwrite:
If(applicantAge>=0&&applicantAge<=16)
hireStatus="NO";
If(applicantAge>=16&&applicantAge<=18)
hireStatus="PART";
If(applicantAge>=18&&applicantAge<=55)
hireStatus="FULL";
If(applicantAge>=55&&applicantAge<=99)
hireStatus="NO";
Giventhistypicalimplementation,itisclearthatforthefirstrequirementwedon'thavetotest
0,1,2,...14,15,and16.Onlyonevalueneedstobetested.Andwhichvalue?Anyonewithin
thatrangeisjustasgoodasanyotherone.Thesameistrueforeachoftheotherranges.
Rangessuchastheonesdescribedherearecalledequivalenceclasses.Anequivalence
classconsistsofasetofdatathatistreatedthesamebythemoduleorthatshouldproduce
thesameresult.Anydatavaluewithinaclassisequivalent,intermsoftesting,toanyother
value.Specifically,wewouldexpectthat:
Ifonetestcaseinanequivalenceclassdetectsadefect,allothertestcasesinthe
sameequivalenceclassarelikelytodetectthesamedefect.
Ifonetestcaseinanequivalenceclassdoesnotdetectadefect,noothertestcasesin
thesameequivalenceclassislikelytodetectthedefect.
Key
Point
Agroupoftestsformsanequivalenceclassifyoubelievethat:
Theyalltestthesamething.
Ifonetestcatchesabug,theothersprobablywilltoo.
Ifonetestdoesn'tcatchabug,theothersprobablywon'teither.
CemKanerTestingComputerSoftware
Thisapproachassumes,ofcourse,thataspecificationexiststhatdefinesthevarious
equivalenceclassestobetested.Italsoassumesthattheprogrammerhasnotdonesomething
strangesuchas:
If(applicantAge>=0&&applicantAge<=16)
hireStatus="NO";
If(applicantAge>=16&&applicantAge<=18)
hireStatus="PART";
If(applicantAge>=18&&applicantAge<=41)
hireStatus="FULL";
//strangestatementsfollow
If(applicantAge==42&&applicantName=="Lee")
hireStatus="HIRENOWATHUGESALARY";
If(applicantAge==42&&applicantName<>"Lee")
hireStatus="FULL";
//endofstrangestatements
If(applicantAge>=43&&applicantAge<=55)
hireStatus="FULL";
If(applicantAge>=55&&applicantAge<=99)
hireStatus="NO";
Usingtheequivalenceclassapproach,wehavereducedthenumberoftestcasesfrom100
(testingeachage)tofour(testingoneageineachequivalenceclass)—asignificantsavings.
Now,arewereadytobegintesting?Probablynot.Whataboutinputvalueslike969,-42,
FRED,and&$#!@?Shouldwecreatetestcasesforinvalidinput?Theansweris,asanygood
consultantwilltellyou,"itdepends."Tounderstandthisanswerweneedtoexaminean
approachthatcameoutoftheobject-orientedworldcalleddesign-by-contract.
Note
AccordingtotheBible,theageofMethuselahwhenhediedwas969years(Gen
5:27).ThankstotheGideonswhomadethisdataeasilyaccessibleinmyhotelroom
withouttheneedforahighspeedInternetconnection.
Inlaw,acontractisalegallybindingagreementbetweentwo(ormore)partiesthatdescribes
whateachpartypromisestodoornotdo.Eachofthesepromisesisofbenefittotheother.
Inthedesign-by-contractapproach,modules(called"methods"intheobject-orientedparadigm,
but"module"isamoregenericterm)aredefinedintermsofpre-conditionsandpost-conditions.
Post-conditionsdefinewhatamodulepromisestodo(computeavalue,openafile,printa
report,updateadatabaserecord,changethestateofthesystem,etc.).Pre-conditionsdefine
whatthatmodulerequiressothatitcanmeetitspost-conditions.Forexample,ifwehada
modulecalledopenFile,whatdoesitpromisetodo?Openafile.Whatwouldlegitimate
preconditionsofopenFilebe?First,thefilemustexist;second,wemustprovidethename(or
otheridentifyinginformation)ofthefile;third,thefilemustbe"openable,"thatis,itcannot
alreadybeexclusivelyopenedbyanotherprocess;fourth,wemusthaveaccessrightstothe
file;andsoon.Pre-conditionsandpostconditionsestablishacontractbetweenamoduleand
othersthatinvokeit.
Testing-by-contractisbasedonthedesign-by-contractphilosophy.Itsapproachistocreate
testcasesonlyforthesituationsinwhichthepre-conditionsaremet.Forexample,wewould
nottesttheopenFilemodulewhenthefiledidnotexist.Thereasonissimple.Ifthefiledoes
notexist,openFiledoesnotpromisetowork.Ifthereisnoclaimthatitwillworkundera
specificcondition,thereisnoneedtotestunderthatcondition.
ForMore
Information
SeeBertrandMeyer'sbookObject-OrientedSoftwareConstructionfor
moreondesign-by-contract.
Atthispointtestersusuallyprotest.Yes,theyagree,themoduledoesnotclaimtoworkinthat
case,butwhatifthepreconditionsareviolatedduringproduction?Whatdoesthesystemdo?
Dowegetamisspelledwordonthescreenorasmokingcraterwhereourcompanyusedto
be?
Adifferentapproachtodesignisdefensivedesign.Inthiscasethemoduleisdesignedto
acceptanyinput.Ifthenormalpreconditionsaremet,themodulewillachieveitsnormal
postconditions.Ifthenormalpre-conditionsarenotmet,themodulewillnotifythecallerby
returninganerrorcodeorthrowinganexception(dependingontheprogramminglanguage
used).Thisnotificationisactuallyanotheroneofthemodule'spostconditions.Basedonthis
approachwecoulddefinedefensivetesting:anapproachthattestsunderbothnormaland
abnormalpre-conditions.
Insight
Astudentinoneofmyclasses,let'scallhimFred,saidhedidn'treallycarewhich
designapproachwasbeingused,hewasgoingtoalwaysusedefensivetesting.
WhenIaskedwhy,hereplied,"Ifitdoesn'twork,whowillgettheblame-those
responsibleorthetesters?"
Howdoesthisapplytoequivalenceclasstesting?Dowehavetotestwithinputslike-42,
FRED,and&$#!@?Ifweareusingdesign-by-contractandtesting-by-contracttheansweris
No.Ifweareusingdefensivedesignandthusdefensivetesting,theanswerisYes.Askyour
designerswhichapproachtheyareusing.Iftheyanswereither"contract"or"defensive,"you
knowwhatstyleoftestingtouse.Iftheyanswer"Huh?"thatmeanstheyarenotthinkingabout
howmodulesinterface.Theyarenotthinkingaboutpre-conditionandpost-conditioncontracts.
Youshouldexpectintegrationtestingtobeaprimesourceofdefectsthatwillbemorecomplex
andtakemoretimethananticipated.
Technique
Thestepsforusingequivalenceclasstestingaresimple.First,identifytheequivalenceclasses.
Second,createatestcaseforeachequivalenceclass.Youcouldcreateadditionaltestcases
foreachequivalenceclassifyouhavethetimeandmoney.Additionaltestcasesmaymakeyou
feelwarmandfuzzy,buttheyrarelydiscoverdefectsthefirstdoesn'tfind.
Insight
Astudentinoneofmyclasses,let'scallherJudy,feltveryuncomfortableabout
havingonlyonetestcaseforeachequivalenceclass.Shewantedatleasttwofor
thatwarmandfuzzyfeeling.Iindicatedthatifshehadthetimeandmoneythat
approachwasfinebutsuggestedtheadditionaltestswouldprobablybeineffective.
Iaskedhertokeeptrackofhowmanytimestheadditionaltestcasesfound
defectsthatthefirstdidnotandletmeknow.IneverheardfromJudyagain.
Differenttypesofinputrequiredifferenttypesofequivalenceclasses.Let'sconsiderfour
possibilities.Let'sassumeadefensivetestingphilosophyoftestingbothvalidandinvalidinput.
Testinginvalidinputsisoftenagreatsourceofdefects.
Ifaninputisacontinuousrangeofvalues,thenthereistypicallyoneclassofvalidvaluesand
twoclassesofinvalidvalues,onebelowthevalidclassandoneaboveit.ConsidertheGoofy
MortgageCompany(GMC).Theywillwritemortgagesforpeoplewithincomesbetween
$1,000/monthand$83,333/month.Anythingbelow$1,000/monthyoudon'tqualify.Anything
over$83,333/monthyoudon'tneedGMC,justpaycash.
Foravalidinputwemightchoose$1,342/month.Forinvalidswemightchoose$123/monthand
$90,000/month.
Figure3-1:Continuousequivalenceclasses Ifaninputconditiontakeson
discretevalueswithinarangeofpermissiblevalues,therearetypicallyonevalidandtwo
invalidclasses.GMCwillwriteasinglemortgageforonethroughfivehouses.(Remember,
it'sGoofy.)Zeroorfewerhousesisnotalegitimateinput,norissixorgreater.Neitherare
fractionalordecimalvaluessuchas21/2or3.14159.
Figure3-2:Discreteequivalenceclasses Foravalidinputwemight
choosetwohouses.Invalidscouldbe-2and8.
GMCwillmakemortgagesonlyforaperson.Theywillnotmakemortgagesfor
corporations,trusts,partnerships,oranyothertypeoflegalentity.
Figure3-3:Singleselectionequivalenceclasses Foravalidinputwe
mustuse"person."Foraninvalidwecouldchoose"corporation"or"trust"oranyother
randomtextstring.Howmanyinvalidcasesshouldwecreate?Wemusthaveatleast
one;wemaychooseadditionaltestsforadditionalwarmandfuzzyfeelings.
GMCwillmakemortgagesonCondominiums,Townhouses,andSingleFamily
dwellings.TheywillnotmakemortgagesonDuplexes,MobileHomes,Treehouses,or
anyothertypeofdwelling.
Figure3-4:Multipleselectionequivalenceclass Forvalidinputwe
mustchoosefrom"Condominium,""Townhouse,"or"SingleFamily."Whiletherule
sayschooseonetestcasefromthevalidequivalenceclass,amorecomprehensive
approachwouldbetocreatetestcasesforeachentryinthevalidclass.That
makessensewhenthelistofvalidvaluesissmall.But,ifthiswerealistofthefifty
states,theDistrictofColumbia,andthevariousterritoriesoftheUnitedStates,
wouldyoutesteveryoneofthem?Whatifthelistwereeverycountryintheworld?
Thecorrectanswer,ofcourse,dependsontherisktotheorganizationif,astesters,
wemisssomethingthatisvital.
Now,rarelywillwehavethetimetocreateindividualtestsforeveryseparate
equivalenceclassofeveryinputvaluethatentersoursystem.Moreoften,wewill
createtestcasesthattestanumberofinputfieldssimultaneously.Forexample,we
mightcreateasingletestcasewiththefollowingcombinationofinputs:
Key
Point
Rarelywillwehavethetimetocreateindividualtestsforevery
separateequivalenceclassofeveryinputvalue.
Table3-1:Atestcaseofvaliddatavalues.
MonthlyIncome NumberofDwellings Applicant DwellingTypes Result
$5,000 2 Person Condo Valid
Eachofthesedatavaluesisinthevalidrange,sowewouldexpectthesystemto
performcorrectlyandforthetestcasetoreportPass.
Itistemptingtousethesameapproachforinvalidvalues.
Table3-2:Atestcaseofallinvaliddatavalues.Thisisnotagood
approach.
MonthlyIncome NumberofDwellings Applicant DwellingTypes Result
$100 8 Partnership Treehouse Invalid
Ifthesystemacceptsthisinputasvalid,clearlythesystemisnotvalidatingthefour
inputfieldsproperly.Ifthesystemrejectsthisinputasinvalid,itmaydosoinsucha
waythatthetestercannotdeterminewhichfielditrejected.Forexample:ERROR:
653X-2.7INVALIDINPUT
Inmanycases,errorsinoneinputfieldmaycanceloutormaskerrorsinanother
fieldsothesystemacceptsthedataasvalid.Abetterapproachistotestoneinvalid
valueatatimetoverifythesystemdetectsitcorrectly.
Table3-3:Asetoftestcasesvaryinginvalidvaluesonebyone.
MonthlyIncome NumberofDwellings Applicant DwellingTypes Result
$100 1 Person SingleFam Invalid
$1,342 0Person Condo Invalid
$1,342 1 Corporation Townhouse Invalid
$1,342 1 Person Treehouse Invalid
Foradditionalwarmandfuzzyfeelings,theinputs(bothvalidandinvalid)couldbe
varied.
Table3-4:Asetoftestcasesvaryinginvalidvaluesonebyonebutalso
varyingthevalidvalues.
MonthlyIncome NumberofDwellings Applicant DwellingTypes Result
$100 1 Person SingleFamily Invalid
$1,342 0Person Condominium Invalid
$5,432 3 Corporation Townhouse Invalid
$10,000 2 Person Treehouse Invalid
Anotherapproachtousingequivalenceclassesistoexaminetheoutputsratherthan
theinputs.Dividetheoutputsintoequivalenceclasses,thendeterminewhatinput
valueswouldcausethoseoutputs.Thishastheadvantageofguidingthetesterto
examine,andthustest,everydifferentkindofoutput.Butthisapproachcanbe
deceiving.Inthepreviousexample,forthehumanresourcessystem,oneofthe
systemoutputswasNO,thatis,Don'tHire.Acursoryviewoftheinputsthatshould
causethisoutputwouldyield{0,1,...,14,15}.Notethatthisisnotthecomplete
set.Inaddition{55,56,...,98,99}shouldalsocausetheNOoutput.It'simportant
tomakesurethatallpotentialoutputscanbegenerated,butdon'tbefooledinto
choosingequivalenceclassdatathatomitsimportantinputs.
Examples
Example1
ReferringtotheTradeWebpageoftheBrown&DonaldsonWebsitedescribedinAppendixA,
considertheOrderTypefield.ThedesignerhaschosentoimplementthedecisiontoBuyor
Sellthroughradiobuttons.Thisisagooddesignchoicebecauseitreducesthenumberoftest
casesthetestermustcreate.Hadthisbeenimplementedasatextfieldinwhichtheuser
entered"Buy"or"Sell"thetesterwouldhavepartitionedthevalidinputsas{Buy,Sell}andthe
invalidsas{Trade,Punt,...}.Whatabout"buy","bUy","BUY"?Arethesevalidorinvalid
entries?Thetesterwouldhavetoreferbacktotherequirementstodeterminetheirstatus.
Insight Letyourdesignersandprogrammersknowwhentheyhavehelpedyou.They'll
appreciatethethoughtandmaydoitagain.
Withtheradiobuttonimplementationnoinvalidchoicesexist,sononeneedtobetested.Only
thevalidinputs{Buy,Sell}needtobeexercised.
Example2
Again,referringtotheTradeWebpage,considertheQuantityfield.Inputtothisfieldcanbe
betweenoneandfournumericcharacters(0,1,...,8,9)withavalidvaluegreaterorequalto1
andlessthanorequalto9999.Asetofvalidinputsis{1,22,333,4444}whileinvalidinputsare
{-42,0,12345,SQE,$#@%}.
Insight
VeryoftenyourdesignersandprogrammersuseGUIdesigntoolsthatcanenforce
restrictionsonthelengthandcontentofinputfields.Encouragetheiruse.Thenyour
testingcanfocusonmakingsuretherequirementhasbeenimplementedproperly
withthetool.
Example3
OntheTradepagetheuserentersatickerSymbolindicatingthestocktobuyorsell.Thevalid
symbolsare{A,AA,AABC,AAC,...,ZOLT,ZOMX,ZONA,ZRAN).Theinvalidsymbolsare
anycombinationofcharactersnotincludedinthevalidlist.Asetofvalidinputscouldbe{A,AL,
ABE,ACES,AKZOY)whileasetofinvalidscouldbe{C,AF,BOB,CLUBS,AKZAM,42,
@#$%).
ForMore
Information
ClickontheSymbolLookupbuttonontheB&DTradepagetoseethe
fulllistofstocksymbols.
Example4
Rarelywillwecreateseparatesetsoftestcasesforeachinput.Generallyitismoreefficientto
testmultipleinputssimultaneouslywithintests.Forexample,thefollowingtestscombine
Buy/Sell,Symbol,andQuantity.
Table3-5:Asetoftestcasesvaryinginvalidvaluesonebyone.
Buy/Sell Symbol Quantity Result
Buy A 10 Valid
Buy C 20 Invalid
Buy A 0 Invalid
Sell ACES 10 Valid
Sell BOB 33 Invalid
Sell ABE -3 Invalid
ApplicabilityandLimitations
Equivalenceclasstestingcansignificantlyreducethenumberoftestcasesthatmustbe
createdandexecuted.Itismostsuitedtosystemsinwhichmuchoftheinputdatatakeson
valueswithinrangesorwithinsets.Itmakestheassumptionthatdatainthesameequivalence
classis,infact,processedinthesamewaybythesystem.Thesimplestwaytovalidatethis
assumptionistoasktheprogrammerabouttheirimplementation.
Equivalenceclasstestingisequallyapplicableattheunit,integration,system,andacceptance
testlevels.Allitrequiresareinputsoroutputsthatcanbepartitionedbasedonthesystem's
requirements.
Summary
Equivalenceclasstestingisatechniqueusedtoreducethenumberoftestcasestoa
manageablesizewhilestillmaintainingreasonablecoverage.
Thissimpletechniqueisusedintuitivelybyalmostalltesters,eventhoughtheymaynot
beawareofitasaformaltestdesignmethod.
Anequivalenceclassconsistsofasetofdatathatistreatedthesamebythemodule
orthatshouldproducethesameresult.Anydatavaluewithinaclassisequivalent,in
termsoftesting,toanyothervalue.
Practice
1. ThefollowingexercisesrefertotheStatelessUniversityRegistrationSystemWeb
sitedescribedinAppendixB.Definetheequivalenceclassesandsuitabletestcases
forthefollowing:
1. ZIPCode—fivenumericdigits.
2. State—thestandardPostOfficetwo-characterabbreviationforthestates,
districts,territories,etc.oftheUnitedStates.
3. LastName—onethroughfifteencharacters(includingalphabeticcharacters,
periods,hyphens,apostrophes,spaces,andnumbers).
4. UserID—eightcharactersatleasttwoofwhicharenotalphabetic(numeric,
special,nonprinting).
5. StudentID—eightcharacters.Thefirsttworepresentthestudent'shome
campuswhilethelastsixareauniquesix-digitnumber.Validhomecampus
abbreviationsare:AN,Annandale;LC,LasCruces;RW,RiversideWest;
SM,SanMateo;TA,Talbot;WE,Weber;andWN,Wenatchee.
References
Beizer,Boris(1990).SoftwareTestingTechniques.VanNostrandReinhold.
Kaner,Cem,JackFalkandHungQuocNguyen(1999).TestingComputerSoftware
(SecondEdition).JohnWiley&Sons.
Myers,GlenfordJ.(1979).TheArtofSoftwareTesting.JohnWiley&Sons.
Chapter4:BoundaryValueTesting
ThePrincelookeddownatthemotionlessformofSleepingBeauty,wonderinghowher
supplelipswouldfeelagainsthisownandcontemplatingwhetherornotanAltoidwas
strongenoughtostandupagainstthekindofmorningbreathonlyahundredyears'nap
couldcreate.
—LynneSella
Introduction
Equivalenceclasstestingisthemostbasictestdesigntechnique.Ithelpstesterschoosea
smallsubsetofpossibletestcaseswhilemaintainingreasonablecoverage.Equivalenceclass
testinghasasecondbenefit.Itleadsustotheideaofboundaryvaluetesting,thesecondkey
testdesigntechniquetobepresented.
Inthepreviouschapterthefollowingrulesweregiventhatindicatehowweshouldprocess
employmentapplicationsbasedonaperson'sage.Theruleswere:
0–16 Don'thire
16–18Canhireonapart-timebasisonly
18–55Canhireasafull-timeemployee
55–99Don'thire
Noticetheproblemattheboundaries—the"edges"ofeachclass.Theage"16"isincludedin
twodifferentequivalenceclasses(asare18and55).Thefirstrulesaysdon'thirea16-year-
old.Thesecondrulesaysa16-year-oldcanbehiredonapart-timebasis.
Boundaryvaluetestingfocusesontheboundariessimplybecausethatiswheresomany
defectshide.Experiencedtestershaveencounteredthissituationmanytimes.Inexperienced
testersmayhaveanintuitivefeelthatmistakeswilloccurmostoftenattheboundaries.These
defectscanbeintherequirements(asshownabove)orinthecodeasshownbelow:
Key
Point
Boundaryvaluetestingfocusesontheboundariesbecausethatiswheresomany
defectshide.
If(applicantAge>=0&&applicantAge<=16)
hireStatus="NO";
If(applicantAge>=16&&applicantAge<=18)
hireStatus="PART";
If(applicantAge>=18&&applicantAge<=55)
hireStatus="FULL";
If(applicantAge>=55&&applicantAge<=99)
hireStatus="NO";
Ofcourse,themistakethatprogrammersmakeiscodinginequalitytestsimproperly.Writing>
(greaterthan)insteadof(greaterthanorequal)isanexample.
Themostefficientwayoffindingsuchdefects,eitherintherequirementsorthecode,is
throughinspection.GilbandGraham'sbook,SoftwareInspection,isanexcellentguidetothis
process.However,nomatterhoweffectiveourinspections,wewillwanttotestthecodeto
verifyitscorrectness.
Perhapsthisiswhatourorganizationmeant:
0–15Don'thire
16–17Canhireonapart-timebasisonly
18–54Canhireasfull-timeemployees
55–99Don'thire
Whataboutages-3and101?Notethattherequirementsdonotspecifyhowthesevalues
shouldbetreated.Wecouldguessbut"guessingtherequirements"isnotanacceptable
practice.
Thecodethatimplementsthecorrectedrulesis:
If(applicantAge>=0&&applicantAge<=15)
hireStatus="NO";
If(applicantAge>=16&&applicantAge<=17)
hireStatus="PART";
If(applicantAge>=18&&applicantAge<=54)
hireStatus="FULL";
If(applicantAge>=55&&applicantAge<=99)
hireStatus="NO";
Theinterestingvaluesonorneartheboundariesinthisexampleare{-1,0,1},{15,16,17},
{17,18,19},{54,55,56},and{98,99,100}.Othervalues,suchas{-42,1001,FRED,%$#@}
mightbeincludeddependingonthemodule'sdocumentedpreconditions.
Technique
Thestepsforusingboundaryvaluetestingaresimple.First,identifytheequivalenceclasses.
Second,identifytheboundariesofeachequivalenceclass.Third,createtestcasesforeach
boundaryvaluebychoosingonepointontheboundary,onepointjustbelowtheboundary,and
onepointjustabovetheboundary."Below"and"above"arerelativetermsanddependonthe
datavalue'sunits.Iftheboundaryis16andtheunitis"integer"thenthe"below"pointis15and
the"above"pointis17.Iftheboundaryis$5.00andtheunitis"USdollarsandcents"thenthe
belowpointis$4.99andtheabovepointis$5.01.Ontheotherhand,ifthevalueis$5andthe
unitis"USdollars"thenthebelowpointis$4andtheabovepointis$6.
Key
Point
Createtestcasesforeachboundaryvaluebychoosingonepointonthe
boundary,onepointjustbelowtheboundary,andonepointjustabovethe
boundary.
Notethatapointjustaboveoneboundarymaybeinanotherequivalenceclass.Thereisno
reasontoduplicatethetest.Thesamemaybetrueofthepointjustbelowtheboundary.
Youcould,ofcourse,createadditionaltestcasesfartherfromtheboundaries(within
equivalenceclasses)ifyouhavetheresources.Asdiscussedinthepreviouschapter,these
additionaltestcasesmaymakeyoufeelwarmandfuzzy,buttheyrarelydiscoveradditional
defects.
Boundaryvaluetestingismostappropriatewheretheinputisacontinuousrangeofvalues.
ReturningagaintotheGoofyMortgageCompany,whataretheinterestingboundaryvalues?
Formonthlyincometheboundariesare$1,000/monthand$83,333/month(assumingtheunits
tobeUSdollars).
Figure4-1:Boundaryvaluesforacontinuousrangeofinputs.
Testdatainputof{$999,$1,000,$1,001}onthelowendand{$83,332,$83,333,$83,334}on
thehighendarechosentotesttheboundaries.
BecauseGMCwillwriteamortgageforonethroughfivehouses,zeroorfewerhousesisnota
legitimateinputnorissixorgreater.Theseidentifytheboundariesfortesting.
Figure4-2:Boundaryvaluesforadiscreterangeofinputs.
Rarelywillwehavethetimetocreateindividualtestsforeveryboundaryvalueofeveryinput
valuethatentersoursystem.Moreoften,wewillcreatetestcasesthattestanumberofinput
fieldssimultaneously.
Table4-1:Asetoftestcasescontainingcombinationsofvalid(ontheboundary)
valuesandinvalid(offtheboundary)points.
MonthlyIncome NumberofDwellings Result Description
$1,000 1 Valid Minincome,mindwellings
$83,333 1 Valid Maxincome,mindwellings
$1,000 5 Valid Minincome,maxdwellings
$83,333 5 Valid Maxincome,maxdwellings
$1,000 0 Invalid Minincome,belowmindwellings
$1,000 6 Invalid Minincome,abovemaxdwellings
$83,333 0 Invalid Maxincome,belowmindwellings
$83,333 6 Invalid Maxincome,abovemaxdwellings
$999 1 Invalid Belowminincome,mindwellings
$83,334 1 Invalid Abovemaxincome,mindwellings
$999 5 Invalid Belowminincome,maxdwellings
$83,334 5 Invalid Abovemaxincome,maxdwellings
Plotting"monthlyincome"onthex-axisand"numberofdwellings"onthey-axisshowsthe
"locations"ofthetestdatapoints.
Figure4-3:Datapointsontheboundariesanddatapointsjustoutsidetheboundaries.
Notethatfouroftheinputcombinationsareontheboundarieswhileeightarejustoutside.Also
notethatthepointsoutsidealwayscombineonevalidvaluewithoneinvalidvalue(justoneunit
loweroroneunithigher).
Examples
Boundaryvaluetestingisapplicabletothestructure(lengthandcharactertype)ofinputdataas
wellasitsvalue.Considerthefollowingtwoexamples:
Example1
ReferringtotheTradeWebpageoftheBrown&DonaldsonWebsitedescribedinAppendixA,
considertheQuantityfield.Inputtothisfieldcanbebetweenoneandfournumericcharacters
(0,1,...,8,9).Asetofboundaryvaluetestcasesforthelengthattributewouldbe{0,1,4,5}
numericcharacters.
Example2
Again,ontheTradepage,considertheQuantityfield,butthistimeforvalueratherthan
structure(lengthandcharactertype).WhetherthetransactionisBuyorSell,theminimum
legitimatevalueis1souse{0,1,2}forboundarytesting.Theupperlimitonthisfield'svalueis
morecomplicated.IfthetransactionisSell,whatisthemaximumnumberofsharesthatcanbe
sold?Itisthenumbercurrentlyowned.Forthisboundaryuse{sharesOwned-1,sharesOwned,
sharesOwned+1}.IfthetransactionisBuy,themaximumvalue(numberofsharestobe
purchased)isdefinedas
shares=(accountBalance-commission)/sharePrice
assumingafixedcommission.Use{shares-1,shares,shares+1}astheboundaryvaluetest
cases.
ApplicabilityandLimitations
Boundaryvaluetestingcansignificantlyreducethenumberoftestcasesthatmustbecreated
andexecuted.Itismostsuitedtosystemsinwhichmuchoftheinputdatatakesonvalues
withinrangesorwithinsets.
Boundaryvaluetestingisequallyapplicableattheunit,integration,system,andacceptance
testlevels.Allitrequiresareinputsthatcanbepartitionedandboundariesthatcanbeidentified
basedonthesystem'srequirements.
Summary
Whileequivalenceclasstestingisuseful,itsgreatestcontributionistoleadusto
boundaryvaluetesting.
Boundaryvaluetestingisatechniqueusedtoreducethenumberoftestcasestoa
manageablesizewhilestillmaintainingreasonablecoverage.
Boundaryvaluetestingfocusesontheboundariesbecausethatiswheresomany
defectshide.Experiencedtestershaveencounteredthissituationmanytimes.
Inexperiencedtestersmayhaveanintuitivefeelthatmistakeswilloccurmostoftenat
theboundaries.
Createtestcasesforeachboundaryvaluebychoosingonepointontheboundary,one
pointjustbelowtheboundary,andonepointjustabovetheboundary."Below"and
"above"arerelativetermsanddependonthedatavalue'sunits.
Practice
1. ThefollowingexercisesrefertotheStatelessUniversityRegistrationSystemWeb
sitedescribedinAppendixB.Definetheboundaries,andsuitableboundaryvaluetest
casesforthefollowing:
1. ZIPCode—fivenumericdigits.
2. FirstconsiderZIPCodejustintermsofdigits.Then,determinethelowest
andhighestlegitimateZIPCodesintheUnitedStates.Forextracredit[1],
determinetheformatofpostalcodesforCanadaandthelowestandhighest
validvalues.
3. LastName—onethroughfifteencharacters(includingalphabeticcharacters,
periods,hyphens,apostrophes,spaces,andnumbers).Forextracredit[2]
createafewverycomplexLastNames.Canyoudeterminethe"rules"for
legitimateLastNames?Foradditionalextracredit[3]useaphonebookfrom
anothercountry—tryFinlandorThailand.
4. UserID—eightcharactersatleasttwoofwhicharenotalphabetic(numeric,
special,nonprinting).
5. CourseID—threealphacharactersrepresentingthedepartmentfollowedby
asix-digitintegerwhichistheuniquecourseidentificationnumber.The
possibledepartmentsare:
PHY-Physics
EGR-Engineering
ENG-English
LAN-Foreignlanguages
CHM-Chemistry
MAT-Mathematics
PED-Physicaleducation
SOC-Sociology
[1]Thereactuallyisnoextracredit,sodoitforfun.
[2]Thereactuallyisnoextracredit,sodoitforfun.
[3]Thereactuallyisnoextracredit,sodoitforfun.
References
Beizer,Boris(1990).SoftwareTestingTechniques.VanNostrandReinhold.
Gilb,TomandDorothyGraham(1993).SoftwareInspection.Addison-Wesley.ISBN0-
201-63181-4.
Myers,GlenfordJ.(1979).TheArtofSoftwareTesting.JohnWiley&Sons.
Chapter5:DecisionTableTesting
I'dstumbledontosolvingmyfirstmurdercase,havingfoundmyselftheonlyeyewitness,
yetnomatterhowfranticallyIpleadedwithJohnLawthattheperpwasrightinfrontof
themandtheverydamethey'dbeengrilling-thesultrybutdeviousMissKitwinkle,who
playedthegrievingpatsythewayaconcertpianistplayerplaysapiano-thecopsjust
keptsmilingandstuffingcrackersinmybeak.
—ChrisEsco
Introduction
Decisiontablesareanexcellenttooltocapturecertainkindsofsystemrequirementsandto
documentinternalsystemdesign.Theyareusedtorecordcomplexbusinessrulesthata
systemmustimplement.Inaddition,theycanserveasaguidetocreatingtestcases.
Decisiontablesareavitaltoolinthetester'spersonaltoolbox.Unfortunately,manyanalysts,
designers,programmers,andtestersarenotfamiliarwiththistechnique.
Technique
Decisiontablesrepresentcomplexbusinessrulesbasedonasetofconditions.Thegeneral
formis:
Table5-1:Thegeneralformofadecisiontable.
Rule1 Rule2 … Rulep
Conditions
Condition-1
Condition-2
Condition-m
Actions
Action-1
Action-2
Action-n
Conditions1throughmrepresentvariousinputconditions.Actions1throughnaretheactions
thatshouldbetakendependingonthevariouscombinationsofinputconditions.Eachofthe
rulesdefinesauniquecombinationofconditionsthatresultintheexecution("firing")ofthe
actionsassociatedwiththatrule.Notethattheactionsdonotdependontheorderinwhichthe
conditionsareevaluated,butonlyontheirvalues.(Allvaluesareassumedtobeavailable
simultaneously.)Also,actionsdependonlyonthespecifiedconditions,notonanypreviousinput
conditionsorsystemstate.
Perhapsaconcreteexamplewillclarifytheconcepts.Anautoinsurancecompanygives
discountstodriverswhoaremarriedand/orgoodstudents.Let'sbeginwiththeconditions.The
followingdecisiontablehastwoconditions,eachoneofwhichtakesonthevaluesYesorNo.
Table5-2:Adecisiontablewithtwobinaryconditions.
Rule1 Rule2 Rule3 Rule4
Conditions
Married? Yes Yes No No
GoodStudent? Yes No Yes No
Notethatthetablecontainsallcombinationsoftheconditions.Giventwobinaryconditions(Yes
orNo),thepossiblecombinationsare{Yes,Yes},{Yes,No},{No,Yes},and{No,No}.Eachrule
representsoneofthesecombinations.Asatesterwewillverifythatallcombinationsofthe
conditionsaredefined.Missingacombinationmayresultindevelopingasystemthatmaynot
processaparticularsetofinputsproperly.
Nowfortheactions.Eachrulecausesanactionto"fire."Eachrulemayspecifyanaction
uniquetothatrule,orrulesmayshareactions.
Table5-3:Addingasingleactiontoadecisiontable.
Rule1 Rule2 Rule3 Rule4
Conditions
Married? Yes Yes No No
GoodStudent? Yes No Yes No
Actions
Discount($) 60 25 50 0
Decisiontablesmayspecifymorethanoneactionforeachrule.Again,theserulesmaybe
uniqueormaybeshared.
Table5-4:Adecisiontablewithmultipleactions.
Rule1 Rule2 Rule3 Rule4
Conditions
Condition-1 Yes Yes No No
Condition-2 Yes No Yes No
Actions
Action-1 DoX DoY DoX DoZ
Action-2 DoA DoB DoB DoB
Inthissituation,choosingtestcasesissimple—eachrule(verticalcolumn)becomesatest
case.TheConditionsspecifytheinputsandtheActionsspecifytheexpectedresults.
Whilethepreviousexampleusessimplebinaryconditions,conditionscanbemorecomplex.
Table5-5:Adecisiontablewithnon-binaryconditions.
Rule1 Rule2 Rule3 Rule4
Conditions
Condition-1 0–1 1–10 10–100 100–1000
Condition-2 <5 5 6or7 >7
Actions
Action-1 DoX DoY DoX DoZ
Action-2 DoA DoB DoB DoB
Inthissituationchoosingtestcasesisslightlymorecomplex—eachrule(verticalcolumn)
becomesatestcasebutvaluessatisfyingtheconditionsmustbechosen.Choosingappropriate
valueswecreatethefollowingtestcases:
Table5-6:Sampletestcases.
TestCaseID Condition-1 Condition-2 ExpectedResult
TC1 0 3 DoX/DoA
TC2 5 5 DoY/DoB
TC3 50 7 DoX/DoB
TC4 500 10 DoZ/DoB
Ifthesystemundertesthascomplexbusinessrules,andifyourbusinessanalystsordesigners
havenotdocumentedtheserulesinthisform,testersshouldgatherthisinformationand
representitindecisiontableform.Thereasonissimple.Giventhesystembehavior
representedinthiscompleteandcompactform,testcasescanbecreateddirectlyfromthe
decisiontable.
Intesting,createatleastonetestcaseforeachrule.Iftherule'sconditionsarebinary,asingle
testforeachcombinationisprobablysufficient.Ontheotherhand,ifaconditionisarangeof
values,considertestingatboththelowandhighendoftherange.Inthiswaywemergethe
ideasofBoundaryValuetestingwithDecisionTabletesting.
Key
Point Createatleastonetestcaseforeachrule.
Tocreateatestcasetablesimplychangetherowandcolumnheadings:
Table5-7:Adecisiontableconvertedtoatestcasetable.
TestCase1 TestCase2 TestCase3 TestCase4
Inputs
Condition-1 Yes Yes No No
Condition-2 Yes No Yes No
ExpectedResults
Action-1 DoX DoY DoX DoZ
Action-2 DoA DoB DoB DoB
Examples
DecisionTabletestingcanbeusedwheneverthesystemmustimplementcomplexbusiness
rules.Considerthefollowingtwoexamples:Example1
ReferringtotheTradeWebpageoftheBrown&DonaldsonWebsitedescribedinAppendixA,
considertherulesassociatedwithaBuyorder.
Table5-8:AdecisiontablefortheBrown&DonaldsonBuyorder.
Rule1 Rule2 Rule3 Rule4 Rule5 Rule6 Rule7 Rule8
Conditions
ValidSymbol No No No No Yes Yes Yes Yes
ValidQuantity No No Yes Yes No No Yes Yes
SufficientFunds No Yes No Yes No Yes No Yes
Actions
Buy? No No No No No No No Yes
Admittedly,theoutcomeisreadilyapparent.Onlywhenavalidsymbol,validquantity,and
sufficientfundsareavailableshouldtheBuyorderbeplaced.Thisexamplewaschosento
illustrateanotherconcept.
Examinethefirstfourcolumns.IftheSymbolisnotvalid,noneoftheotherconditionsmatter.
Oftentableslikethisarecollapsed,rulesarecombined,andtheconditionsthatdonotaffect
theoutcomearemarked"DC"for"Don'tCare."Rule1nowindicatesthatiftheSymbolisnot
valid,ignoretheotherconditionsanddonotexecutetheBuyorder.
Table5-9:Acollapseddecisiontablereflecting"Don'tCare"conditions.
Rule1 Rule2 Rule3 Rule4 Rule5
Conditions
ValidSymbol No Yes Yes Yes Yes
ValidQuantity DC No No Yes Yes
SufficientFunds DC No Yes No Yes
Actions
Buy? No No No No Yes
NotealsothatRule2andRule3canbecombinedbecausewhetherSufficientFundsare
availabledoesnotaffecttheaction.
Table5-10:Afurthercollapseddecisiontablereflecting"Don'tCare"conditions.
Rule1 Rule2 Rule3 Rule4
Conditions
ValidSymbol No Yes Yes Yes
ValidQuantity DC No Yes Yes
SufficientFunds DC DC No Yes
Actions
Buy? No No No Yes
Whilethisisanexcellentideafromadevelopmentstandpointbecauselesscodeiswritten,itis
dangerousfromatestingstandpoint.Itisalwayspossiblethatthetablewascollapsed
incorrectlyorthecodewaswrittenimproperly.Theun-collapsedtableshouldalwaysbeused
asthebasisforourtestcasedesign.
Example2
ThefollowingscreenisfromtheStatelessUniversityRegistrationSystem.Itisusedtoenter
newstudentsintothesystem,tomodifystudentinformation,andtodeletestudentsfromthe
system.
Figure5-1:SURSStudentDatabaseMaintenanceScreen.
Toenteranewstudent,entername,address,andtelephoneinformationontheupperpartof
thescreenandpressEnter.Thestudentisenteredintothedatabaseandthesystemreturnsa
newStudentID.Tomodifyordeleteastudent,entertheStudentID,selecttheDeleteorModify
radiobuttonandpressEnter.Thedecisiontablereflectingtheserulesfollows:
Table5-11:AdecisiontableforStatelessUniversityRegistrationSystem.
Table5-11:AdecisiontableforStatelessUniversityRegistrationSystem.
Rule
1
Rule
2
Rule
3
Rule
4
Rule
5
Rule
6
Rule
7
Rule
8
Rule
9
Rule
10
Rule
11
Rule
12
Rule
13
Rule
14
Rule
Conditions
Entered
Student
data
No No No No No No No No Yes Yes Yes Yes Yes Yes Yes
Entered
Student
ID
No No No No Yes Yes Yes Yes No No No No Yes Yes Yes
Selected
Modify No No Yes Yes No No Yes Yes No No Yes Yes No No Yes
Selected
Delete No Yes No Yes No Yes No Yes No Yes No Yes No Yes
Actions
Create
new
student
No No No No No No No No Yes No No No No No
Modify
Student No No No No No No Yes No No No Yes No No No
Delete
Student No No No No No Yes No No No No No No No No
Rules1through8indicatethatnodatawasenteredaboutthestudent.Rules1through4
indicatethatnoStudentIDwasenteredforthestudent,thusnoactionispossible.Rules5
through8indicatetheStudentIDwasentered.InthesecasescreatinganewStudentisnot
proper.Rule5doesnotrequesteithermodificationordeletionsoneitherisdone.Rules6and7
requestonefunctionandsotheyareperformed.NotethatRule8indicatesthatboth
modificationanddeletionaretobeperformedsonoactionistaken.
Rules9through16indicatethatdatawasenteredaboutthestudent.Rules9through12
indicatethatnoStudentIDwasenteredsotheserulesrefertoanewstudent.Rule9createsa
newstudent.Rule10deletesthestudent.Rule11allowsmodificationofthestudent'sdata.
Rule12requeststhatbothmodificationanddeletionaretobeperformedsonoactionistaken.
Rules13through16supplystudentdataindicatinganewstudentbutalsoprovideaStudentID
indicatinganexistingstudent.Becauseofthiscontradictoryinput,noactionistaken.Often,
errormessagesaredisplayedinthesesituations.
ApplicabilityandLimitations
DecisionTabletestingcanbeusedwheneverthesystemmustimplementcomplexbusiness
ruleswhentheserulescanberepresentedasacombinationofconditionsandwhenthese
conditionshavediscreteactionsassociatedwiththem.
Summary
Decisiontablesareusedtodocumentcomplexbusinessrulesthatasystemmust
implement.Inaddition,theyserveasaguidetocreatingtestcases.
Conditionsrepresentvariousinputconditions.Actionsaretheprocessesthatshouldbe
executeddependingonthevariouscombinationsofinputconditions.Eachruledefinesa
uniquecombinationofconditionsthatresultintheexecution("firing")oftheactions
associatedwiththatrule.
Createatleastonetestcaseforeachrule.Iftherule'sconditionsarebinary,asingle
testforeachcombinationisprobablysufficient.Ontheotherhand,ifaconditionisa
rangeofvalues,considertestingatboththelowandhighendoftherange.
Practice
1. AttendingStatelessUniversityisanexpensiveproposition.Afterall,theyreceiveno
statefunding.Likemanyotherstudents,thoseplanningonattendingapplyforstudent
aidusingFAFSA,theFreeApplicationforFederalStudentAid.Thefollowing
instructionsweretakenfromthatform.Examinethemandcreateadecisiontablethat
representstheFAFSArules.(Note:Youcan'tmakeupstufflikethis.)
StepFour:Whoisconsideredaparentinthisstep?
Readthesenotestodeterminewhoisconsideredaparentforpurposesofthisform.
AnswerallquestionsinStepFouraboutthem,evenifyoudonotlivewiththem.
Areyouanorphan,orareyouorwereyou(untilage18)award/dependentofthe
court?IfYes,skipStepFour.Ifyourparentsarebothlivingandmarriedtoeach
other,answerthequestionsaboutthem.Ifyourparentiswidowedorsingle,answer
thequestionsaboutthatparent.Ifyourwidowedparentisremarriedasoftoday,
answerthequestionsaboutthatparentandthepersonwhomyourparentmarried
(yourstepparent).Ifyourparentsaredivorcedorseparated,answerthequestions
abouttheparentyoulivedwithmoreduringthepast12months.(Ifyoudidnotlive
withoneparentmorethantheother,giveanswersabouttheparentwhoprovided
morefinancialsupportduringthelast12months,orduringthemostrecentyearthat
youactuallyreceivedsupportfromaparent.)Ifthisparentisremarriedasoftoday,
answerthequestionsontherestofthisformaboutthatparentandthepersonwhom
yourparentmarried(yourstepparent).
References
Beizer,Boris(1990).SoftwareTestingTechniques(SecondEdition).VanNostrand
Reinhold.
Binder,RobertV.(2000).TestingObject-OrientedSystems:Models,Patterns,and
Tools.Addison-Wesley.
Chapter6:PairwiseTesting
AntonwasattractedtoAngelalikeamothtoaflame-notjustanymoth,butoneofthe
giantsilkmothsofthegenusHyalophora,perhapsHyalophoraeuryalus,whosegreat
red-brownwingswithwhitebasalandpostmedianlinesflapalmostlanguorouslyuntilone
ignitesintheflame,fanningtheconflagrationtoevergreaterheightsuntilburningdown
tothehirsutethoraxandabdomen,thefat-ladencontentsofwhichprovideasatisfying
sizzletoendtheagony.
—AndrewAmlen
Introduction
AstheyusedtosayonMontyPython,"Andnowforsomethingcompletelydifferent."
Considerthesesituations:
AWebsitemustoperatecorrectlywithdifferentbrowsers—InternetExplorer5.0,5.5,
and6.0,Netscape6.0,6.1,and7.0,Mozilla1.1,andOpera7;usingdifferentplug-ins
—RealPlayer,MediaPlayer,ornone;runningondifferentclientoperatingsystems—
Windows95,98,ME,NT,2000,andXP;receivingpagesfromdifferentservers—IIS,
Apache,andWebLogic;runningondifferentserveroperatingsystems—WindowsNT,
2000,andLinux.
WebCombinations
8browsers
3plug-ins
6clientoperatingsystems
3servers
3serverOS
1,296combinations.
Abankhascreatedanewdataprocessingsystemthatisreadyfortesting.Thisbank
hasdifferentkindsofcustomers—consumers,veryimportantconsumers,businesses,
andnon-profits;differentkindsofaccounts—checking,savings,mortgages,consumer
loans,andcommercialloans;theyoperateindifferentstates,eachwithdifferent
regulations—California,Nevada,Utah,Idaho,Arizona,andNewMexico.
BankCombinations
4customertypes
5accounttypes
6states
120combinations.
Inanobject-orientedsystem,anobjectofclassAcanpassamessagecontaininga
parameterPtoanobjectofclassX.ClassesB,C,andDinheritfromAsotheytoocan
sendthemessage.ClassesQ,R,S,andTinheritfromPsotheytoocanbepassed
astheparameter.ClassesYandZinheritfromXsotheytoocanreceivethemessage.
OOCombinations
4senders
5parameters
3receivers
60combinations.
Insight
Studentsinmyclassesoftenhaveaverydifficulttimethinkingofbadwaystodo
things.Cultivatetheskillofchoosingpoorly.Itwillbeinvaluableinevaluatingothers'
ideas.
CanYouBelieveThis?
Astudentinoneofmyclassessharedthisstory:Hisorganizationusesaprocesstheycall
"Post-InstallationTestPlanning."Itsoundsimpressiveuntilyoudecipherit.Whatevertests
theyhappentorunthathappentopassaredocumentedastheirTestPlan.
Whatdotheseverydifferentsituationsallhaveincommon?Eachhasalargenumberof
combinationsthatshouldbetested.Eachhasalargenumberofcombinationsthatmayberisky
ifwedonottest.Eachhassuchalargenumberofcombinationsthatwemaynothavethe
resourcestoconstructandrunallthetests,therearejusttoomany.Wemust,somehow,
selectareasonablysizedsubsetthatwecouldtestgivenourresourceconstraints.Whatare
somewaysofchoosingsuchasubset?Thisliststartswiththeworstschemesbutdoes
improve:
Don'ttestatall.Simplygiveupbecausethenumberofinput
combinations,andthusthenumberoftestcases,isjusttoogreat.
Testallcombinations[once],butdelaytheprojectsoitmissesits
marketwindowsothateveryonequitsfromstress,orthecompany
goesoutofbusiness.
Chooseoneortwotestsandhopeforthebest.
Choosetheteststhatyouhavealreadyrun,perhapsaspartof
programmer-ledtesting.Incorporatethemintoaformaltestplanand
runthemagain.
Choosetheteststhatareeasytocreateandrun.Ignorewhetherthey
provideusefulinformationaboutthequalityoftheproduct.
Makealistofallthecombinationsandchoosethefirstfew.
Makealistofallthecombinationsandchoosearandomsubset.
Bymagic,chooseaspeciallyselected,fairlysmallsubsetthatfindsa
greatmanydefects—morethanyouwouldexpectfromsuchasubset.
Thislastschemesoundslikeawinner(butitisalittlevague).Thequestionis—whatisthe
"magic"thatallowsustochoosethat"speciallyselected"subset?
Insight Randomselectioncanbeaverygoodapproachtochoosingasubsetbutmost
peoplehaveadifficulttimechoosingtrulyrandomly.
Theanswerisnottoattempttotestallthecombinationsforallthevaluesforallthevariables
buttotestallpairsofvariables.Thissignificantlyreducesthenumberofteststhatmustbe
createdandrun.Considerthesignificantreductionsintesteffortintheseexamples:
Ifasystemhadfourdifferentinputparametersandeachonecouldtakeononeof
threedifferentvalues,thenumberofcombinationsis34whichis81.Itispossibleto
coverallthepairwiseinputcombinationsinonlyninetests.
Ifasystemhadthirteendifferentinputparametersandeachonecouldtakeononeof
threedifferentvalues,thenumberofcombinationsis313whichis1,594,323.Itis
possibletocoverallthepairwiseinputcombinationsinonlyfifteentests.
Ifasystemhadtwentydifferentinputparametersandeachonecouldtakeononeof
tendifferentvalues,thenumberofcombinationsis1020.Itispossibletocoverallthe
pairwiseinputcombinationsinonly180tests.
Thereismuchanecdotalevidenceaboutthebenefitofpairwisetesting.Unfortunately,thereare
onlyafewdocumentedstudies:
InacasestudypublishedbyBrownlieofAT&Tregardingthetestingofalocal-area
network-basedelectronicmailsystem,pairwisetestingdetected28percentmore
defectsthantheiroriginalplanofdevelopingandexecuting1,500testcases(later
reducedto1,000becauseoftimeconstraints)andtook50percentlesseffort.
AstudybytheNationalInstituteofStandardsandTechnologypublishedbyWallaceand
Kuhnonsoftwaredefectsinrecalledmedicaldevicesreviewedfifteenyearsofdefect
data.Theyconcludedthat98percentofthereportedsoftwareflawscouldhavebeen
detectedbytestingallpairsofparametersettings.
KuhnandReillyanalyzeddefectsrecordedintheMozillaWebbrowserdatabase.They
determinedthatpairwisetestingwouldhavedetected76percentofthereported
errors.
Whydoespairwisetestingworksowell?Idon'tknow.Thereisnounderlying"software
physics"thatrequiresit.Onehypothesisisthatmostdefectsareeithersingle-modedefects
(thefunctionundertestsimplydoesnotworkandanytestofthatfunctionwouldfindthe
defect)ortheyaredouble-modedefects(itisthepairingofthisfunction/modulewiththat
function/modulethatfailseventhoughallotherpairingsperformproperly).Pairwisetesting
definesaminimalsubsetthatguidesustotestforallsingle-modeanddouble-modedefects.
Thesuccessofthistechniqueonmanyprojects,bothdocumentedandundocumented,isa
greatmotivationforitsuse.
Note
Pairwisetestingmaynotchoosecombinationswhichthedevelopersandtestersknow
areeitherfrequentlyusedorhighlyrisky.Ifthesecombinationsexist,usethepairwise
tests,thenaddadditionaltestcasestominimizetheriskofmissinganimportant
combination.
Technique
Twodifferenttechniquesareusedtoidentifyallthepairsforcreatingtestcases—orthogonal
arraysandtheAllpairsalgorithm.
OrthogonalArrays
Whatareorthogonalarrays?TheoriginoforthogonalarrayscanbetracedbacktoEuler,the
greatmathematician,intheguiseofLatinSquares.GenichiTaguchihaspopularizedtheirusein
hardwaretesting.AnexcellentreferencebookisQualityEngineeringUsingRobustDesignby
MadhavS.Phadke.
Considerthenumbers1and2.Howmanypaircombinations(combinationstakentwoatatime)
of'1'and'2'exist?{1,1},{1,2},{2,1}and{2,2}.Anorthogonalarrayisatwo-dimensionalarray
ofnumbersthathasthisinterestingproperty—chooseanytwocolumnsinthearray.Allthe
pairwisecombinationsofitsvalueswilloccurineverypairofcolumns.Let'sexamineanL4(23)
array:
Table6-1:L4(23)OrthogonalArray
1 2 3
11 1 1
21 2 2
32 1 2
42 2 1
Thegraycolumnheadingsandrownumbersarenotpartoftheorthogonalarraybutare
includedforconvenienceinreferencingthecells.Examinecolumns1and2—dothefour
combinationsof1and2allappearinthatcolumnpair?Yes,andintheorderlistedearlier.Now
examinecolumns1and3—dothefourcombinationsof1and2appearinthatcolumnpair?
Yes,althoughinadifferentorder.Finally,examinecolumns2and3—dothefourcombinations
appearinthatcolumnpairalso?Yestheydo.TheL4(23)arrayisorthogonal;thatis,choose
anytwocolumns,allthepairwisecombinationswilloccurinallthecolumnpairs.
Important
Note
Asatesteryoudonothavetocreateorthogonalarrays,allyoumustdois
locateoneofthepropersize.Books,Websites,andautomatedtoolswill
helpyoudothis.
Anoteaboutthecurious(butstandard)notation:L4meansanorthogonalarraywithfourrows,
(23)isnotanexponent.Itmeansthatthearrayhasthreecolumns,eachwitheithera1ora2.
Figure6-1:Orthogonalarraynotation Let'sconsideralargerorthogonal
array.Giventhenumbers1,2and3,howmanypaircombinationsof1,2,and3exist?{1,1},
{1,2},{1,3},{2,1},{2,2},{2,3},{3,1},{3,2},and{3,3}.BelowisanL9(34)array:
Table6-2:L9(34)OrthogonalArray
1 2 3 4
1 1 1 1 1
2 1 2 2 2
3 1 3 3 3
4 2 1 2 3
5 2 2 3 1
6 2 3 1 2
7 3 1 3 2
8 3 2 1 3
9 3 3 2 1
Examinecolumns1and2—dotheninecombinationsof1,2,and3allappearinthatcolumn
pair?Yes.Nowexaminecolumns1and3—dotheninecombinationsof1,2,and3appearin
thatcolumnpair?Yes,althoughinadifferentorder.Examinecolumns1and4—dothenine
combinationsappearinthatcolumnpairalso?Yestheydo.Continueonbyexaminingother
pairsofcolumns—2and3,2and4,andfinally3and4.TheL9(34)arrayisorthogonal;that
is,chooseanytwocolumns,allthecombinationswilloccurinallofthecolumnpairs.
Tool
TherdExperttoolfromPhadkeAssociatesimplementstheorthogonalarrayapproach.
Seehttp://www.phadkeassociates.com
Notethatnotallcombinationsof1s,2s,and3sappearinthearray.Forexample,{1,1,2},
{1,2,1},and{2,2,2)donotappear.Orthogonalarraysonlyguaranteethatallthepair
combinationsexistinthearray.Combinationssuchas{2,2,2}aretriples,notpairs.
ThefollowingisanL18(35)orthogonalarray.Ithasfivecolumns,eachcontaininga1,2,or3.
Examinecolumns1and2forthepair{1,1}.Doesthatpairexistinthosetwocolumns?Wait!
Don'tlookatthearray.Fromthedefinitionofanorthogonalarray,whatistheanswer?Yes,
thatpairexistsalongwitheveryotherpairof1,2,and3.Thepair{1,1}isinrow1.Notethat
{1,1}alsoappearsinrow6.Returningtotheoriginaldescriptionoforthogonalarrays,
Anorthogonalarrayisatwo-dimensionalarrayofnumbersthathasthisinteresting
property—chooseanytwocolumnsinthearray.Allthepairwisecombinationsofits
valueswilloccurineverycolumnpair.
Thisdefinitionisnottotallycomplete.Notonlywillallthepaircombinationsoccurinthe
array,butifanypairoccursmultipletimes,allpairswilloccurthatsamenumberoftimes.
Thisisbecauseorthogonalarraysare"balanced."Examinecolumns3and5—lookfor{3,2}.
Thatcombinationappearsinrows6and17.
Table6-3:L18(35)OrthogonalArray
12345
1 1 1 1 1 1
2 1 2 3 3 1
3 1 3 2 3 2
4 1 2 2 1 3
5 1 3 1 2 3
6 1 1 3 2 2
7 2 2 2 2 2
8 2 3 1 1 2
9 2 1 3 1 3
10 2 3 3 2 1
11 2 1 2 3 1
12 2 2 1 3 3
13 3 3 3 3 3
14 3 1 2 2 3
15 3 2 1 2 1
16 3 1 1 3 2
17 3 2 3 1 2
18 3 3 2 1 1
Inorthogonalarraysnotallofthecolumnsmusthavethesamerangeofvalues(1..2,1..3,
1..5,etc.).Someorthogonalarraysaremixed.ThefollowingisanL18(2137)orthogonal
array.Ithasonecolumnof1sand2s,andsevencolumnsof1s,2s,and3s.
Table6-4:L18(2137)OrthogonalArray
12345678
1 11111111
2 11222222
3 11333333
4 12112233
5 12223311
6 12331122
7 13121323
8 13232131
9 13313212
10 21133221
11 21211332
12 21322113
13 22123132
14 22231213
15 22312321
16 23132312
17 23213123
18 23321231
Reference
NeilJ.A.Sloanemaintainsaverycomprehensivecatalogoforthogonalarraysat
http://www.research.att.com/~njas/oadir/index.html
UsingOrthogonalArrays
Theprocessofusingorthogonalarraystoselectpairwisesubsetsfortestingis:
1. Identifythevariables.
2. Determinethenumberofchoicesforeachvariable.
3. Locateanorthogonalarraywhichhasacolumnforeachvariableandvalueswithinthe
columnsthatcorrespondtothechoicesforeachvariable.
4. Mapthetestproblemontotheorthogonalarray.
5. Constructthetestcases.
Ifthisseemsrathervagueatthispointit'stimeforanexample.
Web-basedsystemssuchasBrown&DonaldsonandtheStatelessUniversityRegistration
Systemmustoperateinanumberofenvironments.Let'sexecutetheprocessstep-by-step
usinganorthogonalarraytochoosetestcases.Considerthefirstexampleintheintroduction
describingthesoftwarecombinationsaWebsitemustoperatewith.
1. Identifythevariables.
ThevariablesareBrowser,Plug-in,Clientoperatingsystem,Server,andServer
operatingsystem.
2. Determinethenumberofchoicesforeachvariable.
Browser-InternetExplorer5.0,5.5,and6.0,Netscape6.0,6.1,and7.0,Mozilla1.1,
andOpera7(8choices).
Plug-in-None,RealPlayer,andMediaPlayer(3choices).
Clientoperatingsystem-Windows95,98,ME,NT,2000,andXP(6choices).
Server-IIS,Apache,andWebLogic(3choices).
Serveroperatingsystem-WindowsNT,2000,andLinux(3choices).
Multiplying8x3x6x3x3wefindthereare1,296combinations.For"complete"test
coverage,eachofthesecombinationsshouldbetested.
3. Locateanorthogonalarraythathasacolumnforeachvariableandvalues
withinthecolumnsthatcorrespondtothechoicesofeachvariable.
Whatsizearrayisneeded?First,itmusthavefivecolumns,oneforeachvariablein
thisexample.Thefirstcolumnmustsupporteightdifferentlevels(1through8).The
secondcolumnmustsupportthreelevels(1through3).Thethirdrequiressixlevels.
Thefourthandthefiftheachrequirethreelevels.Theperfectsizeorthogonalarray
wouldbe816133(onecolumnof1through8,onecolumnof1through6,andthree
columnsof1through3).Unfortunately,oneofthisexactsizedoesnotexist.When
thisoccurs,wesimplypickthenextlargerarray.
Important Asatesteryoudonothavetocreateorthogonalarrays.Allyou
Note mustdoislocateoneofthepropersizeandthenperformthe
mappingofthetestproblemontothearray.
Thefollowingorthogonalarraymeetsourrequirements.It'sanL64(8243)array.
OrthogonalarrayscanbefoundinanumberofbooksandontheWeb.Afavorite
bookisQualityEngineeringUsingRobustDesignbyMadhavS.Phadke.Inaddition,
anexcellentcatalogismaintainedontheWebbyNeilJ.A.SloaneofAT&T.See
http://www.research.att.com/~njas/oadir/index.html.
Therequirementof8161(onecolumnof1through8and1columnof1through6)is
metby82(twocolumnsof1through8).Therequirementof33(threecolumnsof1
through3)ismetby43(threecolumnsof1through4).
Thenumberofcombinationsofallthevaluesofallthevariablesis1,296andthus
1,296testcasesshouldbecreatedandrunforcompletecoverage.Usingthis
orthogonalarray,allpairsofallthevaluesofallthevariablescanbecoveredinonly
sixty-fourtests,a95percentreductioninthenumberoftestcases.
Table6-5:L64(8243)OrthogonalArray
12345
1 11111
2 14344
3 14244
4 11411
5 13533
6 12722
7 12622
8 13833
9 34133
10 31322
11 31222
12 34433
13 32511
14 33744
15 33644
16 32811
17 23121
18 22334
19 22234
20 23421
21 21543
22 24712
23 24612
24 21843
25 42143
26 43312
27 43212
28 42443
29 44521
30 41734
31 41634
32 44821
33 52142
34 53313
35 53213
36 52442
37 54524
38 51731
39 51631
40 54824
41 73124
42 72331
43 72231
44 73424
45 71542
46 74713
47 74613
48 71842
49 64132
50 61323
51 61223
52 64432
53 62514
54 63741
55 63641
56 62814
57 81114
58 84341
59 84241
60 81414
61 83532
62 82723
63 82623
64 83832
4. Mapthetestproblemontotheorthogonalarray.
TheBrowserchoiceswillbemappedontocolumn1oftheorthogonalarray.Cells
containinga1willrepresentIE5.0;cellswitha2willrepresentIE5.5;cellswitha3
willrepresentIE6.0;etc.Themappingis:
1↔IE5.0
2↔IE5.5
3↔IE6.0
4↔Netscape6.0
5↔Netscape6.1
6↔Netscape7.0
7↔Mozilla1.1
8↔Opera7
Partiallyfillinginthefirstcolumngives:
Table6-6:L64(8243)withapartialmappingofitsfirstcolumn.
Browser 2 3 4 5
1 IE5.0 1 1 1 1
2 1 4 3 4 4
3 1 4 2 4 4
4 1 1 4 1 1
5 1 3 5 3 3
6 1 2 7 2 2
7 1 2 6 2 2
8 1 3 8 3 3
9 IE6.0 4 1 3 3
10 3 1 3 2 2
11 3 1 2 2 2
12 3 4 4 3 3
13 3 2 5 1 1
14 3 3 7 4 4
15 3 3 6 4 4
16 3 2 8 1 1
17 IE5.5 3 1 2 1
18 2 2 3 3 4
19 2 2 2 3 4
20 2 3 4 2 1
21 2 1 5 4 3
22 2 4 7 1 2
23 2 4 6 1 2
24 2 1 8 4 3
25 Net6.0 2 1 4 3
26 4 3 3 1 2
27 4 3 2 1 2
28 4 2 4 4 3
29 4 4 5 2 1
30 4 1 7 3 4
31 4 1 6 3 4
32 4 4 8 2 1
33 Net6.1 2 1 4 2
34 5 3 3 1 3
35 5 3 2 1 3
36 5 2 4 4 2
37 5 4 5 2 4
38 5 1 7 3 1
39 5 1 6 3 1
40 5 4 8 2 4
41 Moz1.1 3 1 2 4
42 7 2 3 3 1
43 7 2 2 3 1
44 7 3 4 2 4
45 7 1 5 4 2
46 7 4 7 1 3
47 7 4 6 1 3
48 7 1 8 4 2
49 Net7.0 4 1 3 2
50 6 1 3 2 3
51 6 1 2 2 3
52 6 4 4 3 2
53 6 2 5 1 4
54 6 3 7 4 1
55 6 3 6 4 1
56 6 2 8 1 4
57 Opera7 1 1 1 4
58 8 4 3 4 1
59 8 4 2 4 1
60 8 1 4 1 4
61 8 3 5 3 2
62 8 2 7 2 3
63 8 2 6 2 3
64 8 3 8 3 2
Isitclearwhatishappening?Incolumn1(whichwehavechosentorepresentthe
Browser)everycellcontaininga1isbeingreplacedwith"IE5.0."Everycell
containinga2isbeingreplacedwith"IE5.5."Everycellcontainingan8isbeing
replacedwith"Opera7,"etc.
We'llcontinuebycompletingthemapping(replacement)ofallthecellsincolumn1.
Notethatthemappingbetweenthevariablevaluesandthe1s,2s,and3sistotally
arbitrary.Thereisnologicalconnectionbetween"1"andIE5.0or"7"andMozilla1.1.
But,althoughtheinitialassignmentisarbitrary,oncechosen,theassignmentsanduse
mustremainconsistentwithineachcolumn.
Table6-7:L64(8243)withafullmappingofitsfirstcolumn.
Browser 2 3 4 5
1 IE5.0 1 1 1 1
2 IE5.0 4 3 4 4
3 IE5.0 4 2 4 4
4 IE5.0 1 4 1 1
5 IE5.0 3 5 3 3
6 IE5.0 2 7 2 2
7 IE5.0 2 6 2 2
8 IE5.0 3 8 3 3
9 IE6.0 4 1 3 3
10 IE6.0 1 3 2 2
11 IE6.0 1 2 2 2
12 IE6.0 4 4 3 3
13 IE6.0 2 5 1 1
14 IE6.0 3 7 4 4
15 IE6.0 3 6 4 4
16 IE6.0 2 8 1 1
17 IE5.5 3 1 2 1
18 IE5.5 2 3 3 4
19 IE5.5 2 2 3 4
20 IE5.5 3 4 2 1
21 IE5.5 1 5 4 3
22 IE5.5 4 7 1 2
23 IE5.5 4 6 1 2
24 IE5.5 1 8 4 3
25 Net6.0 2 1 4 3
26 Net6.0 3 3 1 2
27 Net6.0 3 2 1 2
28 Net6.0 2 4 4 3
29 Net6.0 4 5 2 1
30 Net6.0 1 7 3 4
31 Net6.0 1 6 3 4
32 Net6.0 4 8 2 1
33 Net6.1 2 1 4 2
34 Net6.1 3 3 1 3
35 Net6.1 3 2 1 3
36 Net6.1 2 4 4 2
37 Net6.1 4 5 2 4
38 Net6.1 1 7 3 1
39 Net6.1 1 6 3 1
40 Net6.1 4 8 2 4
41 Moz1.1 3 1 2 4
42 Moz1.1 2 3 3 1
43 Moz1.1 2 2 3 1
44 Moz1.1 3 4 2 4
45 Moz1.1 1 5 4 2
46 Moz1.1 4 7 1 3
47 Moz1.1 4 6 1 3
48 Moz1.1 1 8 4 2
49 Net7.0 4 1 3 2
50 Net7.0 1 3 2 3
51 Net7.0 1 2 2 3
52 Net7.0 4 4 3 2
53 Net7.0 2 5 1 4
54 Net7.0 3 7 4 1
55 Net7.0 3 6 4 1
56 Net7.0 2 8 1 4
57 Opera7 1 1 1 4
58 Opera7 4 3 4 1
59 Opera7 4 2 4 1
60 Opera7 1 4 1 4
61 Opera7 3 5 3 2
62 Opera7 2 7 2 3
63 Opera7 2 6 2 3
64 Opera7 3 8 3 2
Nowthatthefirstcolumnhasbeenmapped,let'sproceedtothenextone.ThePlug-in
choiceswillbemappedontocolumn2ofthearray.Cellscontaininga1willrepresent
None(Noplug-in);cellswitha2willrepresentRealPlayer;cellswitha3willrepresent
MediaPlayer;cellswitha4willnotbemappedatthepresenttime.Themappingis:
1↔None
2↔RealPlayer
3↔MediaPlayer
4↔Notused(atthistime)
Fillinginthesecondcolumngives:
Table6-8:L64(8243)withafullmappingofitsfirstandsecondcolumns.
Browser Plug-In 3 4 5
1 IE5.0 None 1 1 1
2 IE5.0 4 3 4 4
3 IE5.0 4 2 4 4
4 IE5.0 None 4 1 1
5 IE5.0 MediaPlayer 5 3 3
6 IE5.0 RealPlayer 7 2 2
7 IE5.0 RealPlayer 6 2 2
8 IE5.0 MediaPlayer 8 3 3
9 IE6.0 4 1 3 3
10 IE6.0 None 3 2 2
11 IE6.0 None 2 2 2
12 IE6.0 4 4 3 3
13 IE6.0 RealPlayer 5 1 1
14 IE6.0 MediaPlayer 7 4 4
15 IE6.0 MediaPlayer 6 4 4
16 IE6.0 RealPlayer 8 1 1
17 IE5.5 MediaPlayer 1 2 1
18 IE5.5 RealPlayer 3 3 4
19 IE5.5 RealPlayer 2 3 4
20 IE5.5 MediaPlayer 4 2 1
21 IE5.5 None 5 4 3
22 IE5.5 4 7 1 2
23 IE5.5 4 6 1 2
24 IE5.5 None 8 4 3
25 Net6.0 RealPlayer 1 4 3
26 Net6.0 MediaPlayer 3 1 2
27 Net6.0 MediaPlayer 2 1 2
28 Net6.0 RealPlayer 4 4 3
29 Net6.0 4 5 2 1
30 Net6.0 None 7 3 4
31 Net6.0 None 6 3 4
32 Net6.0 4 8 2 1
33 Net6.1 RealPlayer 1 4 2
34 Net6.1 MediaPlayer 3 1 3
35 Net6.1 MediaPlayer 2 1 3
36 Net6.1 RealPlayer 4 4 2
37 Net6.1 4 5 2 4
38 Net6.1 None 7 3 1
39 Net6.1 None 6 3 1
40 Net6.1 4 8 2 4
41 Moz1.1 MediaPlayer 1 2 4
42 Moz1.1 RealPlayer 3 3 1
43 Moz1.1 RealPlayer 2 3 1
44 Moz1.1 MediaPlayer 4 2 4
45 Moz1.1 None 5 4 2
46 Moz1.1 4 7 1 3
47 Moz1.1 4 6 1 3
48 Moz1.1 None 8 4 2
49 Net7.0 4 1 3 2
50 Net7.0 None 3 2 3
51 Net7.0 None 2 2 3
52 Net7.0 4 4 3 2
53 Net7.0 RealPlayer 5 1 4
54 Net7.0 MediaPlayer 7 4 1
55 Net7.0 MediaPlayer 6 4 1
56 Net7.0 RealPlayer 8 1 4
57 Opera7 None 1 1 4
58 Opera7 4 3 4 1
59 Opera7 4 2 4 1
60 Opera7 None 4 1 4
61 Opera7 MediaPlayer 5 3 2
62 Opera7 RealPlayer 7 2 3
63 Opera7 RealPlayer 6 2 3
64 Opera7 MediaPlayer 8 3 2
Nowthatthefirstandsecondcolumnshavebeenmapped,let'sproceedtomapthe
nextthreecolumnssimultaneously.
ThemappingforClientoperatingsystemis:
1↔Windows95
2↔Windows98
3↔WindowsME
4↔WindowsNT
5↔Windows2000
6↔WindowsXP
7↔Notused(atthistime)
8↔Notused(atthistime)
ThemappingforServersis:
1↔IIS
2↔Apache
3↔WebLogic
4↔Notused(atthistime)
ThemappingforServeroperatingsystemis:
1↔WindowsNT
2↔Windows2000
3↔Linux
4↔Notused(atthistime)
Fillingintheremainderofthecolumnsgives:
Table6-9:L64(8243)withafullmappingofallitscolumns.
Browser Plug-in ClientOS Server ServerOS
1 IE5.0 None Win95 IIS WinNT
2 IE5.0 4 WinME 4 4
3 IE5.0 4 Win98 4 4
4 IE5.0 None WinNT IIS WinNT
5 IE5.0 MediaPlayer Win2000 WebLogic Linux
6 IE5.0 RealPlayer 7 Apache Win2000
7 IE5.0 RealPlayer WinXP Apache Win2000
8 IE5.0 MediaPlayer 8 WebLogic Linux
9 IE6.0 4 Win95 WebLogic Linux
10 IE6.0 None WinME Apache Win2000
11 IE6.0 None Win98 Apache Win2000
12 IE6.0 4 WinNT WebLogic Linux
13 IE6.0 RealPlayer Win2000 IIS WinNT
14 IE6.0 MediaPlayer 7 4 4
15 IE6.0 MediaPlayer WinXP 4 4
16 IE6.0 RealPlayer 8 US WinNT
17 IE5.5 MediaPlayer Win95 Apache WinNT
18 IE5.5 RealPlayer WinME WebLogic 4
19 IE5.5 RealPlayer Win98 WebLogic 4
20 IE5.5 MediaPlayer WinNT Apache WinNT
21 IE5.5 None Win2000 4 Linux
22 IE5.5 4 7 IIS Win2000
23 IE5.5 4 WinXP IIS Win2000
24 IE5.5 None 8 4 Linux
25 Net6.0 RealPlayer Win95 4 Linux
26 Net6.0 MediaPlayer WinME IIS Win2000
27 Net6.0 MediaPlayer Win98 IIS Win2000
28 Net6.0 RealPlayer WinNT 4 Linux
29 Net6.0 4 Win2000 Apache WinNT
30 Net6.0 None 7 WebLogic 4
31 Net6.0 None WinXP WebLogic 4
32 Net6.0 4 8 Apache WinNT
33 Net6.1 RealPlayer Win95 4 Win2000
34 Net6.1 MediaPlayer WinME IIS Linux
35 Net6.1 MediaPlayer Win98 IIS Linux
36 Net6.1 RealPlayer WinNT 4 Win2000
37 Net6.1 4 Win2000 Apache 4
38 Net6.1 None 7 WebLogic WinNT
39 Net6.1 None WinXP WebLogic 1WinNT
40 Net6.1 4 8 Apache 4
41 Moz1.1 MediaPlayer Win95 Apache 4
42 Moz1.1 RealPlayer WinME WebLogic WinNT
43 Moz1.1 RealPlayer Win98 WebLogic WinNT
44 Moz1.1 MediaPlayer WinNT Apache 4
45 Moz1.1 None Win2000 4 Win2000
46 Moz1.1 4 7 IIS Linux
47 Moz1.1 4 WinXP IIS Linux
48 Moz1.1 None 8 4 Win2000
49 Net7.0 4 Win95 WebLogic Win2000
50 Net7.0 None WinME Apache Linux
51 Net7.0 None Win98 Apache Linux
52 Net7.0 4 WinNT WebLogic Win2000
53 Net7.0 RealPlayer Win2000 IIS 4
54 Net7.0 MediaPlayer 7 4 WinNT
55 Net7.0 MediaPlayer WinXP 4 WinNT
56 Net7.0 RealPlayer 8 IIS 4
57 Opera7 None Win95 IIS 4
58 Opera7 4 WinME 4 WinNT
59 Opera7 4 Win98 4 WinNT
60 Opera7 None WinNT IIS 4
61 Opera7 MediaPlayer Win2000 WebLogic Win2000
62 Opera7 RealPlayer 7 Apache Linux
63 Opera7 RealPlayer WinXP Apache Linux
64 Opera7 MediaPlayer 8 WebLogic Win2000
Wereitnotforthefewcellsthatremainunassigned,themappingoftheorthogonal
array,andthustheselectionofthetestcases,wouldbecompleted.Whataboutthe
unassignedcells—first,whydotheyexist?;second,whatshouldbedonewiththem?
Theunassignedcellsexistbecausetheorthogonalarraychosenwas"toobig."The
perfectsizewouldbean816133array;thatis,onecolumnthatvariesfrom1to8;one
columnthatvariesfrom1to6;andthreecolumnsthatvaryfrom1to3.Unfortunately,
thatspecificsizeorthogonalarraydoesnotexist.Orthogonalarrayscannotbe
constructedforanyarbitrarysizeparameters.Theycomeinfixed,"quantum"sizes.
Youcanconstructone"thisbig";youcanconstructone"thatbig";butyoucannot
necessarilyconstructonein-between.FamousSoftwareTesterMickJaggergives
excellentadviceregardingthis,"Youcan'talwaysgetwhatyouwant,Butifyoutry
sometimes,Youjustmightfind,yougetwhatyouneed."
FamousSoftwareTester
Iftheperfectsizearraydoesnotexist,chooseonethatisslightlybiggerandapply
thesetworulestodealwiththe"excess."Thefirstruledealswithextracolumns.If
theorthogonalarraychosenhasmorecolumnsthanneededforaparticulartest
scenario,simplydeletethem.Thearraywillremainorthogonal.Thesecondruledeals
withextravaluesforavariable.Inthecurrentexample,column3runsfrom1to8but
only1through6isneeded.Itistemptingtodeletetherowsthatcontainthesecells
butDON'T.The"orthogonalness"maybelost.Eachrowinthearrayexiststoprovide
atleastonepaircombinationthatappearsnowhereelseinthearray.Ifyoudeletea
row,youlosethattestcase.Insteadofdeletingthem,simplyconverttheextracells
tovalidvalues.Someautomatedtoolsrandomlychoosefromthesetofvalidvalues
foreachcellwhileotherschooseonevalidvalueanduseitineverycellwithina
column.Eitherapproachisacceptable.Usingthissecondapproach,we'llcomplete
theorthogonalarray.Notethatitmaybedifficulttomaintainthe"balanced"aspectof
thearraywhenassigningvaluestotheseextracells.
Table6-10:L64(8243)withafullmappingofallitscolumnsincludingthe
"extra"cells.
Browser Plug-in ClientOS Server ServerOS
1 IE5.0 None Win95 IIS WinNT
2 IE5.0 None WinME IIS WinNT
3 IE5.0 None Win98 IIS WinNT
4 IE5.0 None WinNT IIS WinNT
5 IE5.0 MediaPlayer Win2000 WebLogic Linux
6 IE5.0 RealPlayer Win95 Apache Win2000
7 IE5.0 RealPlayer WinXP Apache Win2000
8 IE5.0 MediaPlayer Win98 WebLogic Linux
9 IE6.0 None Win95 WebLogic Linux
10 IE6.0 None WinME Apache Win2000
11 IE6.0 None Win98 Apache Win2000
12 IE6.0 None WinNT WebLogic Linux
13 IE6.0 RealPlayer Win2000 IIS WinNT
14 IE6.0 MediaPlayer Win95 IIS WinNT
15 IE6.0 MediaPlayer WinXP IIS WinNT
16 IE6.0 RealPlayer Win98 IIS WinNT
17 IE5.5 MediaPlayer Win95 Apache WinNT
18 IE5.5 RealPlayer WinME WebLogic WinNT
19 IE5.5 RealPlayer Win98 WebLogic WinNT
20 IE5.5 MediaPlayer WinNT Apache WinNT
21 IE5.5 None Win2000 IIS Linux
22 IE5.5 None Win95 IIS Win2000
23 IE5.5 None WinXP IIS Win2000
24 IE5.5 None Win98 IIS Linux
25 Net6.0 RealPlayer Win95 IIS Linux
26 Net6.0 MediaPlayer WinME IIS Win2000
27 Net6.0 MediaPlayer Win98 IIS Win2000
28 Net6.0 RealPlayer WinNT IIS Linux
29 Net6.0 None Win2000 Apache WinNT
30 Net6.0 None Win95 WebLogic WinNT
31 Net6.0 None WinXP WebLogic WinNT
32 Net6.0 None Win98 Apache WinNT
33 Net6.1 RealPlayer Win95 IIS Win2000
34 Net6.1 MediaPlayer WinME IIS Linux
35 Net6.1 MediaPlayer Win98 IIS Linux
36 Net6.1 RealPlayer WinNT IIS Win2000
37 Net6.1 None Win2000 Apache WinNT
38 Net6.1 None Win95 WebLogic WinNT
39 Net6.1 None WinXP WebLogic WinNT
40 Net6.1 None Win98 Apache WinNT
41 Moz1.1 MediaPlayer Win95 Apache WinNT
42 Moz1.1 RealPlayer WinME WebLogic WinNT
43 Moz1.1 RealPlayer Win98 WebLogic WinNT
44 Moz1.1 MediaPlayer WinNT Apache WinNT
45 Moz1.1 None Win2000 IIS Win2000
46 Moz1.1 None Win95 IIS Linux
47 Moz1.1 None WinXP IIS Linux
48 Moz1.1 None Win98 IIS Win2000
49 Net7.0 None Win95 WebLogic Win2000
50 Net7.0 None WinME Apache Linux
51 Net7.0 None Win98 Apache Linux
52 Net7.0 None WinNT WebLogic Win2000
53 Net7.0 RealPlayer Win2000 IIS WinNT
54 Net7.0 MediaPlayer Win95 IIS WinNT
55 Net7.0 MediaPlayer WinXP IIS WinNT
56 Net7.0 RealPlayer Win98 IIS WinNT
57 Opera7 None Win95 IIS WinNT
58 Opera7 None WinME IIS WinNT
59 Opera7 None Win98 IIS WinNT
60 Opera7 None WinNT IIS WinNT
61 Opera7 MediaPlayer Win2000 WebLogic Win2000
62 Opera7 RealPlayer Win95 Apache Linux
63 Opera7 RealPlayer WinXP Apache Linux
64 Opera7 MediaPlayer Win98 WebLogic Win2000
5. Constructthetestcases.
Now,allthatremainsistoconstructatestcaseforeachrowintheorthogonalarray.
Notethatthearrayspecifiesonlytheinputconditions.Anoracle(usuallythetester)is
requiredtodeterminetheexpectedresultforeachtest.
AllpairsAlgorithm
Usingorthogonalarraysisonewaytoidentifyallthepairs.Asecondwayistouseanalgorithm
thatgeneratesthepairsdirectlywithoutresortingtoan"external"devicelikeanorthogonal
array.
Reference
JamesBachprovidesatooltogenerateallpairscombinationsathttp://www.satisfice.com.
ClickonTestMethodologyandlookforAllpairs.
WardCunninghamprovidesfurtherdiscussionandthesourcecodeforaJavaprogramto
generateallpairscombinationsathttp://fit.c2.com/wiki.cgi?AllPairs.
JamesBachpresentsanalgorithmtogenerateallpairsinLessonsLearnedinSoftware
Testing.Inaddition,heprovidesaprogramcalled"Allpairs"thatwillgeneratetheallpairs
combinations.Itisavailableathttp://www.satisfice.com.Clickon"TestMethodology"andlook
forAllpairs.Let'sapplytheAllpairsalgorithmtothepreviousWebsitetestingproblem.
Afterdownloadingandunzipping,touseAllpairscreateatab-delimitedtableofthevariables
andtheirvalues.IfyouareaWindowsuser,theeasiestwayistolaunchExcel,enterthedata
intothespreadsheet,andthenSaveAsa.txtfile.Thefollowingtablewascreatedandsavedas
input.txt.
Table6-11:InputtotheAllpairsprogram.
Browser ClientOS Plug-in Server ServerOS
IE5.0 Win95 None IIS WinNT
IE5.5 Win98 RealPlayer Apache Win2000
IE6.0 WinME MediaPlayer WebLogic Linux
Netscape6.0 WinNT
Netscape6.1 Win2000
Netscape7.0 WinXP
Mozilla1.1
Opera7
ThenruntheAllpairsprogrambytyping:allpairsinput.txt>output.txtwhereoutput.txtwill
containthelistofallpairstestcases.Thefollowingtablewascreated:
Table6-12:OutputfromtheAllpairsprogram.
Browser ClientOS Plug-in Server ServerOS
1 IE5.0 Win95 None IIS WinNT
2 IE5.0 Win98 RealPlayer Apache Win2000
3 IE5.0 WinME MediaPlayer WebLogic Linux
4 IE5.5 Win95 RealPlayer WebLogic WinNT
5 IE5.5 Win98 None IIS Linux
6 IE5.5 WinME None Apache Win2000
7 IE6.0 Win95 MediaPlayer Apache Linux
8 IE6.0 Win98 RealPlayer IIS WinNT
9 IE6.0 WinME None WebLogic Win2000
10 Netscape6.0 WinME RealPlayer IIS Linux
11 Netscape6.0 WinNT MediaPlayer IIS Win2000
12 Netscape6.0 Win2000 None Apache WinNT
13 Netscape6.1 WinNT None WebLogic Linux
14 Netscape6.1 Win2000 MediaPlayer IIS Win2000
15 Netscape6.1 WinXP RealPlayer Apache WinNT
16 Netscape7.0 WinNT RealPlayer Apache WinNT
17 Netscape7.0 Win2000 MediaPlayer WebLogic Linux
18 Netscape7.0 WinXP MediaPlayer IIS Win2000
19 Mozilla1.1 WinXP MediaPlayer WebLogic WinNT
20 Mozilla1.1 Win98 MediaPlayer Apache Linux
21 Mozilla1.1 Win95 RealPlayer IIS Win2000
22 Opera7 WinXP None WebLogic Linux
23 Opera7 Win98 RealPlayer WebLogic Win2000
24 Opera7 WinME MediaPlayer Apache WinNT
25 IE5.5 Win2000 RealPlayer ~WebLogic ~Linux
26 IE5.5 WinNT MediaPlayer ~IIS ~WinNT
27 Netscape6.0 Win95 ~None WebLogic ~Win2000
28 Netscape7.0 Win95 None ~Apache ~Linux
29 Mozilla1.1 WinME None ~IIS ~WinNT
30 Opera7 WinNT ~RealPlayer IIS ~Linux
31 IE5.0 WinNT ~None ~Apache ~Win2000
32 IE5.0 Win2000 ~RealPlayer ~IIS ~WinNT
33 IE5.0 WinXP ~None ~WebLogic ~Linux
34 IE5.5 WinXP ~RealPlayer ~Apache ~Win2000
35 IE6.0 Win2000 ~None ~Apache ~Win2000
36 IE6.0 WinNT ~RealPlayer ~WebLogic ~WinNT
37 IE6,0 WinXP ~MediaPlayer ~IIS ~Linux
38 Netscape6.0 Win98 ~MediaPlayer ~WebLogic ~WinNT
39 Netscape6.0 WinXP ~RealPlayer ~Apache ~Linux
40 Netscape6.1 Win95 ~MediaPlayer ~Apache ~Win2000
41 Netscape6.1 Win98 ~None ~IIS ~WinNT
42 Netscape6.1 WinME ~RealPlayer ~WebLogic ~Linux
43 Netscape7.0 Win98 ~None ~WebLogic ~Win2000
44 Netscape7.0 WinME ~RealPlayer -US ~WinNT
45 Mozilla1.1 WinNT ~None ~Apache ~Linux
46 Mozilla1.1 Win2000 ~RealPlayer ~WebLogic ~Win2000
47 Opera7 Win95 ~MediaPlayer ~IIS ~WinNT
48 Opera7 Win2000 ~None ~Apache ~Win2000
Whenaparticularvalueinthetestcasedoesn'tmatter,becauseallofitspairingshavealready
beenselected,itismarkedwitha~.Bach'salgorithmchoosesthevaluethathasbeenpaired
thefewesttimesrelativetotheothersinthetestcase.Anyothervaluecouldbesubstitutedfor
oneprefixedwitha~andallpairscoveragewouldstillbemaintained.Thismightbedoneto
testmorecommonlyusedormorecriticalcombinationsmoreoften.Inaddition,Bach'sprogram
displaysinformationonhowthepairingsweredone.Itlistseachpair,showshowmanytimes
thatpairoccursinthetable,andindicateseachtestcasethatcontainsthatpair.
Becauseofthe"balanced"natureoforthogonalarrays,thatapproachrequiredsixty-fourtest
cases.The"unbalanced"natureoftheallpairsselectionalgorithmrequiresonlyforty-eighttest
cases,asavingsof25percent.
NotethatthecombinationschosenbytheOrthogonalArraymethodmaynotbethesameas
thosechosenbyAllpairs.Itdoesnotmatter.Whatdoesmatteristhatallofthepair
combinationsofparametersarechosen.Thosearethecombinationswewanttotest.
ProponentsoftheAllpairsalgorithmpointoutthatgivenaproblemwith100parameters,each
capableoftakingononeoftwovalues,101testcaseswouldberequiredusinga(balanced)
orthogonalarraywhiletheun-balancedallpairsapproachrequiresonlytentests.Sincemany
applicationshavelargenumbersofinputsthattakeononlyafewvalueseach,theyarguethe
allpairsapproachissuperior.
Tool
TheAETGtoolfromTelcordiaimplementstheall-pairstestingapproach.See
http://aetgweb.argreenhouse.com.
FinalComments
Insomesituations,constraintsexistbetweencertainchoicesofsomeofthevariables.For
example,Microsoft'sIISandApple'sMacOSarenotcompatible.Itiscertainthatthepairwise
techniqueswillchoosethatcombinationfortest.(Remember,itdoesselectallthepairs.)When
creatingpairwisesubsetsbyhand,honoringthesevariousconstraintscanbedifficult.Boththe
rdExpertandAETGtoolshavethisability.Youdefinetheconstraintsandthetoolselectspairs
meetingthoseconstraints.
Giventhetwoapproachestopairwisetesting,orthogonalarraysandtheAllpairsalgorithm,
whichismoreeffective?Oneexpert,whofavorsorthogonalarrays,believesthatthecoverage
providedbyAllpairsissubstantiallyinferior.Henotesthattheuniformdistributionoftestpoints
inthedomainofferssomecoverageagainstfaultsthataremorecomplexthandouble-mode
faults.Anotherexpert,whofavorstheAllpairsapproach,notesthatAllpairsdoes,infact,test
allthepairs,whichisthegoal.Heclaimsthereisnoevidencethattheorthogonalarray
approachdetectsmoredefects.HealsonotesthattheAllpairstoolisavailablefreeonthe
Web.Whatbothexpertsacknowledgeisthatnodocumentedstudiesexistcomparingthe
efficacyofoneapproachovertheother.
Theexcitinghopeofpairwisetestingisthatbycreatingandrunningbetween1percentto20
percentofthetestsyouwillfindbetween70percentand85percentofthetotaldefects.There
isnopromisehere,onlyahope.Manyothershaveexperiencedthissignificantresult.Trythis
technique.Discoverwhetheritworksforyou.
Cohenreportedthatinadditiontoreducingthenumberoftestcasesandincreasingthedefect
findrate,testcasescreatedbytheAllpairsalgorithmalsoprovidedbettercodecoverage.A
setof300randomlyselectedtestsachieved67percentstatementcoverageand58percent
decisioncoveragewhilethe200allpairstestcasesachieved92percentblockcoverageand
85percentdecisioncoverage,asignificantincreaseincoveragewithfewertestcases.
Onefinalcomment—itispossiblethatcertainimportantcombinationsmaybemissedbyboth
pairwiseapproaches.The80:20ruletellsusthatcombinationsarenotuniformlyimportant.Use
yourjudgmenttodetermineifcertainadditionaltestsshouldbecreatedforthosecombinations.
Inthepreviousexamplewecanbeassuredthatthedistributionofbrowsersisnotidentical.It
wouldbetrulyamazingif12.5percentofourusershadIE5.0,12.5percenthadIE5.5,12.5
percenthadIE6.0,etc.Certaincombinationsoccurmorefrequentlythanothers.Inaddition,
somecombinationsexistthat,whileusedinfrequently,absolutelypositivelymustworkproperly
—"shutdownthenuclearreactor"isagoodexample.Incasepairwisemissesanimportant
combination,pleaseaddthatcombinationtoyourtestcases.
ApplicabilityandLimitations
Likeothertestdesignapproachespreviouslypresented,pairwisetestingcansignificantly
reducethenumberoftestcasesthatmustbecreatedandexecuted.Itisequallyapplicableat
theunit,integration,system,andacceptancetestlevels.Allitrequiresarecombinationsof
inputs,eachtakingonvariousvalues,thatresultinacombinatorialexplosion,toomany
combinationstotest.
Remember,thereisnounderlying"softwaredefectphysics"thatguaranteespairwisetesting
willbeofbenefit.Thereisonlyonewaytoknow—tryit.
Summary
Whenthenumberofcombinationstotestisverylarge,donottoattempttotestall
combinationsforallthevaluesforallthevariables,buttestallpairsofvariables.This
significantlyreducesthenumberofteststhatmustbecreatedandrun.
Studiessuggestthatmostdefectsareeithersingle-modedefects(thefunctionunder
testsimplydoesnotwork)ordouble-modedefects(thepairingofthisfunction/module
withthatfunction/modulefails).Pairwisetestingdefinesaminimalsubsetthatguidesus
totestforallsingle-modeanddouble-modedefects.Thesuccessofthistechniqueon
manyprojects,bothdocumentedandundocumented,isagreatmotivationforitsuse.
Anorthogonalarrayisatwo-dimensionalarrayofnumbersthathasthisinteresting
property—chooseanytwocolumnsinthearray,allthecombinationswilloccurinevery
columnpair.
Thereisnounderlying"softwaredefectphysics"thatguaranteespairwisetestingwill
beofbenefit.Thereisonlyonewaytoknow—tryit.
Practice
1. NeithertheBrown&DonaldsonnortheStatelessUniversityRegistrationSystemcase
studiescontainhugenumbersofcombinationssuitableforthepairwisetesting
approach.Asexercises,usetheorthogonalarrayand/orallpairstechniqueonthe
othertwoexamplesinthischapter.Determinethesetofpairwisetestcasesusingthe
chosentechnique.
1. Abankhascreatedanewdataprocessingsystemthatisreadyfortesting.
Thisbankhasdifferentkindsofcustomers—consumers,veryimportant
consumers,businesses,andnon-profits;differentkindsofaccounts—
checking,savings,mortgages,consumerloans,andcommercialloans;they
operateindifferentstates,eachwithdifferentregulations—California,
Nevada,Utah,Idaho,Arizona,andNewMexico.
2. Inanobject-orientedsystem,anobjectofclassAcansendamessage
containingaparameterPtoanobjectofclassX.ClassesB,C,andD
inheritfromAsotheytoocansendthemessage.ClassesQ,R,S,andT
inheritfromPsotheytoocanbepassedastheparameter.ClassesYand
ZinheritfromXsotheytoocanreceivethemessage.
References
Brownlie,Robert,etal."RobustTestingofAT&TPMX/StarMAILUsingOATS,"AT&T
TechnicalJournal,Vol.71,No.3,May/June1992,pp.41–47.
Cohen,D.M.,etal."TheAETGSystem:AnApproachtoTestingBasedonCombinatorial
Design."IEEETransactionsonSoftwareEngineering,Vol.23,No.7,July,1997.
Kaner,Cem,JamesBach,andBretPettichord(2002).LessonsLearnedinSoftware
Testing:AContext-DrivenApproach.JohnWiley&Sons.
Kuhn,D.RichardandMichaelJ.Reilly."AnInvestigationoftheApplicabilityofDesignof
ExperimentstoSoftwareTesting,"27thNASA/IEEESoftwareEngineeringWorkshop,
NASAGoddardSpaceFlightCenter,4–6December,2002.
http://csrc.nist.gov/staff/kuhn/kuhn-reilly-02.pdf
Mandl,Robert."OrthogonalLatinSquares:AnApplicationofExperimentDesignto
CompilerTesting,"CommunicationsoftheACM,Vol.128,No.10,October1985,pp.
1054–1058.
Phadke,MadhavS.(1989).QualityEngineeringUsingRobustDesign.Prentice-Hall.
Wallace,DeloresR.andD.RichardKuhn."FailureModesInMedicalDeviceSoftware:
AnAnalysisOf15YearsOfRecallData,"InternationalJournalofReliability,Quality,
andSafetyEngineering,Vol.8,No.4,2001.
Chapter7:State-TransitionTesting
ColonelCleatusYorbvillehadbeenoneseriouslyboredastronautforthefirstfewmonths
ofhisdiplomaticmissiononthethirdplanetoftheFrangelicusXIVsystem,butallthat
hadchangedonthedayhe'ddiscoveredthathistiny,multipedalandinfinitelyhospitable
alienhostswerenotonlyediblebuttastedremarkablylikethatstuffthat'sleftonthepan
afteryou'vemadecinnamonbunsandburnedthemalittle.
—MarkSilcox
Introduction
State-Transitiondiagrams,likedecisiontables,areanotherexcellenttooltocapturecertain
typesofsystemrequirementsandtodocumentinternalsystemdesign.Thesediagrams
documenttheeventsthatcomeintoandareprocessedbyasystemaswellasthesystem's
responses.Unlikedecisiontables,theyspecifyverylittleintermsofprocessingrules.Whena
systemmustremembersomethingaboutwhathashappenedbeforeorwhenvalidandinvalid
ordersofoperationsexist,state-transitiondiagramsareexcellenttoolstorecordthis
information.
Thesediagramsarealsovitaltoolsinthetester'spersonaltoolbox.Unfortunately,many
analysts,designers,programmers,andtestersarenotfamiliarwiththistechnique.
Technique
State-TransitionDiagrams
Itiseasiertointroducestate-transitiondiagramsbyexampleratherthanbyformaldefinition.
SinceneitherBrown&DonaldsonnortheStatelessUniversityRegistrationSystemhas
substantialstate-transitionbasedrequirementslet'sconsideradifferentexample.Togetto
StatelessU,weneedanairlinereservation.Let'scallourfavoritecarrier(GraceL.Ferguson
Airline&StormDoorCompany)tomakeareservation.Weprovidesomeinformationincluding
departureanddestinationcities,dates,andtimes.Areservationagent,actingasourinterface
totheairline'sreservationsystem,usesthatinformationtomakeareservation.Atthatpoint,
theReservationisintheMadestate.Inaddition,thesystemcreatesandstartsatimer.Each
reservationhascertainrulesaboutwhenthereservationmustbepaidfor.Theserulesare
basedondestination,classofservice,dates,etc.Ifthistimerexpiresbeforethereservationis
paidfor,thereservationiscancelledbythesystem.Instate-transitionnotationthisinformation
isrecordedas: 
Figure7-1:TheReservationisMade.
ThecirclerepresentsonestateoftheReservation—inthiscasetheMadestate.Thearrow
showsthetransitionintotheMadestate.Thedescriptiononthearrow,giveInfo,isanevent
thatcomesintothesystemfromtheoutsideworld.Thecommandafterthe"/"denotesan
actionofthesystem;inthiscasestartPayTimer.Theblackdotindicatesthestartingpointof
thediagram.
SometimeaftertheReservationismade,but(hopefully)beforethePayTimerexpires,the
Reservationispaidfor.ThisisrepresentedbythearrowlabeledPayMoney.Whenthe
ReservationispaidittransitionsfromtheMadestatetothePaidstate.
Figure7-2:TheReservationtransitionstothePaidstate.
Beforeweproceedlet'sdefinethetermsmoreformally:
State(representedbyacircle)—Astateisaconditioninwhichasystemiswaitingfor
oneormoreevents.States"remember"inputsthesystemhasreceivedinthepastand
definehowthesystemshouldrespondtosubsequenteventswhentheyoccur.These
eventsmaycausestate-transitionsand/orinitiateactions.Thestateisgenerally
representedbythevaluesofoneormorevariableswithinasystem.
Transition(representedbyanarrow)—Atransitionrepresentsachangefromonestate
toanothercausedbyanevent.
Event(representedbyalabelonatransition)—Aneventissomethingthatcausesthe
systemtochangestate.Generally,itisaneventintheoutsideworldthatentersthe
systemthroughitsinterface.Sometimesitisgeneratedwithinthesystemsuchas
TimerexpiresorQuantityonHandgoesbelowReorderPoint.Eventsare
consideredtobeinstantaneous.Eventscanbeindependentorcausallyrelated(event
BcannottakeplacebeforeeventA).Whenaneventoccurs,thesystemcanchange
stateorremaininthesamestateand/orexecuteanaction.Eventsmayhave
parametersassociatedwiththem.Forexample,PayMoneymayindicateCash,
Check,DebitCard,orCreditCard.
Action(representedbyacommandfollowinga"/")—Anactionisanoperationinitiated
becauseofastatechange.ItcouldbeprintaTicket,displayaScreen,turnona
Motor,etc.Oftentheseactionscausesomethingtobecreatedthatareoutputsofthe
system.Notethatactionsoccurontransitionsbetweenstates.Thestatesthemselves
arepassive.
Theentrypointonthediagramisshownbyablackdotwhiletheexitpointisshownby
abulls-eyesymbol.
ThisnotationwascreatedbyMealy.AnalternatenotationhasbeendefinedbyMoorebutis
lessfrequentlyused.Foramuchmorein-depthdiscussionofstate-transitiondiagramssee
FowlerandScott'sbook,UMLDistilled:ABriefGuideToTheStandardObjectModeling
Language.Itdiscussesmorecomplexissuessuchaspartitionedandnestedstate-transition
diagrams.
Notethatthestate-transitiondiagramrepresentsonespecificentity(inthiscasea
Reservation).Itdescribesthestatesofareservation,theeventsthataffectthereservation,
thetransitionsofthereservationfromonestatetoanother,andactionsthatareinitiatedbythe
reservation.Acommonmistakeistomixdifferententitiesintoonestate-transitiondiagram.An
examplemightbemixingReservationandPassengerwitheventsandactionscorresponding
toeach.
FromthePaidstatetheReservationtransitionstotheTicketedstatewhentheprint
command(anevent)isissued.NotethatinadditiontoenteringtheTicketedstate,aTicketis
outputbythesystem.
Figure7-3:TheReservationtransitionstotheTicketedstate.
FromtheTicketedstatewegiveTickettothegateagenttoboardtheplane.
Figure7-4:TheReservationtransitionstotheUsedstate.
Aftersomeotheractionorperiodoftime,notindicatedonthisdiagram,thestate-transition
pathendsatthebulls-eyesymbol.
Figure7-5:Thepathends.
Doesthisdiagramshowallthepossiblestates,events,andtransitionsinthelifeofa
Reservation?No.IftheReservationisnotpaidforinthetimeallotted(thePayTimer
expires),itiscancelledfornon-payment.
Figure7-6:ThePayTimerexpiresandtheReservationiscancelledfornonpayment.
Finishedyet?No.Customerssometimescanceltheirreservations.FromtheMadestatethe
customer(throughthereservationagent)askstocanceltheReservation.Anewstate,
CancelledByCustomer,isrequired.
Figure7-7:CanceltheReservationfromtheMadestate.
Inaddition,aReservationcanbecancelledfromthePaidstate.InthiscaseaRefundshould
begeneratedandleavethesystem.TheresultingstateagainisCancelledByCustomer.
Figure7-8:CancellationfromthePaidstate.
Onefinaladdition.FromtheTicketedstatethecustomercancanceltheReservation.Inthat
caseaRefundshouldbegeneratedandthenextstateshouldbeCancelledbyCustomer.
Butthisisnotsufficient.Theairlinewillgeneratearefundbutonlywhenitreceivestheprinted
Ticketfromthecustomer.Thisintroducesonenewnotationalelement—squarebrackets[]that
containaconditionalthatcanbeevaluatedeitherTrueorFalse.Thisconditionalactsasa
guardallowingthetransitiononlyiftheconditionistrue.
Figure7-9:CancellationfromtheTicketedstate.
Notethatthediagramisstillincomplete.Noarrowsandbulls-eyesemergefromtheCancelled
states.PerhapswecouldreinstateareservationfromtheCancelledNonPaystate.Wecould
continueexpandingthediagramtoincludeseatselection,flightcancellation,andother
significanteventsaffectingthereservationbutthisissufficienttoillustratethetechnique.
Asdescribed,state-transitiondiagramsexpresscomplexsystemrulesandinteractionsina
verycompactnotation.Hopefully,whenthiscomplexityexists,analystsanddesignerswillhave
createdstate-transitiondiagramstodocumentsystemrequirementsandtoguidetheirdesign.
State-TransitionTables
Astate-transitiondiagramisnottheonlywaytodocumentsystembehavior.Thediagramsmay
beeasiertocomprehend,butstate-transitiontablesmaybeeasiertouseinacompleteand
systematicmanner.State-transitiontablesconsistoffourcolumns—CurrentState,Event,
Action,andNextState.
Table7-1:State-TransitiontableforReservation.
CurrentState Event Action NextState
null giveInfo startPayTimer Made
null payMoney -- null
null print -- null
null giveTicket -- null
null cancel -- null
null PayTimerExpires -- null
Made giveInfo -- Made
Made payMoney -- Paid
Made print -- Made
Made giveTicket -- Made
Made cancel -- Can-Cust
Made PayTimerExpires -- Can-NonPay
Paid giveInfo -- Paid
Paid payMoney -- Paid
Paid print Ticket Ticketed
Paid giveTicket -- Paid
Paid cancel Refund Can-Cust
Paid PayTimerExpires -- Paid
Ticketed giveInfo -- Ticketed
Ticketed payMoney -- Ticketed
Ticketed print -- Ticketed
Ticketed giveTicket -- Used
Ticketed cancel Refund Can-Cust
Ticketed PayTimerExpires -- Ticketed
Used giveInfo -- Used
Used payMoney -- Used
Used print -- Used
Used giveTicket -- Used
Used cancel -- Used
Used PayTimerExpires -- Used
Can-NonPay giveInfo -- Can-NonPay
Can-NonPay payMoney -- Can-NonPay
Can-NonPay print -- Can-NonPay
Can-NonPay giveTicket -- Can-NonPay
Can-NonPay cancel -- Can-NonPay
Can-NonPay PayTimerExpires -- Can-NonPay
Can-Cust givelnfo -- Can-Cust
Can-Cust payMoney -- Can-Cust
Can-Cust print -- Can-Cust
Can-Cust giveTicket -- Can-Cust
Can-Cust cancel -- Can-Cust
Can-Cust PayTimerExpires -- Can-Cust
Theadvantageofastate-transitiontableisthatitlistsallpossiblestate-transitioncombinations,
notjustthevalidones.Whentestingcritical,high-risksystemssuchasavionicsormedical
devices,testingeverystate-transitionpairmayberequired,includingthosethatarenotvalid.In
addition,creatingastate-transitiontableoftenunearthscombinationsthatwerenotidentified,
documented,ordealtwithintherequirements.Itishighlybeneficialtodiscoverthesedefects
beforecodingbegins.
Key
Point
Theadvantageofastate-transitiontableisthatitlistsallpossiblestate-transition
combinations,notjustthevalidones.
Usingastate-transitiontablecanhelpdetectdefectsinimplementationthatenableinvalidpaths
fromonestatetoanother.Thedisadvantageofsuchtablesisthattheybecomeverylargevery
quicklyasthenumberofstatesandeventsincreases.Inaddition,thetablesaregenerally
sparse;thatis,mostofthecellsareempty.
CreatingTestCases
Informationinthestate-transitiondiagramscaneasilybeusedtocreatetestcases.Four
differentlevelsofcoveragecanbedefined:
1. Createasetoftestcasessuchthatallstatesare"visited"atleastonceundertest.
Thesetofthreetestcasesshownbelowmeetsthisrequirement.Generallythisisa
weakleveloftestcoverage.
Figure7-10:Asetoftestcasesthat"visit"eachstate.
2. Createasetoftestcasessuchthatalleventsaretriggeredatleastonceundertest.
Notethatthetestcasesthatcovereacheventcanbethesameasthosethatcover
eachstate.Again,thisisaweaklevelofcoverage.
Figure7-11:Asetoftestcasesthattriggeralleventsatleastonce.
3. Createasetoftestcasessuchthatallpathsareexecutedatleastonceundertest.
Whilethislevelisthemostpreferredbecauseofitslevelofcoverage,itmaynotbe
feasible.Ifthestate-transitiondiagramhasloops,thenthenumberofpossiblepaths
maybeinfinite.Forexample,givenasystemwithtwostates,AandB,whereA
transitionstoBandBtransitionstoA.Afewofthepossiblepathsare:A→B
A→B→A
A→B→A→B→A→B
A→B→A→B→A→B→AA→B→A→B→A→B→A→B→A→B
...
andsoonforever.Testingofloopssuchasthiscanbeimportantiftheymayresultin
accumulatingcomputationalerrorsorresourceloss(lockswithoutcorresponding
releases,memoryleaks,etc.).
Key
Point
Testingeverytransitionisusuallytherecommendedlevelofcoverage
forastate-transitiondiagram.
4. Createasetoftestcasessuchthatalltransitionsareexercisedatleastonceunder
test.Thisleveloftestingprovidesagoodlevelofcoveragewithoutgeneratinglarge
numbersoftests.Thislevelisgenerallytheonerecommended.
Figure7-12:Asetoftestcasesthattriggeralltransitionsatleastonce.
Testcasescanalsobereaddirectlyfromthestate-transitiontable.Thegrayrowsinthe
followingtableshowallthevalidtransitions.
Table7-2:TestingallvalidtransitionsfromaState-transitiontable.
CurrentState Event Action NextState
null giveInfo startPayTimer Made
null payMoney -- null
null print -- null
null giveTicket -- null
null cancel -- null
null PayTimerExpires -- null
Made giveInfo -- Made
Made payMoney -- Paid
Made print -- Made
Made giveTicket -- Made
Made cancel -- Can-Cust
Made PayTimerExpires -- Can-NonPay
Paid giveInfo -- Paid
Paid payMoney -- Paid
Paid print Ticket Ticketed
Paid giveTicket -- Paid
Paid cancel Refund Can-Cust
Paid PayTimerExpires -- Paid
Ticketed giveInfo -- Ticketed
Ticketed payMoney -- Ticketed
Ticketed print -- Ticketed
Ticketed giveTicket -- Used
Ticketed cancel Refund Can-Cust
Ticketed PayTimerExpires -- Ticketed
Used giveInfo -- Used
Used payMoney -- Used
Used print -- Used
Used giveTicket -- Used
Used cancel -- Used
Used PayTimerExpires -- Used
Can-NonPay giveInfo -- Can-NonPay
Can-NonPay payMoney -- Can-NonPay
Can-NonPay print -- Can-NonPay
Can-NonPay giveTicket -- Can-NonPay
Can-NonPay cancel -- Can-NonPay
Can-NonPay PayTimerExpires -- Can-NonPay
Can-Cust givelnfo -- Can-Cust
Can-Cust payMoney -- Can-Cust
Can-Cust print -- Can-Cust
Can-Cust giveTicket -- Can-Cust
Can-Cust cancel -- Can-Cust
Can-Cust PayTimerExpires -- Can-Cust
Inaddition,dependingonthesystemrisk,youmaywanttocreatetestcasesforsomeorallof
theinvalidstate/eventpairstomakesurethesystemhasnotimplementedinvalidpaths.
ApplicabilityandLimitations
State-Transitiondiagramsareexcellenttoolstocapturecertainsystemrequirements,namely
thosethatdescribestatesandtheirassociatedtransitions.Thesediagramsthencanbeused
todirectourtestingeffortsbyidentifyingthestates,events,andtransitionsthatshouldbe
tested.
State-Transitiondiagramsarenotapplicablewhenthesystemhasnostateordoesnotneedto
respondtoreal-timeeventsfromoutsideofthesystem.Anexampleisapayrollprogramthat
readsanemployee'stimerecord,computespay,subtractsdeductions,savestherecord,prints
apaycheck,andrepeatstheprocess.
Summary
State-Transitiondiagramsdirectourtestingeffortsbyidentifyingthestates,events,
actions,andtransitionsthatshouldbetested.Together,thesedefinehowasystem
interactswiththeoutsideworld,theeventsitprocesses,andthevalidandinvalidorder
oftheseevents.
Astate-transitiondiagramisnottheonlywaytodocumentsystembehavior.Theymay
beeasiertocomprehend,butstate-transitiontablesmaybeeasiertouseina
completeandsystematicmanner.
Thegenerallyrecommendedleveloftestingusingstate-transitiondiagramsistocreate
asetoftestcasessuchthatalltransitionsareexercisedatleastonceundertest.In
high-risksystems,youmaywanttocreateevenmoretestcases,approachingallpaths
ifpossible.
Practice
1. ThisexercisereferstotheStatelessUniversityRegistrationSystemWebsite
describedinAppendixB.Belowisastate-transitiondiagramforthe"enrollina
course"and"dropacourse"process.Determineasetoftestcasesthatyoufeel
adequatelycovertheenrollanddropprocess.
Thefollowingtermsareusedinthediagram:Events
create-Createanewcourse.
enroll-Addastudenttothecourse.
drop-Dropastudentfromthecourse.
Attributes
ID-Thestudentidentificationnumber.
max-Themaximumnumberofstudentsacoursecanhold.
#enrolled-Thenumberofstudentscurrentlyenrolledinthecourse.
#waiting-ThenumberofstudentscurrentlyontheWaitListforthiscourse.
Tests
isEnrolled-Answers"isthestudentenrolled(ontheSectionList)?"
onWaitList-Answers"isthestudentontheWaitList?"
Lists
SectionList-Alistofstudentsenrolledintheclass.
WaitList-Alistofstudentswaitingtobeenrolledinafullclass.
Symbols
++Incrementby1.
--Decrementby1.
Figure7-13:State-transitiondiagramforenrollanddropacourseatStatelessU.
References
Binder,RobertV.(1999).TestingObject-OrientedSystems:Models,Patterns,and
Tools.Addison-Wesley.
Fowler,MartinandKendallScott(1999).UMLDistilled:ABriefGuidetotheStandard
ObjectModelingLanguage(2ndEdition).Addison-Wesley.
Harel,David."Statecharts:avisualformalismforcomplexsystems."Scienceof
ComputerProgramming8,1987,pp231–274.
Mealy,G.H."Amethodforsynthesizingsequentialcircuits."BellSystemTechnical
Journal,34(5):1045–1079,1955.
Moore,E.F."Gedanken-experimentsonsequentialmachines,"AutomataStudies(C.E.
ShannonandJ.McCarthy,eds.),pp.129–153,Princeton,NewJersey:Princeton
UniversityPress,1956.
Rumbaugh,James,etal.(1991).Object-OrientedModelingandDesign.Prentice-Hall.
Chapter8:DomainAnalysisTesting
StandingintheconcessionscaroftheOrientExpressasithissedandlurchedawayfrom
thestation,SpecialAgentChucouldfeelenemyeyeswatchinghimfromtheinky
shadowsandknewthathewasbeingtested,foralthoughhehadnevertastedaplugof
tobaccoinhislife,hewasimpersonatinganarmsdealerknowntobeaconnoisseur,so
heknewthathe,theChosenOne,ChowChu,hadnochoicebuttochoosethechoicest
chewonthechoo-choo.
—LorenHaarsma
Introduction
InthechaptersonEquivalenceClassandBoundaryValuetesting,weconsideredthetestingof
individualvariablesthattookonvalueswithinspecifiedranges.Inthischapterwewillconsider
thetestingofmultiplevariablessimultaneously.Therearetworeasonstoconsiderthis:
Werarelywillhavetimetocreatetestcasesforeveryvariableinoursystems.There
aresimplytoomany.
Oftenvariablesinteract.Thevalueofonevariableconstrainstheacceptablevaluesof
another.Inthiscase,certaindefectscannotbediscoveredbytestingthemindividually.
Domainanalysisisatechniquethatcanbeusedtoidentifyefficientandeffectivetestcases
whenmultiplevariablescanorshouldbetestedtogether.Itbuildsonandgeneralizes
equivalenceclassandboundaryvaluetestingtonsimultaneousdimensions.Likethose
techniques,wearesearchingforsituationswheretheboundaryhasbeendefinedor
implementedincorrectly.
Key
Point
Domainanalysisisatechniquethatcanbeusedtoidentifyefficientandeffective
testcaseswhenmultiplevariablesshouldbetestedtogether.
Intwodimensions(withtwointeractingparameters)thefollowingdefectscanoccur:
Ashiftedboundaryinwhichtheboundaryisdisplacedverticallyorhorizontally
Atiltedboundaryinwhichtheboundaryisrotatedatanincorrectangle
Amissingboundary
Anextraboundary
Figure8-1isadaptedfromBinder.Itillustratesthesefourtypesofdefectsgraphically.
Figure8-1:Twodimensionalboundarydefects.
Certainlytherecanbeinteractionsbetweenthreeormorevariables,butthediagramsaremore
difficulttovisualize.
Technique
Thedomainanalysisprocessguidesusinchoosingefficientandeffectivetestcases.First,a
numberofdefinitions:
Anonpointisavaluethatliesonaboundary.
Anoffpointisavaluethatdoesnotlieonaboundary.
Aninpointisavaluethatsatisfiesalltheboundaryconditionsbutdoesnotlieona
boundary.
Anoutpointisavaluethatdoesnotsatisfyanyboundarycondition.
Choosingonandoffpointsismorecomplicatedthatitmayappear.
Whentheboundaryisclosed(definedbyanoperatorcontaininganequality,i.e.,,≥or
=)sothatpointsontheboundaryareincludedinthedomain,thenanonpointlieson
theboundaryandisincludedwithinthedomain.Anoffpointliesoutsidethedomain.
Whentheboundaryisopen(definedbyaninequalityoperator<or>)sothatpointson
theboundaryarenotincludedinthedomain,thenanonpointliesontheboundarybut
isnotincludedwithinthedomain.Anoffpointliesinsidethedomain.
Confused?Atthispointexamplesarecertainlyinorder.
Figure8-2:Examplesofon,off,in,andoutpointsforbothclosedandopenboundaries.
Ontheleftisanexampleofaclosedboundary.Theregiondefinedconsistsofallthepoints
greaterthanorequalto10.Theonpointhasthevalue10.Theoffpointisslightlyoffthe
boundaryandoutsidethedomain.Theinpointiswithinthedomain.Theoutpointisoutsidethe
domain.
Ontherightisanexampleofanopenboundary.Theregiondefinedconsistsofallthepoints
greaterthan(butnotequalto)10.Again,theonpointhasavalueof10.Theoffpointisslightly
offtheboundaryandinsidethedomain.Theinpointiswithinthedomain.Theoutpointis
outsidethedomain.
Havingdefinedthesepoints,the1x1("one-by-one")domainanalysistechniqueinstructsusto
choosethesetestcases:
Foreachrelationalcondition(,>,,or<)chooseoneonpointandoneoffpoint.
Foreachstrictequalitycondition(=)chooseoneonpointandtwooffpoints,one
slightlylessthantheconditionalvalueandoneslightlygreaterthanthevalue.
Notethatthereisnoreasontorepeatidenticaltestsforadjacentdomains.Ifanoffpointfor
onedomainistheinpointforanother,donotduplicatethesetests.
Bindersuggestsaveryusefultablefordocumenting1x1domainanalysistestcasescalledthe
DomainTestMatrix.
Table8-1:ExampleDomainTestMatrix.
Notethattestcases1through8testtheonpointsandoffpointsforeachconditionofthefirst
variable(X1)whileholdingthevalueofthesecondvariable(X2)atatypicalinpoint.Testcases
9through16holdthefirstvariableatatypicalinpointwhiletestingtheonandoffpointsfor
eachconditionofthesecondvariable.Additionalvariablesandconditionswouldfollowthe
samepattern.
Example
AdmissiontoStatelessUniversityismadebyconsideringacombinationofhighschoolgrades
andACTtestscores.Theshadedcellsinthefollowingtableindicatethecombinationsthat
wouldguaranteeacceptance.GradePointAverages(GPAs)areshownacrossthetopwhile
ACTscoresareshowndowntheleftside.StatelessUniversityisafairlyexclusiveschoolin
termsofitsadmissionpolicy.
Explanation
TheACTAssessmentisanexaminationdesignedtoassesshighschoolstudents'general
educationaldevelopmentandtheirabilitytocompletecollege-levelwork.
TheGradePointAverageisbasedonconvertinglettergradestonumericvaluesA=4.0
(Best)
B=3.0
C=2.0(Average)
D=1.0
Table8-2:StatelessUniversityAdmissionsMatrix.
Thistablecanberepresentedasthesolutionsetofthesethreelinearequations:ACT≤36(the
highestscorepossible)GPA≤4.0(thehighestvaluepossible)10*GPA+ACT≥71
(Thethirdequationcanbefoundbyusingthegoodoldy=mx+bformulafromelementary
algebra.Usepoints{ACT=36,GPA=3.5}and{ACT=31,GPA=4.0}andcrank—that'smath
slangforsolvethepairofsimultaneousequationsobtainedbysubstitutingeachofthesetwo
pointsintothey=mx+bequation.)
Figure8-3:StatelessUniversityAdmissionsMatrixingraphicalform.
Thefollowingtestcasescoverthesethreeboundariesusingthe1x1domainanalysisprocess.
Table8-3:1x1DomainAnalysistestcasesforStatelessUniversityadmissions.
Testcases1and2verifytheGPA≤4.0constraint.Case1checksontheGPA=4.0boundary
whilecase2checksjustoutsidetheboundarywithGPA=4.1.Bothofthesecasesusetypical
valuesfortheACTandGPA/ACTconstraints.
Testcases3and4verifytheACT≤36constraint.Case3checksontheACT=36boundary
whilecase4checksjustoutsidetheboundarywithACT=37.Bothofthesecasesusetypical
valuesfortheGPAandGPA/ACTconstraints.
Testcases5and6verifythe10*GPA+ACT≥71constraint.Case5checksontheGPA=3.7
andACT=34boundarywhilecase6checksjustoutsidetheboundarywithGPA=3.8andACT
=32.BothofthesecasesusetypicalvaluesfortheGPAandACTconstraints.
ApplicabilityandLimitations
Domainanalysisisapplicablewhenmultiplevariables(suchasinputfields)shouldbetested
togethereitherforefficiencyorbecauseofalogicalinteraction.Whilethistechniqueisbest
suitedtonumericvalues,itcanbegeneralizedtoBooleans,strings,enumerations,etc.
Summary
Domainanalysisfacilitatesthetestingofmultiplevariablessimultaneously.Itisuseful
becausewerarelywillhavetimetocreatetestcasesforeveryvariableinoursystems.
Therearesimplytoomany.Inaddition,oftenvariablesinteract.Whenthevalueofone
variableconstrainstheacceptablevaluesofanother,certaindefectscannotbe
discoveredbytestingthemindividually.
Itbuildsonandgeneralizesequivalenceclassandboundaryvaluetestington
simultaneousdimensions.Likethosetechniques,wearesearchingforsituationswhere
theboundaryhasbeenimplementedincorrectly.
Inusingthe1x1domainanalysistechniqueforeachrelationalcondition(≥,>,≤,or<)
wechooseoneonpointandoneoffpoint.Foreachstrictequalitycondition(=)we
chooseoneonpointandtwooffpoints,oneslightlylessthantheconditionalvalueand
oneslightlygreaterthanthevalue.
Practice
1. StatelessUniversitypridesitselfinpreparingnotjusteducatedstudentsbutgood
citizensoftheirnation.(That'swhattheiradvertisingbrochuresays.)Inadditionto
theirmajorandminorcoursework,StatelessU.requireseachstudenttotake(and
pass)anumberofGeneralEducationclasses.Theseare:
CollegeAlgebra(thestudentmayeithertakethecourseorshowcompetency
throughtesting).
OurNation'sInstitutions—asurveycourseofournation'shistory,government,
andplaceintheworld.
FromfourtosixteenhoursofSocialSciencecourses(numbers100–299).
FromfourtosixteenhoursofPhysicalSciencecourses(numbers100–299)
Nomorethantwenty-fourcombinedhoursofSocialScienceandPhysical
Sciencecoursesmaybecountedtowardgraduation.
Apply1x1domainanalysistotheserequirements,derivethetestcases,
anduseBinder'sDomainTestMatrixtodocumentthem.
References
Beizer,Boris(1990).SoftwareTestingTechniques.VanNostrandReinhold.
Binder,RobertV.(2000).TestingObject-OrientedSystems:Models,Patterns,and
Tools.Addison-Wesley.
Chapter9:UseCaseTesting
TheInsectKeeperGeneral,sittingastridehisgianthoveringaphid,surveyedthe
battlefieldwhichreekedwiththestenchofdecayandresonatedwiththelowdroneofthe
tatteredanddyingmutantswarmsastheirlegskickedforlornlyattheskybeforeturning
tohismasterandsaying,'MyLord,yourfliesareundone.'
—AndrewVincent
Introduction
Upuntilnowwehaveexaminedtestcasedesigntechniquesforpartsofasystem—input
variableswiththeirrangesandboundaries,businessrulesasrepresentedindecisiontables,
andsystembehaviorsasrepresentedinstate-transitiondiagrams.Nowitistimetoconsider
testcasesthatexerciseasystem'sfunctionalitiesfromstarttofinishbytestingeachofits
individualtransactions.
Definingthetransactionsthatasystemprocessesisavitalpartoftherequirementsdefinition
process.Variousapproachestodocumentingthesetransactionshavebeenusedinthepast.
Examplesincludeflowcharts,HIPOdiagrams,andtext.Today,themostpopularapproachis
theusecasediagram.Likedecisiontablesandstate-transitiondiagrams,usecasesareusually
createdbydevelopersfordevelopers.But,liketheseothertechniques,usecasesholda
wealthofinformationusefultotesters.
UsecaseswerecreatedbyIvarJacobsenandpopularizedinhisbookObject-Oriented
SoftwareEngineering:AUseCaseDrivenApproach.Jacobsendefinesa"usecase"asa
scenariothatdescribestheuseofasystembyanactortoaccomplishaspecificgoal.By
"actor"wemeanauser,playingarolewithrespecttothesystem,seekingtousethesystemto
accomplishsomethingworthwhilewithinaparticularcontext.Actorsaregenerallypeople
althoughothersystemsmayalsobeactors.A"scenario"isasequenceofstepsthatdescribe
theinteractionsbetweentheactorandthesystem.Notethattheusecaseisdefinedfromthe
perspectiveoftheuser,notthesystem.Notealsothattheinternalworkingsofthesystem,
whilevital,arenotpartoftheusecasedefinition.Thesetofusecasesmakesupthefunctional
requirementsofasystem.
TheUnifiedModelingLanguagenotionforusecasesis:
Figure9-1:SomeStatelessUniversityusecases.
Thestickfiguresrepresenttheactors,theellipsesrepresenttheusecases,andthearrows
showwhichactorsinitiatewhichusecases.
Itisimportanttonotethatwhileusecaseswerecreatedinthecontextofobject-oriented
systemsdevelopment,theyareequallyusefulindefiningfunctionalrequirementsinother
developmentparadigmsaswell.
Thevalueofusecasesisthatthey:
Capturethesystem'sfunctionalrequirementsfromtheuser'sperspective;notfroma
technicalperspective,andirrespectiveofthedevelopmentparadigmtobeused.
Canbeusedtoactivelyinvolveusersintherequirementsgatheringanddefinition
process.
Providethebasisforidentifyingasystem'skeyinternalcomponents,structures,
databases,andrelationships.
Serveasthefoundationfordevelopingtestcasesatthesystemandacceptancelevel.
Technique
Unfortunately,thelevelofdetailspecifiedintheusecasesisnotsufficient,eitherfordevelopers
ortesters.InhisbookWritingEffectiveUseCases,AlistairCockburnhasproposedadetailed
templatefordescribingusecases.Thefollowingisadaptedfromhiswork:
Table9-1:Usecasetemplate.
UseCase
Component Description
UseCaseNumber
orIdentifier Auniqueidentifierforthisusecase
UseCaseName Thenameshouldbethegoalstatedasashortactiveverbphrase
GoalinContext Amoredetailedstatementofthegoalifnecessary
Scope Corporate|System|Subsystem
Level Summary|Primarytask|Subfunction
PrimaryActor Rolenameordescriptionoftheprimaryactor
Preconditions Therequiredstateofthesystembeforetheusecaseistriggered
SuccessEnd
Conditions Thestateofthesystemuponsuccessfulcompletionofthisusecase
FailedEnd
Conditions Thestateofthesystemiftheusecasecannotexecutetocompletion
Trigger Theactionthatinitiatestheexecutionoftheusecase
MainSuccess
Scenario
Step Action
1
2 
...
Extensions Conditionsunderwhichthemainsuccessscenariowillvaryanda
descriptionofthosevariations
Sub-Variations Variationsthatdonotaffectthemainflowbutthatmustbe
considered
Priority Criticality
ResponseTime Timeavailabletoexecutethisusecase
Frequency Howoftenthisusecaseisexecuted
Channelsto Interactive|File|Database|...
PrimaryActor
SecondaryActors Otheractorsneededtoaccomplishthisusecase
Channelsto
SecondaryActors Interactive|File|Database|...
DateDue Scheduleinformation
Completeness
Level
UseCaseidentified(0.1)|Mainscenariodefined(0.5)|Allextensions
defined(0.8)|Allfieldscomplete(1.0)
OpenIssues Unresolvedissuesawaitingdecisions
Example
ConsiderthefollowingexamplefromtheStatelessUniversityRegistrationSystem.Astudent
wantstoregisterforacourseusingSU'sonlineregistrationsystem,SURS.
Table9-2:Exampleusecase.
UseCaseComponent Description
UseCaseNumberor
Identifier SURS1138
UseCaseName Registerforacourse(aclasstaughtbyafacultymember)
GoalinContext
Scope System
Level Primarytask
PrimaryActor Student
Preconditions None
SuccessEndConditions Thestudentisregisteredforthecourse—thecoursehas
beenaddedtothestudent'scourselist
FailedEndConditions Thestudent'scourselistisunchanged
Trigger Studentselectsacourseand"Registers"
MainSuccessScenarioA:
ActorS:System
Step Action
1 A:Selects"Registerforacourse"
2 A:Selectscourse(e.g.Math1060)
3 S:Displayscoursedescription
4 A:Selectssection(Mon&Wed9:00am)
5 S:Displayssectiondaysandtimes
6 A:Accepts
7 S:Addscourse/sectiontostudent'scourselist
Extensions
2a Coursedoesnotexist
S:Displaymessageandexit
4a Sectiondoesnotexist
S:Displaymessageandexit
4b
Sectionisfull
S:Displaymessageandexit
6a StudentdoesnotacceptS:Displaymessageandexit
Sub-Variations
Studentmayuse
Web
Phone
Priority Critical
ResponseTime 10secondsorless
Frequency Approximately5coursesx10,000studentsovera4-week
period
ChannelstoPrimaryActor Interactive
SecondaryActors None
ChannelstoSecondary
Actors N/A
DateDue 1Feb
CompletenessLevel 0.5
OpenIssues None
Hopefullyeachusecasehasbeenthroughaninspectionprocessbeforeitwasimplemented.
Totesttheimplementation,thebasicruleistocreateatleastonetestcaseforthemain
successscenarioandatleastonetestcaseforeachextension.
Becauseusecasesdonotspecifyinputdata,thetestermustselectit.Typicallyweusethe
equivalenceclassandboundaryvaluetechniquesdescribedearlier.AlsoaDomainTestMatrix
(seetheDomainAnalysisTestingchapterforanexample)maybeausefulwayofdocumenting
thetestcases.
Itisimportanttoconsidertheriskofthetransactionanditsvariantsundertest.Lessrisky
transactionsmeritlesstesting.Moreriskytransactionsshouldreceivemoretesting.Forthem
considerthefollowingapproach.
Key
Point
Alwaysremembertoevaluatetheriskofeachusecaseandextensionandcreate
testcasesaccordingly.
Tocreatetestcases,startwithnormaldataforthemostoftenusedtransactions.Thenmoveto
boundaryvaluesandinvaliddata.Next,choosetransactionsthat,whilenotusedoften,arevital
tothesuccessofthesystem(i.e.,ShutDownTheNuclearReactor).Makesureyouhaveat
leastonetestcaseforeveryExtensionintheusecase.Trytransactionsinstrangeorders.
Violatethepreconditions(ifthatcanhappeninactualuse).Ifatransactionhasloops,don'tjust
loopthroughonceortwice—bediabolical.Lookforthelongest,mostconvolutedpaththrough
thetransactionandtryit.Iftransactionsshouldbeexecutedinsomelogicalorder,trya
differentorder.Insteadofenteringdatatop-down,trybottom-up.Create"goofy"testcases.If
youdon'ttrystrangethings,youknowtheuserswill.
FreeStuffDownloadHolodeckfromhttp://www.sisecure.com/holodeck/holodeck-
trial.aspx.
Mostpathsthroughatransactionareeasytocreate.Theycorrespondtovalidandinvaliddata
beingentered.Moredifficultarethosepathsduetosomekindofexceptionalcondition—low
memory,diskfull,connectionlost,drivernotloaded,etc.Itcanbeverytimeconsumingforthe
testertocreateorsimulatetheseconditions.Fortunately,atoolisavailabletohelpthetester
simulatetheseproblems—Holodeck,createdbyJamesWhittakerandhisassociatesatFlorida
InstituteofTechnology.Holodeckmonitorstheinteractionsbetweenanapplicationandits
operatingsystem.Itlogseachsystemcallandenablesthetestertosimulateafailureofany
callatwill.Inthisway,thediskcanbe"madefull,"networkconnectionscan"become
disconnected,"datatransmissioncan"begarbled,"andahostofotherproblemscanbe
simulated.
Amajorcomponentoftransactiontestingistestdata.BorisBeizersuggeststhat30percentto
40percentoftheeffortintransactiontestingisgenerating,capturing,orextractingtestdata.
Don'tforgettoincluderesources(timeandpeople)forthisworkinyourproject'sbudget.
Note Onetestinggroupdesignatesa"dataczar"whosesoleresponsibilityistoprovidetest
data.
ApplicabilityandLimitations
Transactiontestingisgenerallythecornerstoneofsystemandacceptancetesting.Itshouldbe
usedwheneversystemtransactionsarewelldefined.Ifsystemtransactionsarenotwell
defined,youmightconsiderpolishingupyourresumeorC.V.
Whilecreatingatleastonetestcaseforthemainsuccessscenarioandatleastoneforeach
extensionprovidessomeleveloftestcoverage,itisclearthat,nomatterhowmuchwetry,
mostinputcombinationswillremainuntested.Donotbeoverconfidentaboutthequalityofthe
systematthispoint.
Summary
Ausecaseisascenariothatdescribestheuseofasystembyanactortoaccomplish
aspecificgoal.An"actor"isauser,playingarolewithrespecttothesystem,seeking
tousethesystemtoaccomplishsomethingworthwhilewithinaparticularcontext.A
scenarioisasequenceofstepsthatdescribetheinteractionsbetweentheactorand
thesystem.
Amajorcomponentoftransactiontestingistestdata.BorisBeizersuggeststhat30
percentto40percentoftheeffortintransactiontestingisgenerating,capturing,or
extractingtestdata.Don'tforgettoincluderesources(timeandpeople)forthisworkin
yourproject'sbudget.
Whilecreatingatleastonetestcaseforthemainsuccessscenarioandatleastonefor
eachextensionprovidessomeleveloftestcoverage,itisclearthat,nomatterhow
muchwetry,mostinputcombinationswillremainuntested.Donotbeoverconfident
aboutthequalityofthesystematthispoint.
Practice
1. Giventhe"RegisterForACourse"usecasefortheStatelessUniversityRegistration
Systemdescribedpreviously,createasetoftestcasessothatthemainsuccess
scenarioandeachoftheextensionsaretestedatleastonce.Choose"interesting"
testdatausingtheequivalenceclassandboundaryvaluetechniques.
References
Beizer,Boris(1990).SoftwareTestingTechniques(SecondEdition).VanNostrand
Reinhold.
Beizer,Boris(1995).Black-BoxTesting:TechniquesforFunctionalTestingofSoftware
andSystems.JohnWiley&Sons.
Cockburn,Alistair(2000).WritingEffectiveUseCases.Addison-Wesley.
Fowler,MartinandKendallScott(1999).UMLDistilled:ABriefGuidetotheStandard
ObjectModelingLanguage(2ndEdition).Addison-Wesley.
Jacobsen,Ivar,etal.(1992).Object-OrientedSystemsEngineering:AUseCaseDriven
Approach.Addison-Wesley.
SectionII:WhiteBoxTestingTechniques
ChapterList
Chapter10:ControlFlowTesting
Chapter11:DataFlowTesting
PartOverview
Definition
Whiteboxtestingisastrategyinwhichtestingisbasedontheinternalpaths,structure,and
implementationofthesoftwareundertest(SUT).Unlikeitscomplement,blackboxtesting,
whiteboxtestinggenerallyrequiresdetailedprogrammingskills.
Thegeneralwhiteboxtestingprocessis:
TheSUT'simplementationisanalyzed.
PathsthroughtheSUTareidentified.
InputsarechosentocausetheSUTtoexecuteselectedpaths.Thisiscalledpath
sensitization.Expectedresultsforthoseinputsaredetermined.
Thetestsarerun.
Actualoutputsarecomparedwiththeexpectedoutputs.
AdeterminationismadeastotheproperfunctioningoftheSUT.
Applicability
Whiteboxtestingcanbeappliedatalllevelsofsystemdevelopment—unit,integration,and
system.Generallywhiteboxtestingisequatedwithunittestingperformedbydevelopers.While
thisiscorrect,itisanarrowviewofwhiteboxtesting.
Whiteboxtestingismorethancodetesting—itispathtesting.Generally,thepathsthatare
testedarewithinamodule(unittesting).Butwecanapplythesametechniquestotestpaths
betweenmoduleswithinsubsystems,betweensubsystemswithinsystems,andevenbetween
entiresystems.
Disadvantages
Whiteboxtestinghasfourdistinctdisadvantages.First,thenumberofexecutionpathsmaybe
solargethantheycannotallbetested.Attemptingtotestallexecutionpathsthroughwhitebox
testingisgenerallyasinfeasibleastestingallinputdatacombinationsthroughblackboxtesting.
Second,thetestcaseschosenmaynotdetectdatasensitivityerrors.Forexample:
p=q/r;
mayexecutecorrectlyexceptwhenr=0.
y=2*x//shouldready=x2
willpassfortestcasesx=0,y=0andx=2,y=4
Third,whiteboxtestingassumesthecontrolflowiscorrect(orveryclosetocorrect).Sincethe
testsarebasedontheexistingpaths,nonexistentpathscannotbediscoveredthroughwhite
boxtesting.
Fourth,thetestermusthavetheprogrammingskillstounderstandandevaluatethesoftware
undertest.Unfortunately,manytesterstodaydonothavethisbackground.
Advantages
Whenusingwhiteboxtesting,thetestercanbesurethateverypaththroughthesoftware
undertesthasbeenidentifiedandtested.
Chapter10:ControlFlowTesting
Itwasfromtheprimevalwellspringofanantediluvianpassionthatmystoryariseswhich,
liketheroundearthflattenedonamap,isbutalinearprojectionofanotherwise
periphrasticandpolyphiloprogenitive,non-planar,non-didactic,self-invertingconstruction
whoseobscurantistgeotropicliminalityisbeyondreasonabledoubt.
—MilindaBanerjee
Introduction
Controlflowtestingisoneoftwowhiteboxtestingtechniques.Thistestingapproachidentifies
theexecutionpathsthroughamoduleofprogramcodeandthencreatesandexecutestest
casestocoverthosepaths.Thesecondtechnique,discussedinthenextchapter,focuseson
dataflow.
Key
Point
Path:Asequenceofstatementexecutionthatbeginsatanentryandendsatan
exit.
Unfortunately,inanyreasonablyinterestingmodule,attemptingexhaustivetestingofallcontrol
flowpathshasanumberofsignificantdrawbacks.
Thenumberofpathscouldbehugeandthusuntestablewithinareasonableamountof
time.Everydecisiondoublesthenumberofpathsandeveryloopmultipliesthepathsby
thenumberofiterationsthroughtheloop.Forexample:
for(i=1;i<=1000;i++)
for(j=1;j<=1000;j++)
for(k=1;k<=1000;k++)
doSomethingWith(i,j,k);
executesdoSomethingWith()onebilliontimes(1000x1000x1000).Eachuniquepath
deservestobetested.
Pathscalledforinthespecificationmaysimplybemissingfromthemodule.Anytesting
approachbasedonimplementedpathswillneverfindpathsthatwerenotimplemented.
if(a>0)doIsGreater();
if(a==0)dolsEqual();
//missingstatement-if(a<0)dolsLess();
Defectsmayexistinprocessingstatementswithinthemoduleeventhroughthecontrol
flowitselfiscorrect.
//actual(butincorrect)code
a=a+1;
//correctcode
a=a-1;
Themodulemayexecutecorrectlyforalmostalldatavaluesbutfailforafew.
intblech(inta,intb){
returna/b;
}
failsifbhasthevalue0butexecutescorrectlyifbisnot0.
Eventhoughcontrolflowtestinghasanumberofdrawbacks,itisstillavitaltoolinthetester's
toolbox.
Technique
ControlFlowGraphs
Controlflowgraphsarethefoundationofcontrolflowtesting.Thesegraphsdocumentthe
module'scontrolstructure.Modulesofcodeareconvertedtographs,thepathsthroughthe
graphsareanalyzed,andtestcasesarecreatedfromthatanalysis.Controlflowgraphs
consistofanumberofelements:
Key
Point Controlflowgraphsarethefoundationofcontrolflowtesting.
ProcessBlocks
Aprocessblockisasequenceofprogramstatementsthatexecutesequentiallyfrombeginning
toend.Noentryintotheblockispermittedexceptatthebeginning.Noexitfromtheblockis
permittedexceptattheend.Oncetheblockisinitiated,everystatementwithinitwillbe
executedsequentially.Processblocksarerepresentedincontrolflowgraphsbyabubblewith
oneentryandoneexit.
DecisionPoint
Adecisionpointisapointinthemoduleatwhichthecontrolflowcanchange.Mostdecision
pointsarebinaryandareimplementedbyif-then-elsestatements.Multi-waydecisionpointsare
implementedbycasestatements.Theyarerepresentedbyabubblewithoneentryand
multipleexits.
JunctionPoint
Ajunctionpointisapointatwhichcontrolflowsjointogether.
Thefollowingcodeexampleisrepresentedbyitsassociatedflowgraph:
Figure10-1:Flowgraphequivalentofprogramcode.
LevelsofCoverage
Incontrolflowtesting,differentlevelsoftestcoveragearedefined.By"coverage"wemeanthe
percentageofthecodethathasbeentestedvs.thatwhichistheretotest.Incontrolflow
testingwedefinecoverageatanumberofdifferentlevels.(Notethatthesecoveragelevelsare
notpresentedinorder.Thisisbecause,insomecases,itiseasiertodefineahighercoverage
levelandthendefinealowercoveragelevelintermsofthehigher.)
Level1
Thelowestcoveragelevelis"100%statementcoverage"(sometimesthe"100%"is
droppedandisreferredtoas"statementcoverage").Thismeansthateverystatement
withinthemoduleisexecuted,undertest,atleastonce.Whilethismayseemlikea
reasonablegoal,manydefectsmaybemissedwiththislevelofcoverage.Considerthe
followingcodesnippet:
if(a>0){x=x+1;}
if(b==3){y=0;}
Thiscodecanberepresentedingraphicalformas:
Figure10-2:Graphicalrepresentationofthetwo-linecodesnippet.
Thesetwolinesofcodeimplementfourdifferentpathsofexecution:
Figure10-3:Fourexecutionpaths.
Whileasingletestcaseissufficienttotesteverylineofcodeinthismodule(for
example,usea=6andb=3asinput),itisapparentthatthislevelofcoveragewillmiss
testingmanypaths.Thus,statementcoverage,whileabeginning,isgenerallynotan
acceptableleveloftesting.
Eventhoughstatementcoverageisthelowestlevelofcoverage,eventhatmaybedifficultto
achieveinpractice.Oftenmoduleshavecodethatisexecutedonlyinexceptional
circumstances—lowmemory,fulldisk,unreadablefiles,lostconnections,etc.Testersmayfind
itdifficultorevenimpossibletosimulatethesecircumstancesandthuscodethatdealswith
theseproblemswillremainuntested.
Holodeckisatoolthatcansimulatemanyoftheseexceptionalsituations.Accordingto
Holodeck'sspecificationit"willallowyou,thetester,totestsoftwarebyobservingthesystem
callsthatitmakesandcreatetestcasesthatyoumayuseduringsoftwareexecutiontomodify
thebehavioroftheapplication.Modificationsmightincludemanipulatingtheparameterssentto
functionsorchangingthereturnvaluesoffunctionswithinyoursoftware.Inaddition,youmay
alsoseterror-codesandothersystemevents.Thissetofpossibilitiesallowsyoutoemulate
environmentsthatyoursoftwaremightencounter-hencethename'Holodeck.'Insteadof
needingtounplugyournetworkconnection,createadiskwithbadsectors,corruptpacketson
thenetwork,orperformanyoutsideorspecialmanipulationofyourmachine,youcanuse
Holodecktoemulatetheseproblems.Faultscaneasilybeplacedintoanysoftwaretesting
projectthatyouareusingwithHolodeck."
Holodeck
TodownloadHolodeckvisithttp://www.sisecure.com/holodeck/holodeck-trial.aspx.
Level0
Actually,thereisalevelofcoveragebelow"100%statementcoverage."Thatlevelis
definedas"testwhateveryoutest;lettheuserstesttherest."Thecorporate
landscapeisstrewnwiththesun-bleachedbonesoforganizationswhohaveusedthis
testingapproach.Regardingthislevelofcoverage,BorisBeizerwrote"testingless
thanthis[100%statementcoverage]fornewsoftwareisunconscionableandshouldbe
criminalized....IncaseIhaven'tmademyselfclear,...untestedcodeinasystemis
stupid,shortsighted,andirresponsible."
Level2
Thenextlevelofcontrolflowcoverageis"100%decisioncoverage."Thisisalsocalled
"branchcoverage."Atthislevelenoughtestcasesarewrittensothateachdecision
thathasaTRUEandFALSEoutcomeisevaluatedatleastonce.Intheprevious
examplethiscanbeachievedwithtwotestcases(a=2,b=2anda=4,b=3).
Figure10-4:Twotestcasesthatyield100%decisioncoverage.
Casestatementswithmultipleexitswouldhavetestsforeachexit.Notethatdecision
coveragedoesnotnecessarilyguaranteepathcoveragebutitdoesguarantee
statementcoverage.
Level3
Notallconditionalstatementsareassimpleastheonespreviouslyshown.Consider
thesemorecomplicatedstatements:
if(a>0&&c==1){x=x+1;}
if(b==3||d<0){y=0;}
TobeTRUE,thefirststatementrequiresagreaterthan0andcequal1.Thesecond
requiresbequal3ordlessthan0.
Inthefirststatementifthevalueofaweresetto0fortestingpurposesthenthec==1
partoftheconditionwouldnotbetested.(Inmostprogramminglanguagesthesecond
expressionwouldnotevenbeevaluated.)Thenextlevelofcontrolflowcoverageis
"100%conditioncoverage."Atthislevelenoughtestcasesarewrittensothateach
conditionthathasaTRUEandFALSEoutcomethatmakesupadecisionisevaluated
atleastonce.Thislevelofcoveragecanbeachievedwithtwotestcases(a>0,c=1,
b=3,d<0anda≤0,c≠1,b≠3,d≥0).Conditioncoverageisusuallybetterthandecision
coveragebecauseeveryindividualconditionistestedatleastoncewhiledecision
coveragecanbeachievedwithouttestingeverycondition.
Level4
Considerthissituation:
if(x&&y){conditionedStatement;}
//note:&&indicateslogicalAND
Wecanachieveconditioncoveragewithtwotestcases(x=TRUE,y=FALSEand
x=FALSE,y=TRUE)butnotethatwiththesechoicesofdatavaluesthe
conditionedStatementwillneverbeexecuted.Giventhepossiblecombinationof
conditionssuchasthese,tobemorecomplete"100%decision/condition"coveragecan
beselected.Atthisleveltestcasesarecreatedforeveryconditionandeverydecision.
Level5
Tobeevenmorethorough,considerhowtheprogramminglanguagecompileractually
evaluatesthemultipleconditionsinadecision.Usethatknowledgetocreatetestcases
yielding"100%multipleconditioncoverage."
if(a>0&&c==1){x=x+1;}
if(b==3||d<0){y=0;}
//note:||meanslogicalOR
willbeevaluatedas:
Figure10-5:Compilerevaluationofcomplexconditions.
Thislevelofcoveragecanbeachievedwithfourtestcases:
a>0,c=1,b=3,d<0
a≤0,c=1,b=3,d≥0
a>0,c≠1,b≠3,d<0
a≤0,c≠1,b≠3,d≥0
Achieving100%multipleconditioncoveragealsoachievesdecisioncoverage,condition
coverage,anddecision/conditioncoverage.Notethatmultipleconditioncoveragedoes
notguaranteepathcoverage.
Level7
Finallywereachthehighestlevel,whichis"100%pathcoverage."Forcodemodules
withoutloopsthenumberofpathsisgenerallysmallenoughthatatestcasecan
actuallybeconstructedforeachpath.Formoduleswithloops,thenumberofpathscan
beenormousandthusposeanintractabletestingproblem.
Figure10-6:Aninterestingflowdiagramwithmany,manypaths.
Level6
Whenamodulehasloopsinthecodepathssuchthatthenumberofpathsisinfinite,a
significantbutmeaningfulreductioncanbemadebylimitingloopexecutiontoasmall
numberofcases.Thefirstcaseistoexecutetheloopzerotimes;thesecondisto
executethelooponetime,thethirdistoexecutetheloopntimeswherenisasmall
numberrepresentingatypicalloopvalue;thefourthistoexecutetheloopitsmaximum
numberoftimesm.Inadditionyoumighttrym-1andm+1.
Beforebeginningcontrolflowtesting,anappropriatelevelofcoverageshouldbechosen.
StructuredTesting/BasisPathTesting
Nodiscussiononcontrolflowtestingwouldbecompletewithoutapresentationofstructured
testing,alsoknownasbasispathtesting.Structuredtestingisbasedonthepioneeringworkof
TomMcCabe.Itusesananalysisofthetopologyofthecontrolflowgraphtoidentifytest
cases.
Thestructuredtestingprocessconsistsofthefollowingsteps:
Derivethecontrolflowgraphfromthesoftwaremodule.
Computethegraph'sCyclomaticComplexity(C).
SelectasetofCbasispaths.
Createatestcaseforeachbasispath.
Executethesetests.
Considerthefollowingcontrolflowgraph:
Figure10-7:Anexamplecontrolflowgraph.
McCabedefinestheCyclomaticComplexity(C)ofagraphas
C=edges-nodes+2
Edgesarethearrows,andnodesarethebubblesonthegraph.Theprecedinggraphhas24
edgesand19nodesforaCyclomaticComplexityof24-19+2=7.
Insomecasesthiscomputationcanbesimplified.Ifalldecisionsinthegrapharebinary(they
haveexactlytwoedgesflowingout),andtherearepbinarydecisions,then
C=p+1
CyclomaticComplexityisexactlytheminimumnumberofindependent,nonloopingpaths(called
basispaths)thatcan,inlinearcombination,generateallpossiblepathsthroughthemodule.In
termsofaflowgraph,eachbasispathtraversesatleastoneedgethatnootherpathdoes.
McCabe'sstructuredtestingtechniquecallsforcreatingCtestcases,oneforeachbasispath.
IMPORTANT
!
CreatingandexecutingCtestcases,basedonthebasispaths,guarantees
bothbranchandstatementcoverage.
Becausethesetofbasispathscoversalltheedgesandnodesofthecontrolflowgraph,
satisfyingthisstructuredtestingcriteriaautomaticallyguaranteesbothbranchandstatement
coverage.
AprocessforcreatingasetofbasispathsisgivenbyMcCabe:
1. Picka"baseline"path.Thispathshouldbeareasonably"typical"pathofexecution
ratherthananexceptionprocessingpath.Thebestchoicewouldbethemost
importantpathfromthetester'sview.
Figure10-8:ThechosenbaselinebasispathABDEGKMQS
2. Tochoosethenextpath,changetheoutcomeofthefirstdecisionalongthebaseline
pathwhilekeepingthemaximumnumberofotherdecisionsthesameasthebaseline
path.
Figure10-9:ThesecondbasispathACDEGKMQS
3. Togeneratethethirdpath,beginagainwiththebaselinebutvarytheseconddecision
ratherthanthefirst.
Figure10-10:ThethirdbasispathABDFILORS
4. Togeneratethefourthpath,beginagainwiththebaselinebutvarythethirddecision
ratherthanthesecond.Continuevaryingeachdecision,onebyone,untilthebottom
ofthegraphisreached.
Figure10-11:ThefourthbasispathABDEHKMQS
Figure10-12:ThefifthbasispathABDEGKNQS
5. Nowthatalldecisionsalongthebaselinepathhavebeenflipped,weproceedtothe
secondpath,flippingitsdecisions,onebyone.Thispatterniscontinueduntilthebasis
pathsetiscomplete.
Figure10-13:ThesixthbasispathACDFJLORS
Figure10-14:TheseventhbasispathACDFILPRS
Thus,asetofbasispathsforthisgraphare:
ABDEGKMQS
ACDEGKMQS
ABDFILORS
ABDEHKMQS
ABDEGKNQS
ACDFJLORS
ACDFILPRS
Structuredtestingcallsforthecreationofatestcaseforeachofthesepaths.Thissetoftest
caseswillguaranteebothstatementandbranchcoverage.
Notethatmultiplesetsofbasispathscanbecreatedthatarenotnecessarilyunique.Eachset,
however,hasthepropertythatasetoftestcasesbasedonitwillexecuteeverystatementand
everybranch.
Example
ConsiderthefollowingexamplefromBrown&Donaldson.Itisthecodethatdetermines
whetherB&Dshouldbuyorsellaparticularstock.Unfortunately,theinnerworkingsareahighly
classifiedtradesecretsotheactualprocessingcodehasbeenremovedandgeneric
statementslikes1;s2;etc.havesubstitutedforthem.Thecontrolflowstatementshavebeen
leftintactbuttheiractualconditionshavebeenremovedandgenericconditionslikec1andc2
havebeenputintheirplace.(Youdidn'tthinkwe'dreallyshowyouhowtoknowwhethertobuy
orsellstocks,didyou?)
Note s1,s2,...representJavastatementswhilec1,c2,...representconditions.
booleanevaluateBuySell(TickerSymbolts){
s1;
s2;
s3;
if(c1){s4;s5;s6;}
else{s7;s8;}
while(c2){
s9;
s10;
switch(c3){
case-A:
s20;
s21;
s22;
break;//EndofCase-A
case-B:
s30;
s31;
if(c4){
s32;
s33;
s34;
}
else{
s35;
}
break;//EndofCase-B
case-C:
s40;
s41;
break;//EndofCase-C
case-D:
s50;
break;//EndofCase-D
}//EndSwitch
s60;
s61;
s62;
if(c5){s70;s71;}
s80;
s81;
}//EndWhile
s90;
s91;
s92;
returnresult;
Figure10-15:JavacodeforBrown&Donaldson'sevaluateBuySellmodule.
ThefollowingflowdiagramcorrespondstothisJavacode: 
Figure10-16:ControlflowgraphforBrown&Donaldson'sevaluateBuySellmodule.
Thecyclomaticcomplexityofthisdiagramiscomputedbyedges-nodes+2
or
22-16+2=8
Let'sremovethecodeandlabeleachnodeforsimplicityindescribingthepaths.
Figure10-17:ControlflowgraphforBrown&Donaldson'sevaluateBuySellmodule.
Asetofeightbasispathsis:
1. ABDP
2. ACDP
3. ABDEFGMODP
4. ABDEFHKMODP
5. ABDEFIMODP
6. ABDEFJMODP
7. ABDEFHLMODP
8. ABDEFIMNODP
Rememberthatbasispathsetsarenotunique;therecanbemultiplesetsofbasispathsfora
graph.
Thisbasispathsetisnowimplementedastestcases.Choosevaluesfortheconditionsthat
wouldsensitizeeachpathandexecutethetests.
Table10-1:Datavaluestosensitizethedifferentcontrolflowpaths.
TestCase C1 C2 C3 C4 C5
1 False False N/A N/A N/A
2 True False N/A N/A N/A
3 False True A N/A False
4 False True B False False
5 False True C N/A False
6 False True D N/A False
7 False True B True False
8 False True C N/A True
ApplicabilityandLimitations
Controlflowtestingisthecornerstoneofunittesting.Itshouldbeusedforallmodulesofcode
thatcannotbetestedsufficientlythroughreviewsandinspections.Itslimitationsarethatthe
testermusthavesufficientprogrammingskilltounderstandthecodeanditscontrolflow.In
addition,controlflowtestingcanbeverytimeconsumingbecauseofallthemodulesandbasis
pathsthatcompriseasystem.
Summary
Controlflowtestingidentifiestheexecutionpathsthroughamoduleofprogramcode
andthencreatesandexecutestestcasestocoverthosepaths.
Controlflowgraphsarethefoundationofcontrolflowtesting.Modulesofcodeare
convertedtographs,thepathsthroughthegraphsareanalyzed,andtestcasesare
createdfromthatanalysis.
CyclomaticComplexityisexactlytheminimumnumberofindependent,nonloopingpaths
(calledbasispaths)thatcan,inlinearcombination,generateallpossiblepathsthrough
themodule.
Becausethesetofbasispathscoversalltheedgesandnodesofthecontrolflow
graph,satisfyingthisstructuredtestingcriteriaautomaticallyguaranteesbothbranch
andstatementcoverage.
Practice
1. Belowisabriefprogramlisting.Createthecontrolflowdiagram,determineits
CyclomaticComplexity,chooseasetofbasispaths,anddeterminethenecessary
valuesfortheconditionstosensitizeeachpath.
if(c1){
while(c2){
if(c3){s1;s2;
if(c5)s5;
elses6;
break;//Skiptoendofwhile
else
if(c4){}
else{s3;s4;break;}
}//Endofwhile
}//Endofif
s7;
if(c6)s8;s9;
s10;
References
Beizer,Boris(1990).SoftwareTestingTechniques(SecondEdition).VanNostrand
Reinhold.
Myers,Glenford(1979).TheArtofSoftwareTesting.JohnWiley&Sons.
Pressman,RogerS.(1982).SoftwareEngineering:APractitioner'sApproach(Fourth
Edition).McGraw-Hill.
Watson,ArthurH.andThomasJ.McCabe.StructuredTesting:ATestingMethodology
UsingtheCyclomaticComplexityMetric.NISTSpecialPublication500-235availableat
http://www.mccabe.com/nist/nist_pub.php
Chapter11:DataFlowTesting
Hollyhadreachedtheageandlevelofmaturitytocomprehendtheemotionalnuancesof
ThomasWolfe'sassertion"youcan'tgohomeagain,"butinhercaseitwasevenmore
poignantbecausetherewasnohometoreturnto:herparentshadseparated,soldthe
house,euthanizedBowser,anddisownedHollyfordroppingoutofhighschooltomarry
that43-year-oldmanagerofTrailerTowninIdahoandeventheirtrailerwasn'taplace
shecouldcallhomebecauseitwasonlyasummersublet.
—EileenOstrowFeldman
Introduction
Almosteveryprogrammerhasmadethistypeofmistake:
main(){
intx;
if(x==42){...}
}
Themistakeisreferencingthevalueofavariablewithoutfirstassigningavaluetoit.Naive
developersunconsciouslyassumethatthelanguagecompilerorrun-timesystemwillsetall
variablestozero,blanks,TRUE,42,orwhatevertheyrequirelaterintheprogram.AsimpleC
programthatillustratesthisdefectis:
#include<stdio.h>
main(){
intx;
printf("%d",x);
}
Thevalueprintedwillbewhatevervaluewas"leftover"inthememorylocationtowhichxhas
beenassigned,notnecessarilywhattheprogrammerwantedorexpected.
Dataflowtestingisapowerfultooltodetectjustsucherrors.RappsandWeyuker,
popularizersofthisapproach,wrote,"Itisourbeliefthat,justasonewouldnotfeelconfident
aboutaprogramwithoutexecutingeverystatementinitaspartofsometest,oneshouldnot
feelconfidentaboutaprogramwithouthavingseentheeffectofusingthevalueproducedby
eachandeverycomputation."
Key
Point
Dataflowtestingisapowerfultooltodetectimproperuseofdatavaluesdueto
codingerrors.
Technique
Variablesthatcontaindatavalueshaveadefinedlifecycle.Theyarecreated,theyareused,
andtheyarekilled(destroyed).Insomeprogramminglanguages(FORTRANandBASIC,for
example)creationanddestructionareautomatic.Avariableiscreatedthefirsttimeitis
assignedavalueanddestroyedwhentheprogramexits.
Inotherlanguages(likeC,C++,andJava)thecreationisformal.Variablesaredeclaredby
statementssuchas:
intx;//xiscreatedasaninteger
stringy;//yiscreatedasastring
Thesedeclarationsgenerallyoccurwithinablockofcodebeginningwithanopeningbrace{
andendingwithaclosingbrace}.Variablesdefinedwithinablockarecreatedwhentheir
definitionsareexecutedandareautomaticallydestroyedattheendofablock.Thisiscalled
the"scope"ofthevariable.Forexample:
{//beginouterblock
intx;//xisdefinedasanintegerwithinthisouterblock
...;//xcanbeaccessedhere
{//begininnerblock
inty;//yisdefinedwithinthisinnerblock
...;//bothxandycanbeaccessedhere
}//yisautomaticallydestroyedattheendof
//thisblock
...;//xcanstillbeaccessed,butyisgone
}//xisautomaticallydestroyed
Variablescanbeusedincomputation(a=b+1).Theycanalsobeusedinconditionals(if
(a>42)).Inbothusesitisequallyimportantthatthevariablehasbeenassignedavaluebefore
itisused.
Threepossibilitiesexistforthefirstoccurrenceofavariablethroughaprogrampath:
1. ~dthevariabledoesnotexist(indicatedbythe~),thenitisdefined(d)
2. ~uthevariabledoesnotexist,thenitisused(u)
3. ~k thevariabledoesnotexist,thenitiskilledordestroyed(k)
Thefirstiscorrect.Thevariabledoesnotexistandthenitisdefined.Thesecondisincorrect.A
variablemustnotbeusedbeforeitisdefined.Thethirdisprobablyincorrect.Destroyinga
variablebeforeitiscreatedisindicativeofaprogrammingerror.
Nowconsiderthefollowingtime-sequencedpairsofdefined(d),used(u),andkilled(k):
ddDefinedanddefinedagain—notinvalidbutsuspicious.Probablyaprogrammingerror.
duDefinedandused—perfectlycorrect.Thenormalcase.
dk Definedandthenkilled—notinvalidbutprobablyaprogrammingerror.
ud Usedanddefined—acceptable.
uu Usedandusedagain—acceptable.
uk Usedandkilled—acceptable.
kd Killedanddefined—acceptable.Avariableiskilledandthenredefined.
ku Killedandused—aseriousdefect.Usingavariablethatdoesnotexistorisundefinedis
alwaysanerror.
kk Killedandkilled—probablyaprogrammingerror.
Key
Point Examinetime-sequencedpairsofdefined,used,andkilledvariablereferences.
Adataflowgraphissimilartoacontrolflowgraphinthatitshowstheprocessingflowthrough
amodule.Inaddition,itdetailsthedefinition,use,anddestructionofeachofthemodule's
variables.Wewillconstructthesediagramsandverifythatthedefine-use-killpatternsare
appropriate.First,wewillperformastatictestofthediagram.By"static"wemeanwe
examinethediagram(formallythroughinspectionsorinformallythroughlook-sees).Second,we
performdynamictestsonthemodule.By"dynamic"wemeanweconstructandexecutetest
cases.Let'sbeginwiththestatictesting.
StaticDataFlowTesting
Thefollowingcontrolflowdiagramhasbeenannotatedwithdefine-use-killinformationforeach
ofthevariablesusedinthemodule.
Figure11-1:Thecontrolflowdiagramannotatedwithdefine-use-killinformation
foreachofthemodule'svariables.
Foreachvariablewithinthemodulewewillexaminedefine-use-killpatternsalongthecontrol
flowpaths.Considervariablexaswetraversetheleftandthentherightpath:
Figure11-2:Thecontrolflowdiagramannotatedwithdefine-use-killinformationforthex
variable.
Thedefine-use-killpatternsforx(takeninpairsaswefollowthepaths)are:
~define correct,thenormalcase
define-definesuspicious,perhapsaprogrammingerror
define-use correct,thenormalcase
Nowforvariabley.Notethatthefirstbranchinthemodulehasnoimpactontheyvariable.
Figure11-3:Thecontrolflowdiagramannotatedwithdefine-use-killinformation
fortheyvariable.
Thedefine-use-killpatternsfory(takeninpairsaswefollowthepaths)are:
~use majorblunder
use-defineacceptable
define-usecorrect,thenormalcase
use-kill acceptable
define-kill probableprogrammingerror
Nowforvariablez.
Figure11-4:Thecontrolflowdiagramannotatedwithdefine-use-killinformation
forthezvariable.
Thedefine-use-killpatterns(takeninpairsaswefollowthepaths)are:
~kill programmingerror
kill-use majorblunder
use-use correct,thenormalcase
use-defineacceptable
kill-kill probablyaprogrammingerror
kill-define acceptable
define-usecorrect,thenormalcase
Inperformingastaticanalysisonthisdataflowmodelthefollowingproblemshavebeen
discovered:
x:define-define
y:~use
y:define-kill
z:~kill
z:kill-use
z:kill-kill
Unfortunately,whilestatictestingcandetectmanydataflowerrors,itcannotfindthemall.
Considerthefollowingsituations:
1. Arraysarecollectionsofdataelementsthatsharethesamenameandtype.For
example
intstuff[100];
definesanarraynamedstuffconsistingof100integerelements.InC,C++,andJava
theindividualelementsarenamedstuff[0],stuff[1],stuff[2],etc.Arraysaredefined
anddestroyedasaunitbutspecificelementsofthearrayareusedindividually.Often
programmersrefertostuff[j]wherejchangesdynamicallyastheprogramexecutes.
Inthegeneralcase,staticanalysiscannotdeterminewhetherthedefine-use-killrules
havebeenfollowedproperlyunlesseachelementisconsideredindividually.
2. Incomplexcontrolflowsitispossiblethatacertainpathcanneverbeexecuted.In
thiscaseanimproperdefine-use-killcombinationmightexistbutwillneverbe
executedandsoisnottrulyimproper.
3. Insystemsthatprocessinterrupts,someofthedefine-use-killactionsmayoccurat
theinterruptlevelwhileotherdefine-use-killactionsoccuratthemainprocessing
level.Inaddition,ifthesystemusesmultiplelevelsofexecutionpriorities,static
analysisofthemyriadofpossibleinteractionsissimplytoodifficulttoperform
manually.
Forthisreason,wenowturntodynamicdataflowtesting.
DynamicDataFlowTesting
Becausedataflowtestingisbasedonamodule'scontrolflow,itassumesthatthecontrolflow
isbasicallycorrect.Thedataflowtestingprocessistochooseenoughtestcasessothat:
Every"define"istracedtoeachofits"uses"
Every"use"istracedfromitscorresponding"define"
Todothis,enumeratethepathsthroughthemodule.Thisisdoneusingthesameapproachas
incontrolflowtesting:Beginatthemodule'sentrypoint,taketheleftmostpaththroughthe
moduletoitsexit.Returntothebeginningandvarythefirstbranchingcondition.Followthat
pathtotheexit.Returntothebeginningandvarythesecondbranchingcondition,thenthethird,
andsoonuntilallthepathsarelisted.Then,foreveryvariable,createatleastonetestcaseto
covereverydefine-usepair.
ApplicabilityandLimitations
Dataflowtestingbuildsonandexpandscontrolflowtestingtechniques.Aswithcontrolflow
testing,itshouldbeusedforallmodulesofcodethatcannotbetestedsufficientlythrough
reviewsandinspections.Itslimitationsarethatthetestermusthavesufficientprogrammingskill
tounderstandthecode,itscontrolflow,anditsvariables.Likecontrolflowtesting,dataflow
testingcanbeverytimeconsumingbecauseofallthemodules,paths,andvariablesthat
compriseasystem.
Summary
Acommonprogrammingmistakeisreferencingthevalueofavariablewithoutfirst
assigningavaluetoit.
Adataflowgraphissimilartoacontrolflowgraphinthatitshowstheprocessingflow
throughamodule.Inaddition,itdetailsthedefinition,use,anddestructionofeachof
themodule'svariables.Wewillusethesediagramstoverifythatthedefine-use-kill
patternsareappropriate.
Enumeratethepathsthroughthemodule.Then,foreveryvariable,createatleastone
testcasetocovereverydefine-usepair.
Practice
1. Thefollowingmoduleofcodecomputesn!(nfactorial)givenavalueforn.Create
dataflowtestcasescoveringeachvariableinthismodule.Remember,asingletest
casecancoveranumberofvariables.
intfactorial(intn){
intanswer,counter;
answer=1;
counter=1;
loop:
if(counter>n)returnanswer;
answer=answer*counter;
counter=counter+1;
gotoloop;
}
2. Diagramthecontrolflowpathsandderivethedataflowtestcasesforthefollowing
module:
intmodule(intselector){
intfoo,bar;
switchselector{
caseSELECT-1:
foo=calc_foo_method_1();
break;
caseSELECT-2:
foo=calc_foo_method_2();
break;
caseSELECT-3:
foo=calc_foo_method_3();
break;
}
switchfoo{
caseFOO-1:
bar=calc_bar_method_1();
break;
caseFOO-2:
bar=calc_bar_method_2();
break;
}
returnfoo/bar;
}
Doyouhaveanyconcernswiththiscode?Howwouldyoudealwiththem?
References
Beizer,Boris(1990).SoftwareTestingTechniques.VanNostrandReinhold.
Binder,RobertV.(2000).TestingObject-OrientedSystems:Models,Patterns,and
Tools.Addison-Wesley.
Marick,Brian(1995).TheCraftofSoftwareTesting:SubsystemTestingIncluding
Object-BasedandObject-OrientedTesting.Prentice-Hall.
Rapps,SandraandElaineJ.Weyuker."DataFlowAnalysisTechniquesforTestData
Selection."SixthInternationalConferenceonSoftwareEngineering,Tokyo,Japan,
September13–16,1982.
SectionIII:TestingParadigms
ChapterList
Chapter12:ScriptedTesting
Chapter13:ExploratoryTesting
Chapter14:TestPlanning
PartOverview
Paradigms
Inhisbook,Paradigms:TheBusinessofDiscoveringtheFuture,JoelBarkerdefinesa
paradigmas"asetofrulesandregulations(writtenorunwritten)thatdoestwothings:(1)it
establishesordefinesboundaries,and(2)ittellsyouhowtobehaveinsidetheboundariesin
ordertobesuccessful."FuturistMarilynFergusonseesaparadigmas"aframeworkofthought
...aschemeforunderstandingandexplainingcertainaspectsofreality."
Paradigmsareusefulbecausetheyhelpusmakesenseofthecomplexitiesoftheworldaround
us.Inthisway,paradigmssharpenourvision.Butparadigmscanblindustorealities.
Paradigmsactaspsychologicalfilters.Datathatdoesnotmatchourparadigmsisblocked.In
thisway,paradigmscloudourvision.
Insoftwaretestingtoday,twoverydifferentparadigmsarebattlingforadherents—scripted
testingandexploratorytesting.
Scriptedtestingisbasedonthesequentialexaminationofrequirements,followedbythedesign
anddocumentationoftestcases,followedbytheexecutionofthosetestcases.Thescripted
tester'smottois,"Planyourwork,workyourplan."
Exploratorytestingisaverydifferentparadigm.Ratherthanasequentialapproach,exploratory
testingemphasizessimultaneouslearning,testdesign,andtestexecution.Thetesterdesigns
andexecutestestswhileexploringtheproduct.
WordOf
Warning!
Inthefollowingchaptersthescriptedandexploratoryparadigmsare
definedattheextremeendsofthespectrum.Rarelywilleitherbeusedas
inflexiblyasdescribed.
Thenexttwochaptersdescribetheseparadigms.Awordofwarningthough—eachparadigmis
describedattheextremeendoftheprocessspectrum.Rarelywilleitherparadigmbeusedas
inflexiblyasdescribed.Moreoften,scriptedtestingmaybesomewhatexploratoryand
exploratorytestingmaybesomewhatscripted.
TestPlanning
Planninghasbeendefinedassimply"figuringoutwhattodonext."Tobemosteffectiveand
efficient,planningisimportant.Butwhenandhowshouldthatplanningbedone?Scripted
testingemphasizesthevalueofearlytestdesignasamethodofdetectingrequirementsand
designdefectsbeforethecodeiswrittenandthesystemputintoproduction.Itsfocusison
accountabilityandrepeatability.Exploratorytestingchallengestheideathattestsmustbe
designedsoveryearlyintheproject,whenourknowledgeistypicallyatitsminimum.Itsfocus
isonlearningandadaptability.
References
Barker,JoelArthur(1992).Paradigms:TheBusinessofDiscoveringtheFuture.
HarperCollins.
Ferguson,Marilyn(1980).TheAquarianConspiracy:PersonalandSocial
TransformationinOurTime.PutnamPublishingGroup.
Chapter12:ScriptedTesting
Janewastoast,andnotthelightbutterykind,nay,shewasthekindthat'sbeencharred
andblackenedinthebottomofthetoasterandhastobethrownawaybecausenomatter
howmuchoftheburntpartyouscrapeoffwithaknife,there'salwaysmoreblackened
toastbeneath,thekindthatnotevenstarvingbirdsinwinterwilleat,thatkindoftoast.
—BethKnutson
Introduction
Forscriptedtestingtobeunderstood,itmustbeunderstoodinitshistoricalcontext.Scripted
testingemergedasoneofthecomponentpartsoftheWaterfallmodelofsoftware
development.TheWaterfallmodeldefinesanumberofsequentialdevelopmentphaseswith
specificentryandexitcriteria,taskstobeperformed,anddeliverables(tangibleworkproducts)
tobecreated.Itisaclassicexampleofthe"planyourwork,workyourplan"philosophy.
TypicalWaterfallphasesinclude:
1. SystemRequirements-Gatheringtherequirementsforthesystem.
2. SoftwareRequirements-Gatheringtherequirementsforthesoftwareportionofthe
system.
3. RequirementsAnalysis-Analyzing,categorizing,andrefiningthesoftware
requirements.
4. ProgramDesign-Choosingarchitectures,modules,andinterfacesthatdefinethe
system.
5. Coding-Writingtheprogrammingcodethatimplementsthedesign.
6. Testing-Evaluatingwhethertherequirementswereproperlyunderstood(Validation)
andthedesignproperlyimplementedbythecode(Verification).
7. Operations-Putthesystemintoproduction.
InterestingTriviaAGooglesearchfor"planyourwork"and"workyourplan"found3,570
matchesincluding:
Footballrecruiting
Businessplanning
Buildingwithconcreteblocks
Onlinemarketing
Industrialdistribution
ThePrincetonUniversity'sWomen'sWaterPoloTeam
Andthousandsmore
Thismodelwasfirstdescribedin1970inapaperentitled"ManagingtheDevelopmentofLarge
ScaleSystems"byDr.WinstonW.Royce.Roycedrewthefollowingdiagramshowingthe
relationshipsbetweendevelopmentphases:
Figure12-1:TheWaterfalllifecyclemodel.
WhatprocesswasusedbeforeWaterfall?Itisaprocessknownas"Code&Fix."
Programmerssimplycoded.Sloganslike"Requirements?Requirements?Wedon'tneedno
stinkin'Requirements!"hungonthewallsofprogrammers'offices.Developmentwaslikethe
sceneinthemovieRaidersoftheLostArk.Ourhero,IndianaJones,ishidingfromthebad
guys.Indysays,"I'mgoingtogetthattruck."Marion,ourheroine,turnstohimandasks,"How
areyougoingtogetthattruck?"Indyreplies,"Idon'tknow.I'mmakingthisupasIgo."Ifwe
substituted"buildthatsystem"for"getthattruck"we'dhavethewayrealmenandrealwomen
builtsoftwaresystemsinthegoodolddays.
CuriousHistoricalNoteToday,WinstonRoyceisknownasthefatheroftheWaterfall
modelofsoftwaredevelopment.Infact,inhispaperhewasactuallyproposinganiterative
andincrementalprocessthatincludedearlyprototyping-somethingmanyorganizations
arejustnowdiscovering.
Todaywetakeadifferentviewofscriptedtesting.Anydevelopmentmethodologyalongthe
spectrumfromWaterfalltoRapidApplicationDevelopment(RAD)mayusescriptedtesting.
Wheneverrepeatability,objectivity,andauditabilityareimportant,scriptedtestingcanbeused.
Repeatabilitymeansthatthereisadefinitionofatest(fromdesignthroughtodetailed
procedure)atalevelofdetailsufficientforsomeoneotherthantheauthortoexecuteitinan
identicalway.Objectivitymeansthatthetestcreationdoesnotdependontheextrordinary
(nearmagical)skillofthepersoncreatingthetestbutisbasedonwellunderstoodtestdesign
principles.Auditabilityincludestraceabilityfromrequirements,design,andcodetothetest
casesandbackagain.Thisenablesformalmeasuresoftestingcoverage.
"Planyourwork,workyourplan."Nophrasesoepitomizesthescriptedtestingapproachas
doesthisone,andnodocumentsoepitomizesthescriptedtestingapproachasdoesIEEEStd
829-1998,the"IEEEStandardforSoftwareTestDocumentation."
Thisstandarddefineseightdocumentsthatcanbeusedinsoftwaretesting.Thesedocuments
are:
Testplan
Testdesignspecification
Testcasespecification
Testprocedurespecification
Testitemtransmittalreport
Testlog
Testincidentreport
Testsummaryreport
Figure12-2showstherelationshipsbetweenthesedocuments.Notethatthefirstfour
documentsthatdefinethetestplan,testdesigns,andtestcasesareallcreatedbeforethe
productisdevelopedandtheactualtestingisbegun.Thisisakeyideainscriptedtesting—plan
thetestsbasedontheformalsystemrequirements.
Figure12-2:TheIEEE829TestDocuments Curiously,theIEEE829
standardstates,"Thisstandardspecifiestheformandcontentofindividualtestdocuments.
Itdoesnotspecifytherequiredsetoftestdocuments."Inotherwords,thestandarddoes
notrequireyoutocreateanyofthedocumentsdescribed.Thatchoiceislefttoyouasa
tester,ortoyourorganization.But,thestandardrequiresthatifyouchoosetowriteatest
plan,testcasespecification,etc.,thatdocumentmustfollowtheIEEE829standard.
TheIEEE829standardliststheseadvantagesforitsuse:
"Astandardizedtestdocumentcanfacilitatecommunicationbyprovidingacommon
frameofreference.
Thecontentdefinitionofastandardizedtestdocumentcanserveasacompleteness
checklistfortheassociatedtestingprocess.
Astandardizedsetcanalsoprovideabaselinefortheevaluationofcurrenttest
documentationpractices.
Theuseofthesedocumentssignificantlyincreasesthemanageabilityoftesting.
Increasedmanageabilityresultsfromthegreatlyincreasedvisibilityofeachphaseof
thetestingprocess."
IEEE829DocumentDescriptions
TheIEEE829standarddefineseightdifferentdocuments.Eachdocumentiscomposedofa
numberofsections.
TestPlan
Thepurposeofthetestplanistodescribethescope,approach,resources,and
scheduleofthetestingactivities.Itdescribestheitems(components)andfeatures
(functionality,performance,security,usability,etc.)tobetested,taskstobe
performed,deliverables(tangibleworkproducts)tobecreated,testingresponsibilities,
schedules,andapprovalsrequired.Testplanscanbecreatedattheprojectlevel
(mastertestplan)oratsubsidiarylevels(unit,integration,system,acceptance,etc.).
Thetestplaniscomposedofthefollowingsections:
1. Testplanidentifier-Auniqueidentifiersothatthisdocumentcanbe
distinguishedfromallotherdocuments.
2. Introduction-Asummaryofthesoftwaretobetested.Abriefdescriptionand
historymaybeincludedtosetthecontext.Referencestootherrelevant
documentsusefulforunderstandingthetestplanareappropriate.Definitions
ofunfamiliartermsmaybeincluded.
3. Testitems-Identifiesthesoftwareitemsthataretobetested.Theword
"item"ispurposelyvague.Itisa"chunk"ofsoftwarethatistheobjectof
testing.
4. Featurestobetested-Identifiesthecharacteristicsoftheitemstobetested.
Theseincludefunctionality,performance,security,portability,usability,etc.
5. Featuresnottobetested-Identifiescharacteristicsoftheitemsthatwillnot
betestedandthereasonswhy.
6. Approach-Theoverallapproachtotestingthatwillensurethatallitemsand
theirfeatureswillbeadequatelytested.
7. Itempass/failcriteria-Thecriteriausedtodeterminewhethereachtestitem
haspassedorfailedtesting.
8. Suspensioncriteriaandresumptionrequirements-Theconditionsunderwhich
testingwillbesuspendedandthesubsequentconditionsunderwhichtesting
willberesumed.
9. Testdeliverables-Identifiesthedocumentsthatwillbecreatedasapartof
thetestingprocess.
10. Testingtasks-Identifiesthetasksnecessarytoperformthetesting.
11. Environmentalneeds-Specifiestheenvironmentrequiredtoperformthe
testingincludinghardware,software,communications,facilities,tools,people,
etc.
12. Responsibilities-Identifiesthepeople/groupsresponsibleforexecutingthe
testingtasks.
13. Staffingandtrainingneeds-Specifiesthenumberandtypesofpeople
requiredtoperformthetesting,includingtheskillsneeded.
14. Schedule-Definestheimportantkeymilestonesanddatesinthetesting
process.
15. Risksandcontingencies-Identifieshigh-riskassumptionsofthetestingplan.
Specifiespreventionandmitigationplansforeach.
16. Approvals-Specifiesthenamesandtitlesofeachpersonwhomustapprove
theplan.
TestDesignSpecification
Thepurposeofthetestdesignspecificationistoidentifyasetoffeaturestobetested
andtodescribeagroupoftestcasesthatwilladequatelytestthosefeatures.In
addition,refinementstotheapproachlistedinthetestplanmaybespecified.Thetest
designspecificationiscomposedofthefollowingsections:
1. Testdesignspecificationidentifier-Auniqueidentifiersothatthisdocument
canbedistinguishedfromallotherdocuments.
2. Featurestobetested-Identifiesthetestitemsandthefeaturesthatarethe
objectofthistestdesignspecification.
3. Approachrefinements-Specifiesthetesttechniquestobeusedforthistest
design.
4. Testidentification-Liststhetestcasesassociatedwiththistestdesign.
Providesauniqueidentifierandashortdescriptionforeachtestcase.
5. Featurepass/failcriteria-Thecriteriausedtodeterminewhethereach
featurehaspassedorfailedtesting.
TestCaseSpecification
Thepurposeofthetestcasespecificationistospecifyindetaileachtestcaselistedin
thetestdesignspecification.Thetestcasespecificationiscomposedofthefollowing
sections:
1. Testcasespecificationidentifier-Auniqueidentifiersothatthisdocumentcan
bedistinguishedfromallotherdocuments.
2. Testitems-Identifiestheitemsandfeaturestobetestedbythistestcase.
3. Inputspecifications-Specifieseachinputrequiredbythistestcase.
4. Outputspecifications-Specifieseachoutputexpectedafterexecutingthis
testcase.
5. Environmentalneeds-Anyspecialhardware,software,facilities,etc.required
fortheexecutionofthistestcasethatwerenotlistedinitsassociatedtest
designspecification.
6. Specialproceduralrequirements-Definesanyspecialsetup,execution,or
cleanupproceduresuniquetothistestcase.
7. Intercasedependencies-Listsanytestcasesthatmustbeexecutedpriorto
thistestcase.
TestProcedureSpecification
Thepurposeofthetestprocedurespecificationistospecifythestepsforexecutinga
testcaseandtheprocessfordeterminingwhetherthesoftwarepassedorfailedthe
test.Thetestprocedurespecificationiscomposedofthefollowingsections:
1. Testprocedurespecificationidentifier-Auniqueidentifiersothatthis
documentcanbedistinguishedfromallotherdocuments.
2. Purpose-Describesthepurposeofthetestprocedureanditscorresponding
testcases.
3. Specialrequirements-Listsanyspecialrequirementsfortheexecutionofthis
testprocedure.
4. Proceduresteps-Liststhestepsoftheprocedure.Possiblestepsinclude:
Setup,Start,Proceed,Measure,ShutDown,Restart,Stop,andWrapUp.
TestItemTransmittalReport(a.k.a.ReleaseNotes)
Thepurposeofthetestitemtransmittalreportistospecifythetestitemsbeing
providedfortesting.Thetestitemtransmittalreportiscomposedofthefollowing
sections:
1. Transmittalreportidentifier-Auniqueidentifiersothatthisdocumentcanbe
distinguishedfromallotherdocuments.
2. Transmitteditems-Liststheitemsbeingtransmittedfortestingincludingtheir
versionorrevisionlevel.
3. Location-Identifiesthelocationofthetransmitteditems.
4. Status-Describesthestatusoftheitemsbeingtransmitted.Includeany
deviationsfromtheitem'sspecifications.
5. Approvals-Specifiesthenamesandtitlesofallpersonswhomustapprove
thistransmittal.
TestLog
Thepurposeofthetestlogistoprovideachronologicalrecordaboutrelevantdetails
observedduringthetestexecution.Thetestlogiscomposedofthefollowingsections:
1. Testlogidentifier-Auniqueidentifiersothatthisdocumentcanbe
distinguishedfromallotherdocuments.
2. Description-Identifiestheitemsbeingtestedandtheenvironmentunder
whichthetestwasperformed.
3. Activityandevententries-Foreachevent,liststhebeginningandendingdate
andtime,abriefdescriptionofthetestexecution,theresultsofthetest,and
uniqueenvironmentalinformation,anomalouseventsobserved,andthe
incidentreportidentifierifanincidentwaslogged.
TestIncidentReport(a.k.a.BugReport)
Thepurposeofthetestincidentreportistodocumentanyeventobservedduring
testingthatrequiresfurtherinvestigation.Thetestincidentreportiscomposedofthe
followingsections:
1. Testincidentreportidentifier-Auniqueidentifiersothatthisdocumentcanbe
distinguishedfromallotherdocuments.
2. Summary-Summarizestheincident.
3. Incidentdescription-Describestheincidentintermsofinputs,expected
results,actualresults,environment,attemptstorepeat,etc.
4. Impact-Describestheimpactthisincidentwillhaveonothertestplans,test
designspecifications,testprocedures,andtestcasespecifications.Also
describes,ifknown,theimpactthisincidentwillhaveonfurthertesting.
TestSummaryReport
Thepurposeofthetestsummaryreportistosummarizetheresultsofthetesting
activitiesandtoprovideanevaluationbasedontheseresults.Thetestsummaryreport
iscomposedofthefollowingsections:
1. Testsummaryreportidentifier-Auniqueidentifier(imaginethat!)sothatthis
documentcanbedistinguishedfromallotherdocuments.
2. Summary-Summarizestheevaluationofthetestitems.
3. Variance-Reportsanyvariancesfromtheexpectedresults.
4. Comprehensiveassessment-Evaluatestheoverallcomprehensivenessofthe
testingprocessitselfagainstcriteriaspecifiedinthetestplan.
5. Summaryofresults-Summarizestheresultsofthetesting.Identifiesall
unresolvedincidents.
6. Evaluation-Providesanoverallevaluationofeachtestitemincludingits
limitations.
7. Summaryofactivities-Summarizesthemajortestingactivitiesbytaskand
resourceusage.
8. Approvals-Specifiesthenamesandtitlesofeachpersonwhomustapprove
thereport.
AdvantagesofScriptedTesting
1. Scriptedtestingprovidesadivisionoflabor—planning,testcasedesign,testcase
implementation,andtestcaseexecutionthatcanbeperformedbypeoplewith
specificskillsandatdifferenttimesduringthedevelopmentprocess.
2. Testdesigntechniquessuchasequivalenceclasspartitioning,boundaryvaluetesting,
controlflowtesting,pairwisetesting,etc.canbeintegratedintoaformaltesting
processdescriptionthatnotonlyguidesourtestingbutthatcouldalsobeusedto
auditforprocesscompliance.
3. Becausescriptedtestsarecreatedfromrequirements,design,andcode,all
importantattributesofthesystemwillbecoveredbytestsandthiscoveragecanbe
demonstrated.
4. Becausethetestcasescanbetracedbacktotheirrespectiverequirements,design,
andcode,coveragecanbeclearlydefinedandmeasured.
5. Becausethetestsaredocumented,theycanbeeasilyunderstoodandrepeated
whennecessarywithoutadditionaltestanalysisordesigneffort.
6. Becausethetestsaredefinedindetail,theyaremoreeasilyautomated.
7. Becausethetestsarecreatedearlyinthedevelopmentprocess,thismayfreeup
additionaltimeduringthecriticaltestexecutionperiod.
8. Insituationswhereagoodrequirementsspecificationislacking,thetestcases,atthe
endoftheproject,becomethedefactorequirementsspecification,includingthe
resultsthatdemonstratewhichrequirementswereactuallyfulfilledandwhichwere
not.
9. Scriptedtests,whenwrittentotheappropriatelevelofdetail,canberunbypeople
whowouldotherwisenotbeabletotestthesystembecauseoflackofdomain
knowledgeorlackoftestingknowledge.
10. Youmayhavespecialcontractualrequirementsthatcanonlybemetbyscripted
testing.
11. Theremaybecertainteststhatmustbeexecutedinjustthesameway,everytime,in
ordertoserveasakindofbenchmark.
12. Bycreatingthetestsearlyintheprojectwecandiscoverwhatwedon'tknow.
13. Bycreatingthetestsearlywecanfocusonthe"bigpicture."
InhisbookSoftwareSystemTestingandQualityAssurance,BorisBeizersummarizesinthis
way:
"Testingislikeplayingpool.There'srealpoolandkiddiepool.Inkiddiepool,youhitthe
ballsandwhateverpockettheyhappentofallinto,youclaimastheintendedpocket.It's
notmuchofagameandalthoughsuitabletoten-year-oldsit'shardlyachallenge.The
objectofrealpoolistospecifythepocketinadvance.Similarlyfortesting.There'sreal
testingandkiddietesting.Inkiddietesting,thetestersays,afterthefact,thatthe
observedoutcomewastheintendedoutcome.Inrealtestingtheoutcomeispredictedand
documentedbeforethetestisrun."
DisadvantagesofScriptedTesting
1. Scriptedtestingisverydependentonthequalityofthesystem'srequirements.Will
therequirementsreallybecomplete,consistent,unambiguous,andstableenoughas
thefoundationforscriptedtesting?Perhapsnot.
2. Scriptedtestingis,bydefinition,inflexible.Itfollowsthescript.If,whiletesting,we
seesomethingcurious,wenoteitinaTestIncidentReportbutwedonotpursueit.
Whynot?Becauseitisnotinthescripttodoso.Manyinterestingdefectscouldbe
missedwiththisapproach.
3. Scriptedtestingisoftenusedto"de-skill"thejoboftesting.Theapproachseemsto
be,"Teachatesteraskillortwoandsendthemofftodocumentmountainsoftests.
Thesheerbulkofthetestswillprobablyfindmostofthedefects."
Summary
"Planyourwork,workyourplan."LiketheWaterfallmodel,nophrasesoepitomizes
thescriptedtestingapproachasdoesthisone,andnodocumentsoepitomizesthe
scriptedtestingapproachasdoesIEEEStd829-1998,the"IEEEStandardfor
SoftwareTestDocumentation."
TheIEEEStandard829defineseightdocumentsthatcanbeusedinsoftwaretesting.
Thesedocumentsare:testplan,testdesignspecification,testcasespecification,test
procedurespecification,testitemtransmittalreport,testlog,testincidentreport,and
testsummaryreport.
Theadvantagesofscriptedtestingincludeformaldocumentation,coverage,and
traceability.
References
Beizer,Boris(1984).SoftwareSystemTestingandQualityAssurance.VanNostrand
Reinhold.
"IEEEStandardforSoftwareTestDocumentation,"IEEEStd829-1998.TheInstituteof
ElectricalandElectronicsEngineers,Inc.ISBN0-7381-1443-X
Royce,WinstonW."ManagingtheDevelopmentofLargeSoftwareSystems,"
Proceedingsofthe9thInternationalConferenceonSoftwareEngineering,Monterey,
CA,IEEEComputerSocietyPress,LosAlamitos,CA,1987.
http://www.ipd.bth.se/uodds/pd&agile/royce.pdf
Chapter13:ExploratoryTesting
Asshecontemplatedthesettingsun,itsdyingrayscastingthelastoftheirbrilliantpurple
lightonthered-goldwatersofthelake,Debbierealizedthatsheshouldneveragainbuy
hersunglassesfromaguyparkedbythesideoftheroad.
—MalindaLingwall
Introduction
Theterm"exploratorytesting,"coinedbyCemKanerinhisbookTestingComputerSoftware,
referstoanapproachtotestingthatisverydifferentfromscriptedtesting.Ratherthana
sequentialexaminationofrequirements,followedbythedesignanddocumentationoftest
cases,followedbytheexecutionofthosetestcases,exploratorytesting,asdefinedbyJames
Bach,is"simultaneouslearning,testdesign,andtestexecution."Thetesterdesignsand
executestestswhileexploringtheproduct.
InanarticleforStickyMinds.comentitled"ExploratoryTestingandthePlanningMyth,"Bach
wrote,"ExploratoryTesting,asIpracticeit,usuallyproceedsaccordingtoaconsciousplan.
Butnotarigorousplan...it'snotscriptedindetail."Jamesadds,"Rigorrequirescertaintyand
impliescompleteness,butIperformexploratorytestingpreciselybecausethere'ssomuchI
don'tknowabouttheproductandIknowmytestingcanneverbefullycomplete."James
continues,"Totheextentthatthenexttestwedoisinfluencedbytheresultofthelasttestwe
did,wearedoingexploratorytesting.Webecomemoreexploratorywhenwecan'ttellwhat
testsshouldberun,inadvanceofthetestcycle."
ExploratoryTesting
Totheextentthatthenexttestwedoisinfluencedbytheresultofthelasttestwedid,we
aredoingexploratorytesting.Webecomemoreexploratorywhenwecan'ttellwhattests
shouldberun,inadvanceofthetestcycle.
Inexploratorytesting,thetestercontrolsthedesignoftestcasesastheyareperformedrather
thandays,weeks,orevenmonthsbefore.Inaddition,theinformationthetestergainsfrom
executingasetofteststhenguidesthetesterindesigningandexecutingthenextsetoftests.
Notethisprocessiscalledexploratorytestingtodistinguishitfromadhoctestingwhich(bymy
definition,althoughothersmaydisagree)oftendenotessloppy,careless,unfocused,random,
andunskilledtesting.Anyone,nomatterwhattheirexperienceorskilllevel,candoadhoc
testing.Thatkindoftestingisineffectiveagainstallbutthemostdefect-riddensystems,and
eventhenmaynotfindasubstantialportionofthedefects.
Bachsuggeststhatintoday'stopsy-turvyworldofincomplete,rapidlychangingrequirements
andminimaltimefortesting,theclassicalsequentialapproachofTestAnalysisfollowedbyTest
DesignfollowedbyTestCreationfollowedbyTestExecutionislikeplayingthegameof
"TwentyQuestions"bywritingoutallthequestionsinadvance.Considerthefollowing
discussionfromatestingseminardiscussingexploratorytesting:
Instructor:Let'splayagamecalled"TwentyQuestions."Iamthinkingabout
somethingintheuniverse.I'mgivingyou,theclass,twentyquestionstoidentifywhat
I'mthinkingabout.Eachquestionmustbephrasedinawaythatitcanbeanswered
"Yes"or"No."(IfIletyouphrasethequestioninanyformyoucouldask"Whatareyou
thinkingabout"andwewouldthencallthisgame"OneQuestion.")Ready?Brian,let's
beginwithyou.
TwentyQuestions:TheGame
Agameinwhichonepersonthinksofsomethingandothersaskupto20questions
todeterminewhathasbeenselected.Thequestionsmustbeanswerable"Yes"or
"No."
Whenplayedwell,eachquestionisbasedonthepreviousquestionsandtheir
answers.Writingthequestionsoutinadvancepreventsusingtheknowledge
acquiredfromeachanswer.
Brian:Doesithaveanythingtodowithsoftwaretesting?
Instructor:No,thatwouldbetooeasy.
Michael:Isitlarge?
Instructor:No,it'snotlarge.
Rebecca:Isitananimal?
Instructor:No.
Rayanne:Isitaplant?
Instructor:Yes,itisaplant.
Henry:Isitatree?
Instructor:No,itisnotatree.
Sree:Isitbig?
Instructor:No,I'vealreadysaiditisnotlarge.
Eric:Isitgreen?
Instructor:Yes,itisgreen.
Cheryl:Doesithaveleaves?
Instructor:Yes,ithasleaves.
Galina:Isitanoutdoorplant?
Instructor:Yes,itgenerallygrowsoutdoors.
Jae:Isitafloweringplant?
Instructor:No,Idon'tbelievesobutI'mnotabotanist.
Melanie:Isitashrub?
Instructor:No.
Patrick:Isitacactus?
Instructor:No,itisnotacactus.
Angel:Isitacucumber?
Instructor:No,perhapsratherthanguessingindividualplantsitwouldbemore
effectivetoidentifycategories.
Sundari:Isitaweed?
Instructor:No,goodtrythough.
Lynn:Isitaperennial?
Instructor:No,Idon'tbelieveso.Ithinkitmustbereplantedeachyear.
Julie:Doesitgrowfrombulbs?
Instructor:No.
Michelle:Isitineveryone'syard?
Instructor:No,atleastit'snotinmine.
Kristie:Isitillegal?(Laughterintheclass)
Instructor:No,it'squitelegal.Well,we'vegonethroughtheclassonce.Brian,let'sgo
backtoyou.
Brian:Isitpoisonous?
Instructor:No,althoughmychildrenthinkso.
Michael:Isiteaten?
Instructor:Yes,itiseaten.
Rebecca:Isitlettuce?
Instructor:No,notlettuce.
Rayanne:Isitspinach?
Instructor:Yes,itisspinach.Verygood.
Howsuccessfulwouldwebeatthisgameifwehadtowriteoutallthequestionsinadvance?
Whenweplaythisgamewell,eachquestiondependsonthepreviousquestionsandtheir
answers.Soitisinexploratorytesting.Eachtestprovidesuswithinformationaboutthe
product.Wemayseeevidenceoftheproduct'scorrectness;wemayseeevidenceofits
defects.Wemayseethingsthatarecurious;we'renotsurewhattheymean,thingsthatwe
wonderaboutandwanttoexplorefurther.So,aswepracticeexploratorytesting,we
concurrentlylearntheproduct,designthetests,andexecutethesetests.
Description
Inhisclassictimemanagementbook,HowtoGetControlofYourTimeandYourLife,Alan
Lakeinsuggestsweshouldconstantlyaskourselves:WhatisthemostimportantthingIcando
withmytimerightnow?Exploratorytestersaskanequivalentquestion:Whatisthemost
importanttestIcanperformrightnow?
KeyQuestion
WhatisthemostimportanttestIcanperformrightnow?
Apossibleexploratorytestingprocessis:
Creatingaconjecture(amentalmodel)oftheproperfunctioningofthesystem
Designingoneormoreteststhatwoulddisprovetheconjecture
Executingthesetestsandobservingtheoutcomes
Evaluatingtheoutcomesagainsttheconjecture
Repeatingthisprocessuntiltheconjectureisprovedordisproved
Anotherprocessmightbesimplytoexploreandlearnbeforeformingconjecturesofproper
behavior.
Exploratorytestingcanbedonewithina"timebox,"anuninterruptedblockoftimedevotedto
testing.Thesearetypicallybetweensixtyand120minutesinlength.Thisislongenoughto
performsolidtestingbutshortenoughsothatthetesterdoesnotmentallywander.Inaddition,
atimeboxofthislengthistypicallyeasiertoschedule,easiertocontrol,andeasiertoreport.
Whenperforming"charteredexploratorytesting,"acharterisfirstcreatedtoguidethetester
withinthetimebox.Thischarterdefinesaclearmissionforthetestingsession.Thechartermay
define:
Whattotest
Whatdocuments(requirements,design,usermanual,etc.)areavailabletothetester
Whattacticstouse
Whatkindsofdefectstolookfor
Whatrisksareinvolved
Thischarterisaguidelinetobeused,notascripttobefollowed.Becauseofthisapproach,
exploratorytestingmakesfulluseoftheskillsoftesters.Bachwrites,"Themorewecanmake
testingintellectuallyrichandfluid,themorelikelywewillhitupontherighttestsattheright
time."
Key
Point Thecharterisaguidelinetobeused,notascripttobefollowed.
Chartersfocustheexploratorytester'seffortswithinthetimebox.Possiblechartersinclude:
Thoroughlyinvestigateaspecificsystemfunction
Defineandthenexaminethesystem'sworkflows
Identifyandverifyalltheclaimsmadeintheusermanual
Understandtheperformancecharacteristicsofthesoftware
Ensurethatallinputfieldsareproperlyvalidated
Forceallerrorconditionstoverifyeacherrormessage
Checkthedesignagainstuserinterfacestandards
Itispossibletoperformexploratorytestingwithoutacharter.Thisiscalled"freestyle
exploratorytesting."Inthisprocesstestersusetheirskillstotheutmostastheyconcurrently
learntheproductanddesignandexecutetests.
Exploratorytestersareskilledtesters.(Ofcourse,wewanttesterstobeskillednomatter
whattestingprocessweareusing!)Theexploratorytestingapproachrespectsthoseskillsand,
infact,dependsonthem.Goodexploratorytestersare:
Goodmodelers,abletocreatementalmodelsofthesystemanditsproperbehavior.
Carefulobservers,abletosee,hear,read,andcomprehend.
Skilledtestdesigners,abletochooseappropriatetestdesigntechniquesineach
situation.Bachemphasizes,"Anexploratorytesterisfirstandforemostatest
designer."
Abletoevaluateriskandletitguidetheirtesting.
Criticalthinkers,abletogeneratediverseideas,integratetheirobservations,skills,and
experiencestoconcurrentlyexploretheproduct,designthetests,andexecutethe
tests.
Carefulreporters,abletorigorouslyandeffectivelyreporttootherswhattheyhave
observed.
Selfmanaged,abletotaketheleadintestingratherthanexecuteaplandevisedby
others.
Notdistractedbytrivialmatters.
Testerswithouttheseskillscanstillperformusefulexploratorytestingiftheyareproperly
supervisedandcoached.
Ingeneral,processesthathaveweak,slow,ornonexistentfeedbackmechanismsoftendonot
performwell.Scriptedtestingisaprimeexampleofaslowfeedbackloop.Exploratorytesting
providesatightfeedbackloopbetweenbothtestdesignandtestexecution.Inaddition,it
providestightfeedbackbetweentestersanddevelopersregardingthequalityoftheproduct
beingtested.
AdvantagesofExploratoryTesting
1. Exploratorytestingisvaluableinsituationswherechoosingthenexttestcasetobe
runcannotbedeterminedinadvance,butshouldbebasedonprevioustestsandtheir
results.
2. Exploratorytestingisusefulwhenyouareaskedtoproviderapidfeedbackona
product'squalityonshortnotice,withlittletime,offthetopofyourhead,when
requirementsarevagueorevennonexistent,orearlyinthedevelopmentprocess
whenthesystemmaybeunstable.
3. Exploratorytestingisusefulwhen,onceadefectisdetected,wewanttoexplorethe
size,scope,andvariationsofthatdefecttoprovidebetterfeedbacktoour
developers.
4. Exploratorytestingisausefuladditiontoscriptedtestingwhenthescriptedtests
become"tired,"thatis,theyarenotdetectingmanyerrors.
DisadvantagesofExploratoryTesting
1. Exploratorytestinghasnoabilitytopreventdefects.Becausethedesignofscripted
testcasesbeginsduringtherequirementsgatheringanddesignphases,defectscan
beidentifiedandcorrectedearlier.
2. Ifyouarealreadysureexactlywhichtestsmustbeexecuted,andinwhichorder,
thereisnoneedtoexplore.Writeandthenexecutescriptedtests.
3. Ifyouarerequiredbycontract,rule,orregulationtousescriptedtestingthendoso.
Consideraddingexploratorytestsasacomplementarytechnique.
Summary
Exploratorytestingisdefinedas"simultaneouslearning,testdesign,andtest
execution."Thetesterdesignsandexecutestestswhileexploringtheproduct.
Inexploratorytesting,thetestercontrolsthedesignoftestcasesastheyare
performedratherthandays,weeks,orevenmonthsbefore.Inaddition,theinformation
thetestergainsfromexecutingasetofteststhenguidesthetesterindesigningand
executingthenextsetoftests.
Exploratorytestingisvitalwheneverchoosingthenexttestcasetoberuncannotbe
determinedinadvancebutshouldbechosenbasedonprevioustestsandtheirresults.
References
Bach,James."ExploratoryTestingandthePlanningMyth."
http://www.stickyminds.com/r.asp?F=DART_2359,19March2001.
Bach,James."ExploratoryTestingExplained."v.1.316April2003.
http://www.satisfice.com/articles/et-article.pdf
Kaner,Cem,JackFalk,andHungQ.Nguyen(1999).TestingComputerSoftware.John
Wiley&Sons.
Kaner,Cem,JamesBach,andBretPettichord(2002).LessonsLearnedinSoftware
Testing:AContext-DrivenApproach.JohnWiley&Sons.
Weinberg,GeraldM.(1975).AnIntroductiontoGeneralSystemsThinking.JohnWiley
&Sons.
Chapter14:TestPlanning
JohnStevensonlivesinVancouverwithhiswifeCindyandtheirtwokidsShawnand
Cassie,whoarethesecondcousinsofMaryShaw,whoismarriedtoRichardShaw,
whosegrandmotherwasStewartWerthington'shousekeeper,whosekidsDamienand
CharliewenttotheMansfieldChristianSchoolforBoyswithDannyRobinson,whose
sisterBertaRobinsonranoffwithChrisTanner,whoridesamotorcycleandgreaseshis
hairandtheirkidChristausedtogooutwithmypalTomSlipper,whoisthemain
characterofthisstory,butnotthenarrator'causeIam(Tommycouldn'twritetosavehis
life).
—EmmaDolan
Introduction
MortSahl,thebrilliantsocialcommentatorofthe1960s,oftenbeganhisactbydividingthe
worldintothe"rightwing,"the"leftwing,"andthe"socialdemocrats."Theprevioustwo
chaptershavedescribedtherightandleftwings.Nowit'stimeforthesocialdemocrats.
Scriptedtestingisbasedonthesequentialexaminationofrequirements,followedbythe
designanddocumentationoftestcases,followedbytheexecutionofthosetestcases.The
scriptedtester'smottois,"Planyourwork,workyourplan."Exploratorytestingisavery
differentparadigm.Ratherthanasequentialapproach,exploratorytestingemphasizes
concurrentproductlearning,testdesign,andtestexecution.Thetesterdesignsandexecutes
testswhileexploringtheproduct.
Technique
Planninghasbeendefinedsimplyas"figuringoutwhattodonext."Mostofuswouldadmitthat
tobeeffectiveandefficient,planningisimportant.Butwhenandhowshouldthatplanningbe
done?Scriptedtestingemphasizesthevalueofearlytestplanninganddesignasamethodof
detectingrequirementsanddesigndefectsbeforethecodeiswrittenandthesystemputinto
production.Exploratorytestingchallengestheideathattestsmustbedesignedsoveryearlyin
theproject,whenourknowledgeistypicallyatitsminimum.Inhisarticle,"ExploratoryTesting
andthePlanningMyth,"publishedonStickyMinds.com,JamesBachdiscussestheplanningof
playsthatareruninafootballgame.Heexamineswhentheplayscanorshouldbeplanned.
Let'sconsiderthissporttolearnmoreaboutplanning.
Butfirst,anapologyorexplanation.Inthischaptertheterm"football"referstothegameofthe
samenameasplayedintheUnitedStatesandCanadaandexported,withonlymarginal
success,totherestoftheworld."Football"doesnotrefertothatmarvelousgameplayed
world-widethatNorthAmericanscall"soccer."
ForMore
Information
TolearnmoreaboutthegameoffootballasplayedinNorthAmerica
seeww2.nfl.com/basics/history_basics.html
Whenarefootballplaysplanned?Ourfirstthoughtmightbeinthehuddlejustbeforetheplay
begins,butthefollowinglistshowsmorepossibilities:
PlannedFootballPlay
Beforethegamebegins-thefirstnplaysarechosenandexecutedwithoutregardto
theirsuccessorfailuretoevaluatebothteams'abilities
Beforeeachplay-inthehuddle,basedonanoverallgameplan,fieldposition,teams'
strengthsandweaknesses,andplayerskillsandexperience
Atthelineofscrimmage-dependingonthedefensivelineup
Atthestartofaplay-playaction-runorpassdependingonthedefense
Duringtheplay-runforyourlifewhenallelsehasfailed
AdaptivePlanning
Adaptiveplanningisnotanindustrystandardterm.Otherpossibletermsare:
Dynamic
Flexible
Just-In-Time
Responsive
Pliable
Progressive
Purposefulplanning
Wecoulddefinetheterms"classicalplanning"and"adaptiveplanning"toindicatethese
differentapproaches.Therelationshipbetweenclassicalplanningandadaptiveplanningin
footballis:
Table14-1:Classicalplanningvs.Adaptiveplanning.
ClassicalPlanning Beforethegamebegins(thefirsttenplaysarescripted)
AdaptivePlanning
Beforeeachplay(inthehuddle)
Atthelineofscrimmage(dependingonthedefensivesetup)
Atthestartofaplay(playaction-runorpass)
Duringtheplay(scramblewhenallelsehasfailed)
Let'snowleavefootballandconsidersoftwaretestplanning.(Whilewe'dratherstayandwatch
thegame,we'vegotsoftwaretotest.)
Table14-2:Classicaltestplanningvs.Exploratorytestplanning.
ClassicalTest
Planning
Asrequirements,analysis,design,andcodingarebeingdone—longbefore
systemisbuiltandthetestingcanbegin
AdaptiveTest
Planning
Chooseastrategy(dependingonourcurrentknowledge)
Beforeeachscreen/function/flowistobetested
Atthestartofanindividualtest(choosedifferentstrategies)
Duringthetest(asweobservethingswedon'texpectorunderstand)
Areasonableplanningheuristicwouldbe:
Weplanasmuchaswecan(basedontheknowledgeavailable),
Whenwecan(basedonthetimeandresourcesavailable),
Butnotbefore.
Asidefromthesenewlabels,haven'tgoodplannersalwaysdonethis?Isthisconceptreally
new?
AremarkablelittlebooksimplytitledPlanning,publishedbytheUnitedStatesMarineCorpsin
1997,describestheconceptsofadaptiveplanningindetail.
TheMarineCorpsdefinesplanningasencompassingtwobasicfunctions—"envisioninga
desiredfutureandarrangingaconfigurationofpotentialactionsintimeandspacethatwillallow
ustorealizethatfuture."But,totheMarines,planningisnotsomethingdoneearlywhichthen
becomescastinconcrete."Weshouldthinkofplanningasalearningprocess—asmental
preparationwhichimprovesourunderstandingofasituation."Plansarenotconcreteeither.
"Sinceplanningisanongoingprocess,itisbettertothinkofaplanasaninterimproductbased
ontheinformationandunderstandingknownatthemomentandalwayssubjecttorevisionas
newinformationandunderstandingemerge."
TheauthorsofPlanninglisttheseplanningpitfallstoavoid:
Attemptingtoforecasteventstoofarintothefuture.Byplanningwemayfoolourselves
intothinkingwearecontrolling.Thereisadifference.
Tryingtoplanintoomuchdetail.HelmuthvonMoltke,GermanArmyChiefofStaff
duringWorldWarIsaid,"Noplansurvivescontactwiththeenemy."Inexactlythat
sameway,notestplansurvivescontactwiththedefectsinthesystemundertest.
Institutionalizingplanningmethodsthatleadustoinflexibleorlockstepthinkinginwhich
bothplanningandplansbecomerigid.Ratherthan"Planyourworkandworkyourplan"
asourmantra,weshouldconstantly"Planourwork,workourplan,re-evaluateour
work,re-evaluateourplan."
Thinkingofaplanasanunalterablesolutiontoaproblem.Rather,itshouldbeviewed
asanopenarchitecturethatallowsustopursuemanyalternatives."Wewillrarely,if
ever,conductanevolutionexactlythewayitwasoriginallydeveloped."
Ignoringtheneedforafeedbackmechanismtoidentifyshortcomingsintheplanand
makenecessaryadjustments.Thisisacomponentofplanningwhichoftendoesnot
receiveadequateemphasis."Manyplansstopshortofidentifyingthesignals,
conditions,andfeedbackmechanismsthatwillindicatesuccessfulordysfunctional
execution."
Adaptiveplanning,asdescribedabove,acknowledgesanddealswiththesepitfalls.
ThefollowingexcerptfromPlanningsummarizestheseconceptswell:
"Planningisacontinuousprocessinvolvingtheongoingadjustmentofmeansandends.
Weshouldalsoviewplanningasanevolutionaryprocessinvolvingcontinuous
adjustmentandimprovement.Wecanthinkofplanningassolution-by-evolutionrather
thansolution-by-engineering.Weshouldgenerallynotviewplanningastryingtosolvea
probleminoneiterationbecausemost...problemsaretoocomplextobesolvedthat
way.Inmanycases,itismoreadvisabletofindaworkablesolutionquicklyand
improvethesolutionastimepermits.Whatmattersmostisnotgeneratingthebest
possibleplanbutachievingthebestpossibleresult.Likewise,weshouldseeeachplan
asanevolvingratherthanastaticdocument.Likeplanning,plansshouldbedynamic;a
staticplanisofnovaluetoanadaptiveorganizationinafluidsituation."
Summary
JamesBachasks,"Whatifit[theplan]comesintoexistenceonlymomentsbeforethe
testing?"Whymusttheplanbecreatedsoveryearlyintheproject,whenour
knowledgeistypicallyatitsminimum?
Inadaptiveplanningweplanasmuchaswecan(basedontheknowledgeavailable),
whenwecan(basedonthetimeandresourcesavailable),butnotbefore.
Key
Point
Theuseofscriptedtestingdoesnotprecludetheuseofexploratory
testing.Theuseofexploratorytestingdoesnotprecludetheuseof
scriptedtesting.Smarttestersusewhatevertoolintheirtoolboxis
required.
Sinceplanningisanongoingprocess,itisbettertothinkofaplanasaninterimproduct
basedontheinformationandunderstandingknownatthemomentandalwayssubject
torevisionasnewinformationandunderstandingemerge.
Theuseofscriptedtestingdoesnotprecludetheuseofexploratorytesting.Theuseof
exploratorytestingdoesnotprecludetheuseofscriptedtesting.AsRexBlackwrote,
"Smarttestersusewhatevertoolintheirtoolboxisrequired.Noparadigmshere.No
worldviewshere.Noscrewdriversvs.hammers.Let'sdowhatevermakessensegiven
theproblemathand."
Practice
1. Inwhatareascouldyouuseadaptiveplanningwhereyounowuseclassicalplanning?
Withwhatbenefit?Whatwouldthechallengesbe?Whowouldsupportyouinthisnew
process?Whowouldopposeyourefforts?Why?
2. InwhatmoviesabouttheMarineCorpsweretheprocessofplanningandthevalueof
plansemphasizedoveraction?Canyouexplainwhy?
References
Bach,James."ExploratoryTestingandthePlanningMyth."19March2001.
http://www.stickyminds.com/r.asp?F=DART_2359
Copeland,Lee."ExploratoryPlanning."3September2001.
http://www.stickyminds.com/r.asp?F=DART_2805
"IEEEStandardforSoftwareTestDocumentation,"IEEEStd829-1998.TheInstituteof
ElectricalandElectronicsEngineers,Inc.ISBN0-7381-1443-X
Planning.MCDP5.UnitedStatesMarineCorps.
https://www.doctrine.usmc.mil/mcdp/view/mpdpub5.pdf
SectionIV:SupportingTechnologies
ChapterList
Chapter15:DefectTaxonomies
Chapter16:WhentoStopTesting
PartOverview
TheBookends
Twoquestions,likebookends,frameoursoftwaretesting:
Wheredowestart?
Whendowestop?
Wheredowestarttesting?Ofalltheplacestolookfordefects,whereshouldwebegin?One
answeriswithadefecttaxonomy.Ataxonomyisaclassificationofthingsintoorderedgroups
orcategoriesthatindicatenatural,hierarchicalrelationships.Taxonomieshelpidentifythekinds
ofdefectsthatoftenoccurinsystems,guideyourtestingbygeneratingideas,andaudityour
testplanstodeterminethecoverageyouareobtainingwithyourtestcases.Intime,theycan
helpyouimproveyourdevelopmentprocess.
Andstopping.Howdowelogicallydecidewhenwehavetestedenoughandthesoftwareis
readyfordeliveryandinstallation?BorisBeizerhaswritten,"Thereisnosingle,valid,rational
criterionforstopping."Ifheiscorrect,howdowemakethatdecision?
Thenexttwochaptersaddresstheseimportantissues.
Chapter15:DefectTaxonomies
'Failure'wassimplynotawordthatwouldevercrossthelipsofMissEvelynDuberry,
mainlybecauseEvelyn,ahaughtysocialitewithfire-redhairandacoltishgate,could
pronounceneithertheletters'f'nor'r'asaresultofanunfortunatekissinggesturemade
manyyearsearliertowardherbelovedchildhoodparrot,Snippy.
—DavidKenyon
Introduction
Whatisataxonomy?Ataxonomyisaclassificationofthingsintoorderedgroupsorcategories
thatindicatenatural,hierarchicalrelationships.ThewordtaxonomyisderivedfromtwoGreek
roots:"taxis"meaningarrangementand"onoma"meaningname.Taxonomiesnotonlyfacilitate
theorderlystorageofinformation,theyfacilitateitsretrievalandthediscoveryofnewideas.
Taxonomieshelpyou:
Guideyourtestingbygeneratingideasfortestdesign
Audityourtestplanstodeterminethecoverageyourtestcasesareproviding
Understandyourdefects,theirtypesandseverities
Understandtheprocessyoucurrentlyusetoproducethosedefects(Alwaysremember,
yourcurrentprocessisfinelytunedtocreatethedefectsyou'recreating)
Improveyourdevelopmentprocess
Improveyourtestingprocess
Trainnewtestersregardingimportantareasthatdeservetesting
Explaintomanagementthecomplexitiesofsoftwaretesting
Key
Point
Ataxonomyisaclassificationofthingsintoorderedgroupsorcategoriesthat
indicatenatural,hierarchicalrelationships.
InhisbookTestingObject-OrientedSystems,RobertBinderdescribesa"faultmodel"asalist
oftypicaldefectsthatoccurinsystems.Anotherphrasetodescribesuchalistisadefect
taxonomy.Binderthendescribestwoapproachestotesting.Thefirstusesa"non-specificfault
model."Inotherwords,nodefecttaxonomyisused.Usingthisapproach,therequirementsand
specificationsguidethecreationofallofourtestcases.Thesecondapproachusesa"specific
faultmodel."Inthisapproach,ataxonomyofdefectsguidesthecreationoftestcases.Inother
words,wecreatetestcasestodiscoverfaultsliketheoneswehaveexperiencedbefore.We
willconsidertwolevelsoftaxonomies—projectlevelandsoftwaredefectlevel.Ofmost
importanceintestdesignarethesoftwaredefecttaxonomies.Butitwouldbefoolishtobegin
testdesignbeforeevaluatingtherisksassociatedwithboththeproductanditsdevelopment
process.
Notethatnoneofthetaxonomiespresentedbelowarecomplete.Eachcouldbeexpanded.
Eachissubjectivebasedontheexperienceofthosewhocreatedthetaxonomies.
ProjectLevelTaxonomies
SEIRiskIdentificationTaxonomy
TheSoftwareEngineeringInstitutehaspublisheda"Taxonomy-BasedRiskIdentification"that
canbeusedtoidentify,classify,andevaluatedifferentriskfactorsfoundinthedevelopmentof
softwaresystems.
Table15-1:TheSEITaxonomy-BasedRiskIdentificationtaxonomy.
Class Element Attribute
ProductEngineering
Requirements
Stability
Completeness
Clarity
Validity
Feasibility
Precedent
Scale
Design
Functionality
Difficulty
Interfaces
Performance
Testability
CodeandUnitTest
Feasibility
Testing
Coding/Implementation
IntegrationandTest
Environment
Product
System
EngineeringSpecialties
Maintainability
Reliability
Safety
Security
HumanFactors
Specifications
DevelopmentEnvironment
DevelopmentProcess
Formality
Suitability
ProcessControl
Familiarity
ProductControl
DevelopmentSystem
Capacity
Suitability
Usability
Familiarity
Reliability
SystemSupport
Deliverability
ManagementProcess
Planning
ProjectOrganization
ManagementExperience
ProgramInterfaces
ManagementMethods
Monitoring
PersonnelManagement
QualityAssurance
ConfigurationManagement
WorkEnvironment
QualityAttitude
Cooperation
Communication
Morale
Resources
Schedule
Staff
Budget
Facilities
ProgramConstraints
Contract
TypesofContract
Restrictions
Dependencies
ProgramInterfaces
Customer
AssociateContractors
Subcontractors
PrimeContractor
CorporateManagement
Vendors
Politics
If,asatester,youhadconcernswithsomeoftheseelementsandattributes,youwouldwant
tostresscertaintypesoftesting.Forexample:
Ifyouareconcernedabout: Youmightwanttoemphasize:
Thestabilityoftherequirements Formaltraceability
Incompleterequirements Exploratorytesting
Impreciselywrittenrequirements Decisiontablesand/orstate-transitiondiagrams
Difficultyinrealizingthedesign Controlflowtesting
Systemperformance Performancetesting
Lackofunittesting Additionaltestingresources
Usabilityproblems Usabilitytesting
ISO9126QualityCharacteristicsTaxonomy
TheISO9126Standard"SoftwareProductEvaluation—QualityCharacteristicsandGuidelines"
focusesonmeasuringthequalityofsoftwaresystems.Thisinternationalstandarddefines
softwareproductqualityintermsofsixmajorcharacteristicsandtwenty-onesubcharacteristics
anddefinesaprocesstoevaluateeachofthese.Thistaxonomyofqualityattributesis:
Table15-2:TheISO9126QualityCharacteristicstaxonomy.
QualityCharacteristic Subcharacteristic
Suitability
Functionality
(Aretherequiredfunctionsavailableinthesoftware?)
Accuracy
Interoperability
Security
Reliability
(Howreliableisthesoftware?)
Maturity
Faulttolerance
Recoverability
Usability
(Isthesoftwareeasytouse?)
Understandability
Learnability
Operability
Attractiveness
Efficiency
(Howefficientisthesoftware?)
Timebehavior
Resourcebehavior
Maintainability
(Howeasyisittomodifythesoftware?)
Analyzability
Changeability
Stability
Testability
Portability
(Howeasyisittotransferthesoftwaretoanotheroperating
environment?)
Adaptability
Installability
Coexistence
Replaceability
Eachofthesecharacteristicsandsubcharacteristicssuggestareasofriskandthusareasfor
whichtestsmightbecreated.Anevaluationoftheimportanceofthesecharacteristicsshould
beundertakenfirstsothattheappropriateleveloftestingisperformed.Asimilar"ifyouare
concernedabout/youmightwanttoemphasize"processcouldbeusedbasedontheISO
9126taxonomy.
Theseprojectleveltaxonomiescanbeusedtoguideourtestingatastrategiclevel.Forhelpin
softwaretestdesignweusesoftwaredefecttaxonomies.
SoftwareDefectTaxonomies
Insoftwaretestdesignweareprimarilyconcernedwithtaxonomiesofdefects,orderedlistsof
commondefectsweexpecttoencounterinourtesting.
Beizer'sTaxonomy
OneofthefirstdefecttaxonomieswasdefinedbyBorisBeizerinSoftwareTestingTechniques.
Itdefinesafour-levelclassificationofsoftwaredefects.Thetoptwolevelsareshownhere.
Table15-3:AportionofBeizer'sBugTaxonomy.
1xxx Requirements
11xx Requirementsincorrect
12xx Requirementslogic
13xx Requirements,completeness
14xx Verifiability
15xx Presentation,documentation
16xx Requirementschanges
2xxx FeaturesAndFunctionality
21xx Feature/functioncorrectness
22xx Featurecompleteness
23xx Functionalcasecompleteness
24xx Domainbugs
25xx Usermessagesanddiagnostics
26xx Exceptionconditionsmishandled
3xxx StructuralBugs
31xx Controlflowandsequencing
32xx Processing
4xxx Data
41xx Datadefinitionandstructure
42xx Dataaccessandhandling
5xxx ImplementationAndCoding
51xx Codingandtypographical
52xx Styleandstandardsviolations
53xx Documentation
6xxx Integration
61xx Internalinterfaces
62XX Externalinterfaces,timing,throughput
7XXX SystemAndSoftwareArchitecture
71XX O/Scallanduse
72XX Softwarearchitecture
73XX Recoveryandaccountability
74XX Performance
75XX Incorrectdiagnostics,exceptions
76XX Partitions,overlays
77XX Sysgen,environment
8XXX TestDefinitionAndExecution
81XX Testdesignbugs
82XX Testexecutionbugs
83XX Testdocumentation
84XX Testcasecompleteness
Evenconsideringonlythetoptwolevels,itisquiteextensive.Allfourlevelsofthetaxonomy
constituteafine-grainedframeworkwithwhichtocategorizedefects.
Attheoutset,adefecttaxonomyactsasachecklist,remindingthetestersothatnodefect
typesareforgotten.Later,thetaxonomycanbeusedasaframeworktorecorddefectdata.
Subsequentanalysisofthisdatacanhelpanorganizationunderstandthetypesofdefectsit
creates,howmany(intermsofrawnumbersandpercentages),andhowandwhythese
defectsoccur.Then,whenfacedwithtoomanythingstotestandnotenoughtime,youwill
havedatathatenablesyoutomakerisk-based,ratherthanrandom,testdesigndecisions.In
additiontotaxonomiesthatsuggestthetypesofdefectsthatmayoccur,alwaysevaluatethe
impactonthecustomerandultimatelyonyourorganizationiftheydooccur.Defectsthathave
lowimpactmaynotbeworthtrackingdownandrepairing.
Kaner,Falk,andNguyen'sTaxonomy
ThebookTestingComputerSoftwarecontainsadetailedtaxonomyconsistingofover400
typesofdefects.Onlyafewexcerptsfromthistaxonomyarelistedhere.
Table15-4:AportionofthedefecttaxonomyfromTestingComputerSoftware.
UserInterfaceErrors
Functionality
Communication
Commandstructure
Missingcommands
Performance
Output
ErrorHandling
Errorprevention
Errordetection
Errorrecovery
Boundary-RelatedErrors
Numericboundaries
Boundariesinspace,time
Boundariesinloops
CalculationErrors
Outdatedconstants
Calculationerrors
Wrongoperationorder
Overflowandunderflow
InitialAndLaterStates
Failuretosetadataitemto0
Failuretoinitializealoopcontrolvariable
Failuretoclearastring
Failuretoreinitialize
ControlFlowErrors
Programrunsamok
Programstops
Loops
IF,THEN,ELSEormaybenot
ErrorsInHandlingOrInterpreting
Data
Datatypeerrors
Parameterlistvariablesoutoforderormissing
Outdatedcopiesofdata
Wrongvaluefromatable
Wrongmaskinbitfield
RaceConditions
Assumingoneeventalwaysfinishesbefore
another
Assumingthatinputwillnotoccurinaspecific
interval
Taskstartsbeforeitsprerequisitesaremet
LoadConditions Requiredresourcenotavailable
Doesn'treturnunusedmemory
Hardware Deviceunavailable
Unexpectedendoffile
SourceAndVersionControl Oldbugsmysteriouslyreappear
Sourcedoesn'tmatchbinary
Documentation None
TestingErrors
Failuretonoticeaproblem
Failuretoexecuteaplannedtest
Failuretousethemostpromisingtestcases
Failuretofileadefectreport
Binder'sObject-OrientedTaxonomy
RobertBindernotesthatmanydefectsintheobject-oriented(OO)paradigmareproblems
usingencapsulation,inheritance,polymorphism,messagesequencing,andstate-transitions.
Thisistobeexpectedfortworeasons.First,thesearecornerstoneconceptsinOO.They
formthebasisoftheparadigmandthuswillbeusedextensively.Second,thesebasicconcepts
areverydifferentfromtheproceduralparadigm.DesignersandprogrammersnewtoOO
wouldbeexpectedtofindthemforeignideas.AsmallportionofBinder'sOOtaxonomyisgiven
heretogiveyouasenseofitscontents:
Table15-5:AportionofBinder'sMethodScopeFaultTaxonomy.
MethodScope Fault
Requirements Requirementomission
Design
Abstraction LowCohesion
Refinement Featureoverridemissing
Featuredeletemissing
Encapsulation
Nakedaccess
Overuseoffriend
Responsibilities Incorrectalgorithm
Invariantviolation
Exceptions Exceptionnotcaught
Table15-6:AportionofBinder'sClassScopeFaultTaxonomy.
ClassScope Fault
Design
Abstraction Associationmissingorincorrect
Inheritanceloops
Refinement Wrongfeatureinherited
Incorrectmultipleinheritance
Encapsulation Publicinterfacenotviaclassmethods
Implicitclass-to-classcommunication
Modularity Objectnotused
Excessivelylargenumberofmethods
Implementation Incorrectconstructor
Notehowthistaxonomycouldbeusedtoguidebothinspectionsandtestcasedesign.Binder
alsoreferencesspecificdefecttaxonomiesforC++,Java,andSmalltalk.
Whittaker's"HowtoBreakSoftware"Taxonomy
JamesWhittaker'sbookHowtoBreakSoftwareisatester'sdelight.Proponentsofexploratory
testingexhortusto"explore."Whittakertellsusspecifically"wheretoexplore."Notonlydoes
heidentifyareasinwhichfaultstendtooccur,hedefinesspecifictestingattackstolocate
thesefaults.Onlyasmallportionofhistaxonomyispresented:
Table15-7:AportionofWhittaker'sFaultTaxonomy.
FaultType Attack
Inputsandoutputs
Forceallerrormessagestooccur
Forcetheestablishingofdefaultvalues
Overflowinputbuffers
Dataandcomputation Forcethedatastructuretostoretoofewortoomanyvalues
Forcecomputationresultstobetoolargeortoosmall
Filesysteminterface Fillthefilesystemtoitscapacity
Damagethemedia
Softwareinterfaces Causeallerrorhandlingcodetoexecute
Causeallexceptionstofire
Vijayaraghavan'seCommerceTaxonomy
Beizer's,Kaner's,andWhittaker'staxonomiescatalogdefectsthatcanoccurinanysystem.
Binder'sfocusesoncommondefectsinobject-orientedsystems.GiriVijayaraghavanhas
chosenamuchnarrowerfocus—theeCommerceshoppingcart.Usingthisfamiliarmetaphor,
aneCommerceWebsitekeepstrackofthestateofauserwhileshopping.Vijayaraghavanhas
investigatedthemanywaysshoppingcartscanfail.Hewrites,"Wedevelopedthelistof
shoppingcartfailurestostudytheuseoftheoutlineasatestideagenerator."Thisisoneofthe
primeusesofanydefecttaxonomy.Histaxonomylistsoversixtyhigh-leveldefectcategories,
someofwhicharelistedhere:
Performance
Reliability
Softwareupgrades
Userinterfaceusability
Maintainability
Conformance
Stability
Operability
Faulttolerance
Accuracy
Internationalization
Recoverability
Capacityplanning
Third-partysoftwarefailure
Memoryleaks
Browserproblems
Systemsecurity
Clientprivacy
Aftergeneratingthelistheconcludes,"Wethinkthelistisasufficientlybroadandwell-
researchedcollectionthatitcanbeusedasastartingpointfortestingotherapplications."His
assertioniscertainlycorrect.
AFinalObservation
Notethateachofthesetaxonomiesisalistofpossibledefectswithoutanyguidanceregarding
theprobabilitythatthesewilloccurinyoursystemsandwithoutanysuggestionofthelossyour
organizationwouldincurifthesedefectsdidoccur.Taxonomiesareusefulstartingpointsforour
testingbuttheyarecertainlynotacompleteanswertothequestionofwheretostarttesting.
YourTaxonomy
Nowthatwehaveexaminedanumberofdifferentdefecttaxonomies,thequestionarises—
whichisthecorrectoneforyou?Thetaxonomythatismostusefulisyourtaxonomy,theone
youcreatefromyourexperiencewithinyourorganization.Oftentheplacetostartiswithan
existingtaxonomy.Thenmodifyittomoreaccuratelyreflectyourparticularsituationintermsof
defects,theirfrequencyofoccurrence,andthelossyouwouldincurifthesedefectswerenot
detectedandrepaired.
Key
Point Thetaxonomythatismostusefulisyourtaxonomy,theoneyoucreate.
Justasinotherdisciplineslikebiology,psychology,andmedicine,thereisnoone,single,right
waytocategorize,thereisnoonerightsoftwaredefecttaxonomy.Categoriesmaybefuzzy
andoverlap.Defectsmaynotcorrespondtojustonecategory.Ourlistmaynotbecomplete,
correct,orconsistent.Thatmattersverylittle.Whatmattersisthatwearecollecting,analyzing,
andcategorizingourpastexperienceandfeedingitforwardtoimproveourabilitytodetect
defects.Taxonomiesaremerelymodelsand,asGeorgeBox,thefamousstatistician,reminds
us,"Allmodelsarewrong;somemodelsareuseful."
Tocreateyourowntaxonomy,firststartwithalistofkeyconcepts.Don'tworryifyourlist
becomeslong.Thatmaybejustfine.Makesuretheitemsinyourtaxonomyareshort,
descriptivephrases.Keepyourusers(that'syouandothertestersinyourorganization)inmind.
Usetermsthatarecommonforthem.Later,lookfornaturalhierarchicalrelationshipsbetween
itemsinthetaxonomy.Combinetheseintoamajorcategorywithsubcategoriesunderneath.
Trynottoduplicateoroverlapcategoriesandsubcategories.Continuetoaddnewcategories
astheyarediscovered.Revisethecategoriesandsubcategorieswhennewitemsdon'tseem
tofitwell.Shareyourtaxonomywithothersandsolicittheirfeedback.Youareonyourwaytoa
taxonomythatwillcontributetoyourtestingsuccess.
Summary
Taxonomieshelpyou:
Guideyourtestingbygeneratingideasfortestcasedesign
Audityourtestplanstodeterminethecoverageyourtestcasesareproviding
Understandyourdefects,theirtypesandseverities
Understandtheprocessyoucurrentlyusetoproducethosedefects(Always
remember,yourcurrentprocessisfinelytunedtocreatethedefectsyou're
creating)
Improveyourdevelopmentprocess
Improveyourtestingprocess
Trainnewtestersregardingimportantareasthatdeservetesting
Explaintomanagementthecomplexitiesofsoftwaretesting
Testingcanbedonewithouttheuseoftaxonomies(nonspecificfaultmodel)orwitha
taxonomy(specificfaultmodel)toguidethedesignoftestcases.
Taxonomiescanbecreatedatanumberoflevels:genericsoftwaresystem,
developmentparadigm,typeofapplication,anduserinterfacemetaphor.
References
Beizer,Boris(1990).SoftwareTestingTechniques(SecondEdition).VanNostrand
Reinhold.
Binder,RobertV.(2000).TestingObject-OrientedSystems:Models,Patterns,and
Tools.Addison-Wesley.
Carr,MarvinJ.,etal.(1993)"Taxonomy-BasedRiskIdentification."TechnicalReport
CMU/SEI-93-TR-6,ESC-TR-93-183,June1993.
http://www.sei.cmu.edu/pub/documents/93.reports/pdf/tr06.93.pdf
ISO(1991).ISO/IECStandard9126-1.SoftwareEngineering-ProductQuality-Part1:
QualityModel,ISOCopyrightOffice,Geneva,June2001.
Kaner,Cem,JackFalkandHungQuocNguyen(1999).TestingComputerSoftware
(SecondEdition).JohnWiley&Sons.
Whittaker,JamesA.(2003).HowtoBreakSoftware:APracticalGuidetoTesting.
AddisonWesley.
Vijayaraghavan,GiriandCemKaner."Bugsinyourshoppingcart:ATaxonomy."
http://www.testingeducation.org/articles/BISC_Final.pdf
Chapter16:WhentoStopTesting
Theballerinastoodonpoint,hertoescurledlikeshrimp,notdeep-friedshrimpbecause,
asbrittleastheyare,theywouldhavecrackedunderthepressure,buttenderebi-kind-of-
shrimp,pinkandlusciousasaTokyosunset,wonderingifherloverwasintheGinza,
wooingthegeishawitheyesreminiscentofroe,whichshelikedbetterthanebianyway.
—BrianTacang
TheBananaPrinciple
InhisclassicbookAnIntroductiontoGeneralSystemsThinking,GeraldWeinbergintroduces
ustothe"BananaPrinciple."Alittleboycomeshomefromschoolandhismotherasks,"What
didyoulearninschooltoday?"Theboyresponds,"Todaywelearnedhowtospell'banana'but
wedidn'tlearnwhentostop."Inthisbookwehavelearnedhowtodesigneffectiveandefficient
testcases,buthowdoweknowwhentostop?Howdoweknowwehavedoneenough
testing?
WhentoStop
InTheCompleteGuidetoSoftwareTesting,BillHetzelwroteregardingsystemtesting,
"Testingendswhenwehavemeasuredsystemcapabilitiesandcorrectedenoughofthe
problemstohaveconfidencethatwearereadytoruntheacceptancetest."Thephrases
"correctedenough"and"haveconfidence,"whilecertainlycorrect,arevague.
Regardingstopping,BorisBeizerhaswritten,"Thereisnosingle,valid,rationalcriterionfor
stopping.Furthermore,givenanysetofapplicablecriteria,howexactlyeachisweighted
dependsverymuchupontheproduct,theenvironment,thecultureandtheattitudetorisk."
Again,notmuchhelpinknowingwhentostoptesting.
EventhoughBeizersaysthereisnosinglecriterionforstopping,manyorganizationshave
chosenoneanyway.Thefivebasiccriteriaoftenusedtodecidewhentostoptestingare:
Youhavemetpreviouslydefinedcoveragegoals
Thedefectdiscoveryratehasdroppedbelowapreviouslydefinedthreshold
Themarginalcostoffindingthe"next"defectexceedstheexpectedlossfromthat
defect
Theprojectteamreachesconsensusthatitisappropriatetoreleasetheproduct
Thebosssays,"Shipit!"
CoverageGoals
Coverageisameasureofhowmuchhasbeentestedcomparedwithhowmuchisavailableto
test.Coveragecanbedefinedatthecodelevelwithmetricssuchasstatementcoverage,
branchcoverage,andpathcoverage.Attheintegrationlevel,coveragecanbedefinedinterms
ofAPIstestedorAPI/parametercombinationstested.Atthesystemlevel,coveragecanbe
definedintermsoffunctionstested,usecases(oruserstories)tested,orusecasescenarios
(mainpathplusalltheexceptionpaths)tested.Onceenoughtestcaseshavebeenexecutedto
meetthepreviouslydefinedcoveragegoals,weare,bydefinition,finishedtesting.For
example,wecoulddefineaproject'sstoppingcriteriaas:
100%statementcoverage
90%usecasescenariocoverage
Whenthisnumberoftestspass,wearefinishedtesting.(Ofcourse,therearemanyother
combinationsoffactorsthatcouldbeusedasstoppingcriteria.)Notalltestersapproveofthis
approach.GlenfordMyersbelievesthatthismethodishighlycounterproductive.Hebelieves
thatbecausehumanbeingsareverygoaloriented,thiscriterioncouldsubconsciously
encouragetesterstowritetestcasesthathavealowprobabilityofdetectingdefectsbutdo
meetthecoveragecriteria.Hebelievesthatmorespecificcriteriasuchasasetofteststhat
coverallboundaryvalues,state-transitionevents,decisiontablerules,etc.aresuperior.
DefectDiscoveryRate
Anotherapproachistousethedefectdiscoveryrateasthecriteriaforstopping.Eachweek(or
othershortperiodoftime)wecountthenumberofdefectsdiscovered.Typically,thenumberof
defectsfoundeachweekresemblesthecurveinFigure16-1.Oncethediscoveryrateisless
thanacertainpreviouslyselectedthreshold,wearefinishedtesting.Forexample,ifwehadset
thethresholdatthreedefects/week,wewouldstoptestingafterweek18.
Figure16-1:DefectDiscoveryRate
Whilethisapproachappealstoourintuition,weshouldconsiderwhatothersituationswould
produceacurvelikethis—creationofadditional,butlesseffectivetestcases;testerson
vacation;"killer"defectsthatstillexistinthesoftwarebutthathideverywell.Thisisonereason
whyBeizersuggestsnotdependingononlyonestoppingcriterion.
MarginalCost
Inmanufacturing,wedefine"marginalcost"asthecostassociatedwithoneadditionalunitof
production.Ifwe'remaking1,000donuts,whatistheadditionalcostofmakingonemore?Not
verymuch.Inmanufacturing,themarginalcosttypicallydecreasesasthenumberofunitsmade
increases.Insoftwaretesting,however,justtheoppositeoccurs.Findingthefirstfewdefects
isrelativelysimpleandinexpensive.Findingeachadditionaldefectbecomesmoreandmore
timeconsumingandcostlybecausethesedefectsareveryadeptathidingfromourtestcases.
Thusthecostoffindingthe"next"defectincreases.Atsomepointthecostoffindingthat
defectexceedsthelossourorganizationwouldincurifweshippedtheproductwiththatdefect.
Clearly,itis(past)timetostoptesting.
Noteverysystemshouldusethiscriterion.Systemsthatrequirehighreliabilitysuchas
weaponssystems,medicaldevices,industrialcontrols,andothersafety-criticalsystemsmay
requireadditionaltestingbecauseoftheirriskandsubsequentlossshouldafailureoccur.
TeamConsensus
Basedonvariousfactorsincludingtechnical,financial,political,andjust"gutfeelings,"the
projectteam(managers,developers,testers,marketing,sales,qualityassurance,etc.)decide
thatthebenefitsofdeliveringthesoftwarenowoutweighthepotentialliabilitiesandreach
consensusthattheproductshouldbereleased.
ShipIt!
Formanyofus,thiswillbetheonlystrategywewilleverpersonallyexperience.It'softenvery
dishearteningfortesters,especiallyaftermanyarduoushoursoftesting,andwithasure
knowledgethatmanydefectsarestillhidinginthesoftware,tobetold"Shipit!"Whattesters
mustrememberisthattheremaybeveryreasonableandlogicalreasonsforshippingthe
productbeforewe,astesters,thinkitisready.Intoday'sfast-pacedmarketeconomy,often
the"firsttomarket"winsasubstantialmarketshare.Eveniftheproductislessthanperfect,it
maystillsatisfytheneedsofmanyusersandbringsignificantprofitstoourorganization;profits
thatmightbelostifwedelayedshipment.
Someofthecriteriathatshouldbeconsideredinmakingthisdecisionarethecomplexityofthe
productitself,thecomplexityofthetechnologiesusedtoimplementitandourskillsand
experienceinusingthosetechnologies,theorganization'scultureandtheimportanceofrisk
aversioninourorganization,andtheenvironmentwithinwhichthesystemwilloperateincluding
thefinancialandlegalexposurewehaveifthesystemfails.
Asatester,youmaybefrustratedbythe"ShipIt"decision.Remember,ourroleastestersis
toinformmanagementoftherisksofshippingtheproduct.Theroleofyourorganization's
marketingandsalesgroupsshouldbetoinformmanagementofthebenefitsofshippingthe
product.Withthisinformation,bothpositiveandnegative,projectmanagerscanmake
informed,rationaldecisions.
SomeConcludingAdvice
Lesson185inLessonsLearnedinSoftwareTestingstates:
"Becausetestingisaninformationgatheringprocess,youcanstopwhenyou've
gatheredenoughinformation.Youcouldstopafteryou'vefoundeverybug,butitwould
takeinfinitetestingtoknowthatyou'vefoundeverybug,sothatwon'twork.Instead,
youshouldstopwhenyoureasonablybelievethattheprobabilityislowthattheproduct
stillhasimportantundiscoveredproblems.
"Severalfactorsareinvolvedindecidingthattestingisgoodenough(lowenough
chanceofundiscoveredsignificantbugs):
Youareawareofthekindsofproblemsthatwouldbeimportanttofind,ifthey
existed.
Youareawareofhowdifferentpartsoftheproductcouldexhibitimportant
problems.
Youhaveexaminedtheproducttoadegreeandinamannercommensurate
withtheserisks.
Yourteststrategywasreasonablydiversifiedtoguardagainsttunnelvision.
Youusedeveryresourceavailablefortesting.
Youmeteverytestingprocessstandardthatyourclientswouldexpectyouto
meet.
Youexpressedyourteststrategy,testresults,andqualityassessmentsas
clearlyasyoucould."
Summary
Regardingstopping,BorisBeizerhaswritten,"Thereisnosingle,valid,rationalcriterion
forstopping.Furthermore,givenanysetofapplicablecriteria,howexactlyeachis
weighteddependsverymuchupontheproduct,theenvironment,thecultureandthe
attitudetorisk."
Thefivebasiccriteriaoftenusedtodecidewhentostoptestingare:
Youhavemetpreviouslydefinedcoveragegoals
Thedefectdiscoveryratehasdroppedbelowapreviouslydefinedthreshold
Themarginalcostoffindingthe"next"defectexceedstheexpectedlossfrom
thatdefect
Theprojectteamreachesconsensusthatitisappropriatetoreleasethe
product
Thebosssays,"Shipit!"
References
Hetzel,Bill(1998).TheCompleteGuidetoSoftwareTesting(SecondEdition).John
Wiley&Sons.
Kaner,Cem,JamesBach,andBretPettichord(2002).LessonsLearnedinSoftware
Testing:AContext-DrivenApproach.JohnWiley&Sons.
Myers,Glenford(1979).TheArtofSoftwareTesting.JohnWiley&Sons.
Weinberg,GeraldM.(1975).AnIntroductiontoGeneralSystemsThinking.JohnWiley
&Sons.
SectionV:SomeFinalThoughts
AppendixList
AppendixA:Brown&DonaldsonCaseStudy
AppendixB:StatelessUniversityRegistrationSystemCaseStudy
PartOverview
YourTestingToolbox
MyoldestsonShawnisaglazier—heinstallsglass,mirrors,showerdoors,etc.Heisanartist
inglass.Asafather,Idecideditwouldbegoodtoknowwhatmysondoesforaliving,soI
rodewithhiminhistruckforafewhourswatchinghimwork.
Atthefirstjobsitehepulledoutaclipboardwithaworkorderthattoldhimwhatwasneeded.
Hehoppedoutandwalkedaroundtothebackofthetruck.There,hegrabbedhistoolbucket
(anoldfive-gallonpaintbucket)androotedaroundthroughit.Hepulledoutsometools,walked
uptothehouse,didhismagic,camebacktothetruck,putthetoolsinthebucket,andaway
wewent.Atthesecondjobsiteherepeatedtheprocess.Onceagain,hepulledoutthe
clipboard,hoppedout,walkedaroundtothebackofthetruck,grabbedhistoolbucket,and
rootedaroundthroughit.Hepulledoutsometools,butdifferenttoolsthistime,walkedupto
thehouse,didhismagic,camebacktothetruck,putthetoolsinthebucket,andawaywe
went.Aswewentfromjobtojobitoccurredtomethatallgoodcraftspeople,including
softwaretesters,needabucketoftools.Inaddition,goodcraftspeopleknowwhichtooltouse
inwhichsituation.Myintentinwritingthisbookwastohelpputmoretoolsinyourpersonal
testingtoolbucketandtohelpyouknowwhichtooltouseinwhichsituation.Remember,not
everytoolneedstobeusedeverytime.
Now,it'suptoyou.Thenextlevelofskillcomeswithpractice.FamouseducatorBenjamin
Bloomcreatedataxonomyforcategorizinglevelsofcompetencyinschoolsettings.Thefirst
threelevelsare:
Knowledge
Comprehension
Application
Thisbookhasfocusedonknowledgeandcomprehension.The"application"isuptoyou.
Bestwishesinyourtesting...
References
Bloom,BenjaminS.(1969).TaxonomyofEducationalObjectives:TheClassificationof
EducationalGoals.LongmanGroup.
AppendixA:Brown&DonaldsonCaseStudy
Introduction
Brown&Donaldson(B&D)isafictitiousonlinebrokeragefirmthatyoucanusetopracticethe
testdesigntechniquespresentedinthisbook.B&DwasoriginallycreatedforSoftwareQuality
Engineering'sWeb/eBusinessTestingcourse(seehttp://www.sqe.com).TheactualB&DWeb
siteisfoundathttp://bdonline.sqe.com.AnyresemblancetoanyactualonlinebrokerageWeb
siteispurelycoincidental.
Login
TheLoginpageisthegatewayintotheB&Dsite.Itrequiresalegitimateusernameand
password.
MarketNews
TheMarketNewspageisthemainpageoftheB&Dsite.Itcontainsnavigationbuttonsonthe
leftsideofthepage,stockperformancechartsatthetop,andnewsstoriesofinterestto
B&D'sinvestors.
Trade
TheTradepageallowsaB&Dclienttobuyandsellstocks.Itcontainsabuy/sellbutton,atext
boxforthestocktickersymbol,atextboxforthenumberofsharestobeboughtorsold
(quantity),andboxesindicatingthetypeoftrade.
SymbolLookup
TheSymbolLookuppageisreachedfromtheTradepage.ItisusedwhentheB&Dclientis
unsureofthestocktickersymbolandmustlookitup.Itcontainsonefieldwherethefirstfew
charactersoftheorganization'snameareentered.
LookupResults
TheLookupResultspageistheresultofthepreviousSymbolLookuppage.Itdisplaysthe
stocksymbolsthatmatchedtheprevioussearch.
Holdings
PerhapsthemostimportantpageontheB&Dsite,theHoldingspagedisplaysthestocks
currentlyownedbythisclient.
Glossary
TheGlossarypagecanbeusedtolookuptermsthatunfamiliartotheB&Dclient.
AppendixB:StatelessUniversityRegistrationSystemCase
Study
SystemDocumentation
StatelessUniversityRegistrationSystem(SURS)UserInterfaceSpecification
May1,2002
Version2.3
PreparedBy:
OtisKribblekoblis
SuperDuperSoftwareCompany(SDSC)
422South5thAvenue
Anytown,USA
Introduction
ThepurposeofthisdocumentistodescribetheplanneduserinterfacefortheStateless
UniversityRegistrationSystem.Itwillberevisedtoreflectthat"as-built"softwareaftersystem
testinghasbegun.ItisacustomizedversionoftheregistrationsystemdeliveredtoUniversal
OnlineUniversity(UOU)lastyear.StatelessUhasrequestedsomemajormodificationstothe
UOUversion,sothatitisessentiallyarewriteofthesoftware.Someofthemodulesfor
databasecreationandbackuphavebeenreused,butthatisnotapparentfromtheuser
interface,whichisallnew.
Thismanualhastheuserinterfacescreensdefinedintheorderinwhichtheyarecustomarily
used.Itstartswiththeloginscreen.Thenitprovidesthedatabaseset-upfields:theaddition/
change/deletionofstudents,theaddition/change/deletionofcourses,andtheaddition/
change/deletionofclasssections.Thefinaldataentryscreenprovidestheselectionof
specificcoursesectionsforeachstudent.Thereisalsoanadministrativefunctionthatis
accessibletoonlythesupervisor.Itprovidesaccesstotheadministrativefunctionsofbackup
andrestoreofthedatabases.Eachscreenisdefinedinaseparatesectionprovidingthe
followinginformation:
Functionalitysupported
Formattingrequirementsforeachdataentryfield
Asamplescreenlayout(thefinalimplementedsoftwaremaydiffer)
Thefigurebelowsummarizesthescreensandtheirnavigationoptions.
2.1Log-inandSelectFunctionScreen
2.1.1Functions
EachuserisrequiredtoenteraUserIDandaPassword.Theidentificationofthestatusof
theuser(supervisor:yesorno)ismandatoryatthetimeoflog-in.OnlyYesorNomaybe
selectedbyclickingontheappropriatebox(notboth).Afterasuccessfullog-inhasbeen
completed,thenthenextfunctiontobeexecutedcanbeselected.Onlyasupervisormay
accesstheAdministrativescreen.TheExitbuttonisactiveatalltimes.
2.1.2DataEntryFormats
Theformatsforthefieldsonthisscreenare:UserID:eightcharactersatleasttwoofwhich
arenotalphabetic(canbenumericorspecialcharacters).
Password:eightcharactersatleasttwoofwhicharenotalphabetic(canbenumericorspecial
characters).
2.1.3ScreenFormat
3.1StudentDatabaseMaintenanceScreen
3.1.1Functions
Thisscreenallowstheentryoftheidentifyinginformationforanewstudentandtheassignment
ofhis/herstudentIDnumber.AllfieldsarerequiredtobefilledinbeforetheEnterbuttonis
selected.Thefieldsmaybeenteredinanyorder.Thebackspacekeywillworkatanytimein
anyfield,buttheResetbuttonwillclearallofthefieldswhenitispressed.
IftheStudentIDisenteredfirst,thentheDelete(allowsastudenttoberemovedfromthe
database)andModify(allowsthemodificationofthestudent'scontactinformation—thedata
currentlyinthedatabasewillbedisplayed)buttonsbecomeactive.TheEnterbuttonwillcause
theDeleteortheModifytobeexecutedandthefieldsonthescreentobecleared.
3.1.2DataEntryFormats
Theformatsforthefields(allmandatory)onthisscreenare:Firstname:onetotencharacters
Middlename:onetotencharactersorNMNfornomiddlenameLastname:onetofifteen
characters(alpha,period,hyphen,apostrophe,space,numbers)Streetaddress:fourto
twentyalphanumericcharactersCity:threetotenalphacharactersState:twoalpha
charactersZip:thestandardfivenumericshyphenfournumericsPhone:telephonenumberin
thefollowingformat703.555.1212
StudentID:twocharactersrepresentingthehomecampusandasix-digitnumberwhichis
uniqueforeachstudent.Thehomecampusdesignationsare:
ANforAnnandale
LOforLoudoun
MAforManassas
WOforWoodbridge
ARforArlington
Thesix-digitnumberisgeneratedbythesystemwhentheEnterbuttonisselected.Itremains
displayeduntiltheResetbuttonisdepressed.Atthattime,allfieldsareclearedforthenextset
ofentries.
3.1.3ScreenLayout
3.2CourseDatabaseMaintenanceScreen
3.2.1Functions
Thisscreenallowstheentryoftheidentifyinginformationforanewcourseandtheassignment
ofthecourseIDnumber.AllfieldsarerequiredtobefilledinbeforetheEnterbuttonis
pressed.Thefieldsmaybeenteredinanyorder.Thebackspacekeywillworkatanytimein
anyfield,buttheResetbuttonwillclearallofthefieldswhenitisentered.TheBackbutton
causesareturntothepreviousscreen.TheExitbuttoncausesanexitfromthisapplication.
IftheCourseIDisenteredfirst,thentheDelete(allowsacoursetoberemovedfromthe
database)andModify(allowsthemodificationofanexistingcourse'sinformation—thedata
currentlyinthedatabasewillbedisplayed)buttonsbecomeactive.TheEnterbuttonwillcause
theDeleteortheModifytobeexecutedandthefieldsonthescreentobecleared.
3.2.2DataEntryFormats
Theformatsforthefields(allaremandatory)onthisscreenare:CourseID:threealpha
charactersrepresentingthedepartmentfollowedbyasix-digitintegerwhichistheunique
courseidentificationnumber.Thepossibledepartmentsare:
PHY-Physics
EGR-Engineering
ENG-English
LAN-Foreignlanguages
CHM-Chemistry
MAT-Mathematics
PED-Physicaleducation
SOC-Sociology
LIB-Libraryscience
HEC-Homeeconomics
Coursename:afreeformatalphanumericfieldofuptofortycharactersCoursedescription:
afreeformatalphanumericfieldofupto250characters
3.2.3ScreenLayout
3.3ClassSectionDatabaseMaintenanceScreen
3.3.1Functions
Thisscreenallowstheentryoftheidentifyinginformationforanewcoursesection.Allfields
arerequiredtobefilledinbeforetheEnterbuttonispressed.Thefieldsmaybeenteredinany
order.Thebackspacekeywillworkatanytimeinanyfield,buttheResetbuttonwillclearallof
thefieldswhenitisentered.TheBackbuttoncausesareturntothepreviousscreen.TheExit
buttoncausesanexitfromthisapplication.
TheCourseIDisrequiredtobeenteredfirst(allexistingsectionswillbedisplayedassoonas
itisentered),followedbythenewSection#,DatesandTimefields.TheDelete(allowsa
sectiontoberemovedfromthedatabase)andModify(allowsthemodificationofanexisting
section'sinformation)buttonsbecomeactiveaftertheSection#isentered.Ifthesectionis
alreadyinthedatabase,thecurrentinformationwillbedisplayedassoonastheSection#field
isfilledin.TheEnterbuttonwillcausetheDeleteortheModifytobeexecutedandthefields
onthescreentobecleared.
3.3.2DataEntryFormats
Theformatsforthefields(allmandatory)onthisscreenare:CourseID:threealpha
charactersrepresentingthedepartmentfollowedbyasix-digitintegerSection#:athree-digit
integer(leadingzerosarerequired)assignedbytheuserDates:thedaysoftheweekthe
classmeets(uptothreewithhyphensinbetween);theweekdaydesignationsare:
Sun
Mon
Tue
Wed
Thr
Fri
Sat
Time:thestartingandendingtimesofthesection(usingmilitarytime)withahyphenin
between,e.g.,12:00–13:30.
3.3.3ScreenLayout
3.4SectionSelectionEntryScreen
3.4.1Functions
Thisscreenallowstheentryoftheselectionofspecificcoursesectionsforanindividual
student.AllfieldsarerequiredtobefilledinbeforetheEnterbuttonispressed.Thefieldsmay
beenteredinanyorder.Thebackspacekeywillworkatanytimeinanyfield,buttheReset
buttonwillclearallofthefieldswhenitisentered.TheBackbuttoncausesareturntothe
previousscreen.TheExitbuttoncausesanexitfromthisapplication.
TheStudentIDisrequiredtobeenteredfirst,followedbytheCourseID(allavailablesections
willbedisplayedassoonasitisentered).Sectionsareselectedbyclickingonthesectionto
beassigned.TheEnterbuttonwillcausethestudenttobeaddedtotheselectedsection.
EnteringanewCourseIDwillcauseanewlistofavailablesectionstobedisplayed,allowing
anothercoursesectiontobeselectedforthesamestudent.
3.4.2DataEntryFormats
Theformatsforthefields(allmandatory)onthisscreenare:
CourseID:threealphacharactersrepresentingthedepartmentfollowedbyasix-digitinteger
StudentID:twocharactersrepresentingthehomecampusandasix-digitnumberthatis
uniqueforeachstudent
Availablesections:alistofallofthesectionsthatarenotfull
3.4.3ScreenLayout
3.5AdministrativeScreen
3.5.1Functions
Onlythesupervisormayaccesstheadministrativescreen.Itpermitsoneofthefollowingthree
activitiesatatime:
Creationofabackupofanyorallofthedatabases
Restoreofabackupofanyorallofthedatabases
Printingofareportofanyorallofthedatabases
Aftertheactivity(createorrestore)andthedatabaseshavebeenselected,thenameofthe
backupistobeentered.
TheBackandExitbuttonsareactiveatalltimes.
3.5.2DataEntryFormats
Theformatsforthefieldsonthisscreenare:
BackupID:aannnn(requiredonlyforbackups,notreports)Commentary:afreeformat
characterfield200charactersinlength(requiredonlyforbackups,notreports)
3.5.3ScreenLayout
Bibliography
WorksCited
Bach,James."ExploratoryTestingandthePlanningMyth."19March2001.
http://www.stickyminds.com/r.asp?F=DART_2359
Bach,James."ExploratoryTestingExplained."v.1.3,16April2003.
http://www.satisfice.com/articles/et-article.pdf
Beizer,Boris(1990).SoftwareTestingTechniques(SecondEdition).VanNostrandReinhold.
ISBN0-442-20672-0.
Beizer,Boris(1995).Black-BoxTesting:TechniquesforFunctionalTestingofSoftwareand
Systems.JohnWiley&Sons.ISBN0-471-12094-4.
Binder,RobertV.(2000).TestingObject-OrientedSystems:Models,Patterns,andTools.
Addison-Wesley.ISBN0-201-80938-9.
Brownlie,Robert,etal."RobustTestingofAT&TPMX/StarMAILUsingOATS,"AT&T
TechnicalJournal,Vol.71,No.3,May/June1992.
Carr,MarvinJ.,etal.(1993)Taxonomy-BasedRiskIdentification.TechnicalReport
CMU/SEI-93-TR-6,ESC-TR-93-183,June1993.
http://www.sei.cmu.edu/pub/documents/93.reports/pdf/tr06.93.pdf
Cockburn,Alistair(2000).WritingEffectiveUseCases.Addison-Wesley.ISBN0-201-
70225-8.
Cohen,D.M.,etal."TheAETGSystem:AnApproachtoTestingBasedonCombinatorial
Design."IEEETransactionsonSoftwareEngineering,Vol.23,No.7,July1997.
Copeland,Lee."ExploratoryPlanning."3September2001.
http://www.stickyminds.com/r.asp?F=DART_2805
Craig,RickD.andStefanP.Jaskiel(2002).SystematicSoftwareTesting.ArtechHouse
Publishers.ISBN1-58053-508-9.
Fowler,MartinandKendallScott(1999).UMLDistilled:ABriefGuidetotheStandard
ObjectModelingLanguage(2ndEdition).Addison-Wesley.ISBN0-201-65783X.
Gilb,TomandDorothyGraham(1993).SoftwareInspection.Addison-Wesley.ISBN0-201-
63181-4.
Harel,David."Statecharts:avisualformalismforcomplexsystems."ScienceofComputer
Programming8,1987.
Hetzel,Bill(1998).TheCompleteGuidetoSoftwareTesting(SecondEdition).JohnWiley&
Sons.ISBN0-471-56567-9.
IEEEStandardforSoftwareTestDocumentation:IEEEStandard829-1998.ISBN0-7381-
1443-X.
IEEEStandardGlossaryofSoftwareEngineeringTerminology:IEEEStandard610.12-
1990.ISBN1-55937-067-X.
ISO(1991).ISO/IECStandard9126-1.SoftwareEngineering-ProductQuality-Part1:
QualityModel.ISOCopyrightOffice,Geneva,June2001.
Jacobsen,Ivar,etal(1992).Object-OrientedSystemsEngineering:AUseCaseDriven
Approach.Addison-Wesley.ISBN0-201-54435-0.
Kaner,Cem,JackFalkandHungQuocNguyen(1999).TestingComputerSoftware(Second
Edition).JohnWiley&Sons.ISBN0-471-35846-0.
Kaner,Cem,JamesBach,andBretPettichord(2002).LessonsLearnedinSoftwareTesting:
AContext-DrivenApproach.JohnWiley&Sons.ISBN0-471-08112-4.
Kuhn,D.RichardandMichaelJ.Reilly."AnInvestigationoftheApplicabilityofDesignof
ExperimentstoSoftwareTesting,"27thNASA/IEEESoftwareEngineeringWorkshop,NASA
GoddardSpaceFlightCenter,4–6December2002.http://csrc.nist.gov/staff/kuhn/kuhn-
reilly-02.pdf
Marick,Brian(1995).TheCraftofSoftwareTesting:SubsystemTestingIncludingObject-
BasedandObject-OrientedTesting.Prentice-Hall.ISBN0-131-77411-5.
Mandl,Robert."OrthogonalLatinSquares:AnApplicationofExperimentDesigntoCompiler
Testing,"CommunicationsoftheACM,Vol.128,No.10,October1985.
Mealy,G.H."Amethodforsynthesizingsequentialcircuits."BellSystemTechnicalJournal,
34(5):1955.
Myers,Glenford(1979).TheArtofSoftwareTesting.JohnWiley&Sons.ISBN0-471-
04328-1.
Moore,E.F."Gedanken-experimentsonsequentialmachines,"AutomataStudies(C.E.
ShannonandJ.McCarthy,eds.),Princeton,NewJersey:PrincetonUniversityPress,1956.
Phadke,MadhavS.(1989).QualityEngineeringUsingRobustDesign.Prentice-Hall.ISBN
0-13-745167-9.
Planning,MCDP5.UnitedStatesMarineCorps.
https://www.doctrine.usmc.mil/mcdp/view/mpdpub5.pdf
Pressman,RogerS.(1982).SoftwareEngineering:APractitioner'sApproach(Fourth
Edition).McGraw-Hill.ISBN0-07-052182-4.
Rapps,SandraandElaineJ.Weyuker."DataFlowAnalysisTechniquesForTestData
Selection."SixthInternationalConferenceonSoftwareEngineering,Tokyo,Japan,
September13–16,1982.
Rumbaugh,James,etal.(1991).Object-OrientedModelingandDesign.Prentice-Hall.ISBN
0-13-629841-9.
Watson,ArthurH.andThomasJ.McCabe.StructuredTesting:ATestingMethodology
UsingtheCyclomaticComplexityMetric.NISTSpecialPublication500-235.
http://www.mccabe.com/nist/nist_pub.php
Wallace,DeloresR.andD.RichardKuhn."FailureModesinMedicalDeviceSoftware:An
Analysisof15YearsofRecallData,"InternationalJournalofReliability,Quality,andSafety
Engineering,Vol.8,No.4,2001.http://csrc.nist.gov/staff/kuhn/final-rqse.pdf
Weinberg,GeraldM.(1975).AnIntroductiontoGeneralSystemsThinking.JohnWiley&
Sons.ISBN0-471-92563-2.
Whittaker,JamesA.(2003).HowtoBreakSoftware:APracticalGuidetoTesting.Addison
Wesley.ISBN0-201-79619-8.
OtherUsefulPublications
Beizer,Boris(1984).SoftwareSystemTestingandQualityAssurance.VanNostrand
Reinhold.ISBN0-442-21306-9.
Black,Rex(1999).ManagingtheTestingProcess.MicrosoftPress.ISBN0-7356-0584-X.
BritishComputerSociety.StandardonSoftwareComponentTesting.BS7925-2.
http://www.testingstandards.co.ukhttp://www.testingstandards.com/BS7925_3_4.zip
Kit,Edward(1995).SoftwareTestingintheRealWorld:ImprovingtheProcess.Addison-
Wesley.ISBN0-201-87756-2.
McGregor,JohnD.andDavidA.Sykes(2001).APracticalGuidetoTestingObject-
OrientedSoftware.Addison-Wesley.ISBN0-201-32564-0.
Meyer,Bertrand(2000).Object-OrientedSoftwareConstruction(2ndEdition).Prentice-Hall.
ISBN0-136-29155-4.
Roper,Marc(1994).SoftwareTesting.McGraw-Hill.ISBN0-07-707466-1.
Tamres,Louise(2002).IntroducingSoftwareTesting.Addison-Wesley.ISBN0-201-71974–
6.
Index
A
acceptancetesting,10,135
ACTtestscores,121
action,51–52,95,97
actor,128
adhoctesting,202
adaptiveplanning,213–214,216
alleventscoverage,106
allpairstesting,64
allpairstools
AETG,88
Allpairs,85
rdExpert,68
allpathscoverage,107
allstatescoverage,105
alltransitionscoverage,108
Allison,Chuck,xvi
Allpairsalgorithm,66,85–88
comparisonwithorthogonalarrays,88–89
unbalanced,87–88
AnIntroductiontoGeneralSystemsThinking,236
automaticvariables,169
Index
B
Bach,James,xvi,85,202,206,212
bananaprinciple,236
Barker,Joel,182
baselinepath,155
basispathsets,164
basispathtesting,154–159
baselinepath,155
basispathsets,164
example,160–164
multiplesets,159
pathcreation,155
basispaths,154–155
Beizer,Boris,2,6,135,198,220,226,236
Beizer'staxonomy,226
binarydecisions,155
Binder,Robert,11,222,229
Binder'sobject-orientedtaxonomy,229
blackboxtesting,8,20–22,140
blackdotsymbol,95,97
Black,Rex,xvi
Bloom,Benjamin,246
bookends,220
boundaries,40,134
boundaryvaluetesting,40,197
boundaries,40,134
examples,45
boundaryvalues,134
Box,George,232
Brown&Donaldson,16,54,71,91,94,160,250
authorizationcode,17
bulls-eyesymbol,97
Bulwer-LyttonFictionContest,xvi
Bulwer-Lytton,EdwardGeorge,xvi
businessrules,50,58
Index
C
casestudies
Brown&Donaldson,16,54,71,91,94,160,250
StatelessUniversityRegistrationSystem,17,36,47,56,71,91,94,111,131,136,260
charteredexploratorytesting,206
choosingoffpoints,118
choosingonpoints,118
choosingtestcases,119
classicalplanning,213
closedboundary,118
Cockburn,Alistair,130
codequalitytesting,11
collapsedrules,55
combinationtesting,Seepairwisetesting
combinations,63
combinedrules,55
competency,246
complexbusinessrules,50,53–54,58
conditioncoverage,151
conditional,102
conditions,50,51–53,55,58
connectionlost,134
contract,27
controlflow,141
controlflowgraphs,145–147,154–159,171–176
controlflowpaths,172
controlflowtesting
conditioncoverage,151
controlflowgraphs,145–147,154–159,171–176
decisionpoint,146
decision/conditioncoverage,151
executionpaths,144
exhaustivetesting,144
junctionpoint,146
levelsoftestcoverage,147–153
limitingloopexecution,153
missingpaths,144
multipleconditioncoverage,152
pathcoverage,153
processblock,146
statementcoverage,147,150
testcoverage,147–153
coverage,147,153
Craig,Rick,xiii,xvi,2
createdvariables,169
creatingtestcases,109–110,134
cyclomaticcomplexity,154–155
binarydecisions,155
edges,154–155
nodes,154–155
Index
D
dataflowgraphs,171–174
dataflowtesting,168
~define,170
~kill,170
~use,170
createdvariables,169
dataflowgraph,171–174
define-define,170
define-kill,170
define-use,170
define-use-kill,172–174
destroyedvariables,169
dynamicdataflowtesting,176
kill-define,170
killedvariables,169
kill-kill,170
kill-use,170
lifecycle,169
processingflow,171
static,171–176
usedvariables,169
use-define,170
use-kill,170
use-use,170
variablesincomputation,169
variablesinconditionals,169
datasensitivityerrors,141
debugging,3
decisioncoverage,150
decisionpoint,146
decisiontables
actions,51–52
collapsedrules,55
combinedrules,55
conditions,50–53,55,58
derivingtestcases,52–53
examples,54–58
expectedresults,54
"firing",51
decisiontabletesting,50–54
decision/conditioncoverage,151
defecttaxonomies,222–232
defensive-design,28
defensive-testing,28
define-define,170
define-kill,170
define-use,170
define-use-kill,172–174
design-by-contract,27
destroyedvariables,169
developmentmanagers,xv
developmentparadigm,129
diskfull,134
documentingtransactions
flowcharts,128
HIPOdiagrams,128
text,128
usecases,128
domainanalysis,116
domainanalysistesting
choosingoffpoints,118
choosingonpoints,118
choosingtestcases,119
closedboundary,118
DomainTestMatrix,120
example,121
extraboundary,116–117
inpoint,118,120
interactionsbetweenvariables,116
missingboundary,116–117
offpoint,118,120
onpoint,118,120
openboundary,118
outpoint,118
shiftedboundary,116–117
tiltedboundary,116–117
DomainTestMatrix,120,134
double-modedefects,65
drivernotloaded,134
dynamicdataflowtesting,176
Index
E
edges,154–155
equivalenceclasspartitioning,197
equivalenceclasstesting,24–33
examples,33–34
inputequivalenceclasses,29
outputequivalentclasses,33
equivalenceclasstypes
continuousrangeofvalues,29
discretevalueswithinarange,29–30
multipleselection,30–31
singleselection,30
equivalenceclasses,25,28
events,94–96
executionpaths,141,144
exhaustivetesting,21,144
existingpaths,141
exploratoryplanningrigorousplan,202
exploratorytesting,182,202–208,212
chartered,206
charters,206
consciousplan,202
freestyle,207
process,205
extraboundary,116–117
Index
F
FAFSA,59
Faught,Danny,xvi
faultmodel,222
non-specific,222
specific,222
Ferguson,Marilyn,182
figures
decisioncoverage,150
annotatedcontrolflowdiagram,171–173
B&Dcontrolflowgraph,162–163
B&DJavacode,160
baselinebasispath,156
boundaryvalues,43
canceltheReservation,101
cancellationfromPaidstate,102
cancellationfromTicketedstate,103
continuousequivalenceclasses,29
dataontheboundaries,44
defectdiscoveryrate,238
discreteequivalenceclasses,29
enrollanddropacourse,113
evaluationofcomplexconditions,152
examplecontrolflowgraph,154
fifthbasispath,158
flowgraphequivalent,147
fourexecutionpaths,148
fourthbasispath,157
graphicalrepresentation,148
IEEE829testdocumentation,188
interestingflowdiagram,153
multipleselectionequivalenceclasses,30
on,off,in,andoutpoints,119
pathterminates,99
PayTimerexpires,100
ReservationinMadestate,95
ReservationinPaidstate,95
ReservationinTicketedstate,97
ReservationinUsedstate,98
secondbasispath,156
seventhbasispath,159
singleselectionequivalenceclasses,30
sixthbasispath,158
StatelessUniversityAdmissionsMatrix,121
StatelessUniversityusecases,129
SURSmaintenancescreen,56
testcasesthattriggerallevents,106
testcasesthatvisiteachstate,106
thirdbasispath,157
twodimensionalboundarydefects,117
Waterfallmodel,187
fire,51
firing,51
FloridaInstituteofTechnology,135
flowcharts,128
football,212–213
FreeApplicationforFederalStudentAid,59
freestyleexploratorytesting,207
functionalitytesting,11
Index
G
Gerrard,Paul,xvi
GraceL.FergusonAirline&StormDoorCompany,94
GradePointAverage,121
Graham,Dorothy,xvi
grayboxtesting,8
guard,102
Index
H
Hagar,Jon,xvi
Hetzel,Bill,236
highschoolgrades,121
HIPOdiagrams,128
Holodeck,135,149
HowToBreakSoftware,230
HowtoGetControlofYourTimeandYourLife,205
Index
I
IEEE829advantages
completenesschecklist,190
evaluationoftestpractices,190
facilitatecommunication,190
increasedmanageability,190
IEEE829standard,189–190
bugreport,195
releasenotes,194
testcasespecification,188,193
testdesignspecification,188,192
testincidentreport,188,195
testitemtransmittalreport,188,194
testlog,188,194
testplan,188,190
testprocedurespecification,188,193
testsummaryreport,188,196
IEEE829testcasespecification
environmentalneeds,193
inputspecifications,193
intercasedependencies,193
outputspecifications,193
specialproceduralrequirements,193
testcasespecificationidentifier,193
testitems,193
IEEE829testdesignspecification
approachrefinements,192
featurepass/failcriteria,193
featurestobetested,192
testdesignspecificationidentifier,192
testidentification,192
IEEE829testincidentreport
impact,195
incidentdescription,195
summary,195
testincidentreportidentifier,195
IEEE829testitemtransmittalreport
approvals,194
location,194
status,194
transmittalreportidentifier,194
transmitteditems,194
IEEE829testlog
activityandevententries,195
description,195
testlogidentifier,195
IEEE829testplan
approach,191
approvals,192
environmentalneeds,192
featuresnottobetested,191
featurestobetested,191
introduction,191
itempass/failcriteria,191
responsibilities,192
risksandcontingencies,192
schedule,192
staffingandtrainingneeds,192
suspensionandresumptioncriteria,191
testdeliverables,191
testitems,191
testplanidentifier,191
testingtasks,191
IEEE829testprocedurespecification
proceduresteps,194
purpose,194
specialrequirements,194
testprocedurespecificationidentifier,194
IEEE829testsummaryreport
approvals,196
comprehensiveassessment,196
evaluation,196
summary,196
summaryofactivities,196
summaryofresults,196
testsummaryreportidentifier,196
variance,196
IEEEStandard610.12–1990,2
IEEEStandardforSoftwareTestDocumentation,188–196
IEEEStandardGlossaryofSoftwareEngineeringTerminology,2
IEEEStd829–1998,188–196
inpoint,118,120
inspection,4,41,134,164,171,176,230
integration,140
integrationtesting,9
interactionsbetweenvariables,116
ISO9126StandardSoftwareProductEvaluation—QualityCharacteristicsandGuidelines,225
Index
J
Jacobsen,Ivar,128
Jagger,Mick,83
Jaskiel,Stefan,xiii,2
junctionpoint,146
Index
K
Kaner,Cem,202
Kaner,Falk,andNguyen'staxonomy,228
keypoints
adaptiveplanning,213
advantageofstate-transitiontable,105
bankcombinations,62
blackboxtestinghelpsefficiencyandeffectiveness,21
boundariesarewheredefectshide,40
choosingcombinations,65
comparingwhatiswithwhatoughttobe,2
controlflowgraphs,145
createtestcases,53
cultivatetheskillofchoosingpoorly,63
dataczar,135
dataflowtesting,168
domainanalysis,116
doubleintegralsign,xiv
equivalenceclasses,26
evaluatetherisk,134
executingCtestcases,155
exploratorycharter,206
exploratorytesting,202
expressyourappreciation,33
Holodeck,149
importanceoftestdesign,xiii
locateorthogonalarrays,67
Methuselah,27
mostimportanttest,205
objectorientedcombinations,62
pathdefinition,144
postinstallationtestplanning,63
randomselection,64
rarelywillwehavetime,31
rdExperttool,68
scriptedandexploratorytesting,217
scriptedandexploratoryparadigms,182
taxonomy,222
testcasesareinputs,outputs,andorder,6
testcasesateachboundary,42
testcasesmustbedesigned,5
testingeverytransition,108
testinglevels-unit,integration,system,acceptance,9
time-sequencedpairs,170
triggeralltransitions,108
TwentyQuestions,203
useGUIdesigntools,34
warm,fuzzyfeelings,29
wecanneverbesureofcoverage,21
webcombinations,62
whogetstheblame,28
yourtaxonomy,232
kiddiepool,198
kill-define,170
killedvariables,169
kill-kill,170
kill-use,170
Index
L
L18(2137)orthogonalarray,69
L18(35)orthogonalarray,68
L4(23)orthogonalarray,66
L64(8243)orthogonalarray,73
L9(34)orthogonalarray,67
Lakein,Alan,205
largenumberofcombinations,63
LessonsLearnedinSoftwareTesting,85,241
levelsofcompetency,246
lifecycle,169
limitingloopexecution,153
lowmemory,134
Index
M
McCabe,Tom,154
Mealy,G.H.,97
Meilof,Anne,xvi
Myers,Glenford,3,21,237
Middleton,Wayne,xvi
missingboundary,116–117
missingpaths,144
Moore,E.F.,97
multipleconditioncoverage,152
multiplebasispathsets,159
Index
N
nestedstate-transitiondiagrams,97
nodes,154–155
nonexistentpaths,141
non-specificfaultmodel,222
Index
O
O'Loughlin,Martin,xvii
Object-OrientedSoftwareEngineering:AUseCaseDrivenApproach,128
offpoints,118,120
onpoints,118,120
openboundary,118
oracles
existingprograms,7
kiddie,6
purchasedtestsuites,7
regressiontestsuites,7
validateddata,7
orderofexecution,6,7
orthogonalarrays,66–70
balanced,87
definition,68
L18(2137),69
L18(35),68
L4(23),66
L64(8243),72
L9(34),67
mappingonto,74–76
comparisonwithAllpairsalgorithm,88–89
dealingwithextracolumns,83
dealingwithextravaluesinarow,83
notation,67
unassignedcells,82
using70–85
outpoint,118
Index
P
pairwisetesting,64–65,197
additionaltests,89
allpairstesting,64
Allpairsalgorithm,66,85,88–89
constraints,88
documentedstudies,64–65
effectiveness,64–65,89
paradigms,182
cloudourvision,182
sharpenourvision,182
Paradigms:TheBusinessofDiscoveringtheFuture,182
partitionedstate-transitiondiagram,97
pathcoverage,153
pathcreation,155
pathtesting,140
performancetesting,11
Perry,Dale,xvi
Phadke,MadhavS.,66,72
planning,183,212,216
adaptive,213
classical,213
Planning,215,216
planningfunctions,215
planningheuristic,214
planningpitfalls,215
post-conditions,27–28
pre-conditions,27–28
Pressman,Roger,5
processblock,146
processingflow,171
projectleveltaxonomies,223
purchasedtestsuites,7
Index
Q
qualityassuranceengineers,xv
QualityEngineeringUsingRobustDesign,66,72
Quentin,Geoff,xvi
Index
R
RAD,187
rapidapplicationdevelopment,187
Rapps,Sandra,168
regressiontestsuites,7
reviews,4
Rice,Dr.Scott,xvii
risk,3,134
Rose-Coutré,Robert,xvi
Royce,WinstonW.,186
Index
S
scenario,128
scriptedtesting,182,186,208,212
auditability,187
objectivity,187
repeatability,187
securitytesting,11
shiftedboundary,116–117
single-modedefects,65
Sloane,NeilJ.A.,72
Snook,Sid,xvi
softwaredefecttaxonomies,223–232
Beizer'staxonomy,226
Binder'sobject-orientedtaxonomy,229
Kaner,Falk,andNguyen'staxonomy,228
Vijayaraghavan'seCommercetaxonomy,231
Whittaker'sHowToBreakSoftwaretaxonomy,230
softwaredevelopers,xv
SoftwareEngineeringInstitute,223
softwareinspection,4,41,134,164,171,176,230
SoftwareInspection,41
SoftwareQualityEngineering,16
SoftwareSystemTestingandQualityAssurance,198
softwaretestengineers,xv
SoftwareTestingTechniques,226
specificfaultmodel,222
state,51,95–96
StatelessUniversity,59,94,121,124
admisions,121
StatelessUniversityRegistrationSystem,17,36,47,56,71,91,94,111,131,136,260
statementcoverage,147
state-transitiondiagrams,94–95,128
action,95,97
alleventscoverage,106
allpathscoverage,107
allstatescoverage,105
alltransitionscoverage,108
blackdotsymbol,95,97
bulls-eyesymbol,97
conditional,102
creatingtestcases,105–110
event,94–96
guard,102
mixingdifferententities,97
nestedstate-transitiondiagrams,97
partitionedstate-transitiondiagrams,97
state,95–96
transition,95–96
state-transitiontables
action,104
advantage,105
creatingtestcases,105–110
currentstate,104
disadvantage,105
event,104
nextstate,104
staticdataflowtesting,171
StickyMinds.com,202,212
stoppingcriteria,236–240
defectdiscoveryrate,238
marginalcost,239
metcoveragegoals,237
teamconsensus,239
thebosssays"Shipit!",240
structuredtesting,154–159
system,140
systemstate,51
systemtesting,10,135
systemtransactions,135
SystematicSoftwareTesting,xiii,2
Index
T
tables
Allpairsprograminput,86
Allpairsprogramoutput,86
Beizer'sBugtaxonomy,226
Binder'sClassScopetaxonomy,230
Binder'sMethodScopetaxonomy,229
classicalvs.adaptiveplanning,214
classicalvs.exploratoryplanning,214
collapseddecisiontable,55
decisiontable,51–52,54
DomainAnalysistestcases,122
DomainTestMatrix,120
exampleusecase,132
furthercollapseddecisiontable,55
genericdecisiontable,50
invaliddatavalues,32
ISO9126QualityCharacteristics,225
Kaner'staxonomy,228
L18(2137)orthogonalarray,70
L18(35)orthogonalarray,69
L4(23)orthogonalarray,66
L64(8243)orthogonalarray,73,75,77,79,81,84
L9(34)orthogonalarray,67
sampletestcases,53
SEItaxonomy,223
sensitizingcontrolflowpaths,164
setoftestcases,44
StatelessUniversityAdmissionsMatrix,121
State-Transitiontable,104
SURSdecisiontable,57
testcasetable,54
testingallvalidtransitions,109
usecasetemplate,130
validdatavalues,31
varyingvalidandinvalidvalues,32,34
Whittaker'sFaulttaxonomy,230
taxonomies,222–223
creatingyourown,232
projectlevel,223–226
softwaredefect,226–232
taxonomy-basedriskidentification,223
templateforusecases,130
testanalysis,2
testcasecomponents
inputs,6–7
orderofexecution,7–8
outputs,6–7
testcasecreation,134
testcasedefinition,5
testcasedesign,2
testcasedesignstyles
cascading,7
independent,8
testcasespecification,SeeIEEE829testcasespecification
testcasesubsets,22
testcoverage,147–153
testdesign,Seetestcasedesign
testdesignspecification,SeeIEEE829testdesignspecification
testincidentreport,SeeIEEE829testincidentreport
testitemtransmittalreport,SeeIEEE829testitemtransmittalreport
testlog,SeeIEEE829testlog
testmanagers,xv
testmultiplevariablessimultaneously,116
testoracles,6–7
testplan,SeeIEEE829testplan
testplanning,2,212–217
testprocedurespecification,SeeIEEE829testprocedurespecification
testsuites
purchased,7
regression,7
testsummaryreport,SeeIEEE829testsummaryreport
testerskills
carefulobservers,207
carefulreporters,207
criticalthinkers,207
evaluaterisk,207
goodmodelers,207
notdistracted,207
selfmanaged,207
testdesigners,207
testing
maturitylevels,2–4
blackbox,8,20–21
exhaustive,11,21
graybox,8
whitebox,8,20
testingchallenges,4
TestingComputerSoftware,202,228
testinginteractingvariables,116
testinglevels
acceptancetesting,10
integrationtesting,9
systemtesting,10
unittesting,9
testingmaturity,2–4
testingnsimultaneousdimensions,116
TestingObject-OrientedSystems,222
testingtechniques
Allpairsalgorithm,85
allpairstesting,64
boundaryvaluetesting,40
dataflowtesting,168
decisiontables,50
domainanalysis,116
equivalenceclasstesting,24
pairwisetesting,64
testingtoolbox,246
testing,definition
aconcurrentlifecycleprocess,2
comparison,2
testing-by-contract,27
TheCompleteGuideToSoftwareTesting,236
tiltedboundary,116–117
timebox,206
tools
AETG,88
Allpairs,85
rdExpert,68
transactiontesting,135
transactions,128
transitions,95–96
TwentyQuestions,203
typesoftesting
defensive-testing,28
testing-by-contract,27
Index
U
UMLDistilled:ABriefGuideToTheStandardObjectModelingLanguage,97
UnifiedModelingLanguage,129
unit,140
unittesting,9,140
UnitedStatesMarineCorps,215
usabilitytesting,11
usecases,128–129
actor,128
example,131–133
functionalrequirements,128–129
scenario,128
template,130–131
value,129
usecasetemplate
actors,130–131
channelstoprimaryactor,131
channelstosecondaryactors,131
completenesslevel,131
datedue,131
extensions,131
failedendconditions,130
frequency,131
goalincontext,130
level,130
mainsuccessscenario,130
name,130
numberoridentifier,130
openissues,131
preconditions,130
primaryactor,130
priority,131
responsetime,131
scope,130
secondaryactors,131
sub-variations,131
successendcondition,130
trigger,130
usedvariables,169
use-define,170
use-kill,170
use-use,170
Index
V
variablesincomputation,169
variablesinconditionals,169
validation,186
verification,186
Vijayaraghavan'seCommercetaxonomy,231
vonMoltke,Helmuth,215
Index
W
waterfalldevelopmentmodel,186–187
waterfalldevelopmentmodelphases
coding,186
operations,186
programdesign,186
requirementsanalysis,186
softwarerequirements,186
systemrequirements,186
waterfalldevelopmentmodeltesting,186
Webtestinglevels,11
codequality,11
functionality,11
performance,11
security,11
usability,11
Weinberg,Gerald,236
Weyuker,Elaine,168
whiteboxtesting,8,20,140–142
existingpaths,141
nonexistentpaths,141
whiteboxtestingtechniques
controlflowtesting,144–159
dataflowtesting,168–176
Whittaker,James,135,230
Whittaker'sHowToBreakSoftwaretaxonomy,230
WritingEffectiveUseCases,130
Index
Y
y=mx+b,121
ListofFigures
Chapter3:EquivalenceClassTesting
Figure3-1:Continuousequivalenceclasses
Figure3-2:Discreteequivalenceclasses
Figure3-3:Singleselectionequivalenceclasses
Figure3-4:Multipleselectionequivalenceclass
Chapter4:BoundaryValueTesting
Figure4-1:Boundaryvaluesforacontinuousrangeofinputs.
Figure4-2:Boundaryvaluesforadiscreterangeofinputs.
Figure4-3:Datapointsontheboundariesanddatapointsjustoutsidetheboundaries.
Chapter5:DecisionTableTesting
Figure5-1:SURSStudentDatabaseMaintenanceScreen.
Chapter6:PairwiseTesting
Figure6-1:Orthogonalarraynotation
Chapter7:State-TransitionTesting
Figure7-1:TheReservationisMade.
Figure7-2:TheReservationtransitionstothePaidstate.
Figure7-3:TheReservationtransitionstotheTicketedstate.
Figure7-4:TheReservationtransitionstotheUsedstate.
Figure7-5:Thepathends.
Figure7-6:ThePayTimerexpiresandtheReservationiscancelledfornonpayment.
Figure7-7:CanceltheReservationfromtheMadestate.
Figure7-8:CancellationfromthePaidstate.
Figure7-9:CancellationfromtheTicketedstate.
Figure7-10:Asetoftestcasesthat"visit"eachstate.
Figure7-11:Asetoftestcasesthattriggeralleventsatleastonce.
Figure7-12:Asetoftestcasesthattriggeralltransitionsatleastonce.
Figure7-13:State-transitiondiagramforenrollanddropacourseatStatelessU.
Chapter8:DomainAnalysisTesting
Figure8-1:Twodimensionalboundarydefects.
Figure8-2:Examplesofon,off,in,andoutpointsforbothclosedandopenboundaries.
Figure8-3:StatelessUniversityAdmissionsMatrixingraphicalform.
Chapter9:UseCaseTesting
Figure9-1:SomeStatelessUniversityusecases.
Chapter10:ControlFlowTesting
Figure10-1:Flowgraphequivalentofprogramcode.
Figure10-2:Graphicalrepresentationofthetwo-linecodesnippet.
Figure10-3:Fourexecutionpaths.
Figure10-4:Twotestcasesthatyield100%decisioncoverage.
Figure10-5:Compilerevaluationofcomplexconditions.
Figure10-6:Aninterestingflowdiagramwithmany,manypaths.
Figure10-7:Anexamplecontrolflowgraph.
Figure10-8:ThechosenbaselinebasispathABDEGKMQS
Figure10-9:ThesecondbasispathACDEGKMQS
Figure10-10:ThethirdbasispathABDFILORS
Figure10-11:ThefourthbasispathABDEHKMQS
Figure10-12:ThefifthbasispathABDEGKNQS
Figure10-13:ThesixthbasispathACDFJLORS
Figure10-14:TheseventhbasispathACDFILPRS
Figure10-15:JavacodeforBrown&Donaldson'sevaluateBuySellmodule.
Figure10-16:ControlflowgraphforBrown&Donaldson'sevaluateBuySellmodule.
Figure10-17:ControlflowgraphforBrown&Donaldson'sevaluateBuySellmodule.
Chapter11:DataFlowTesting
Figure11-1:Thecontrolflowdiagramannotatedwithdefine-use-killinformationforeachof
themodule'svariables.
Figure11-2:Thecontrolflowdiagramannotatedwithdefine-use-killinformationforthex
variable.
Figure11-3:Thecontrolflowdiagramannotatedwithdefine-use-killinformationforthey
variable.
Figure11-4:Thecontrolflowdiagramannotatedwithdefine-use-killinformationforthez
variable.
Chapter12:ScriptedTesting
Figure12-1:TheWaterfalllifecyclemodel.
Figure12-2:TheIEEE829TestDocuments
Chapter16:WhentoStopTesting
Figure16-1:DefectDiscoveryRate
ListofTables
Chapter3:EquivalenceClassTesting
Table3-1:Atestcaseofvaliddatavalues.
Table3-2:Atestcaseofallinvaliddatavalues.Thisisnotagoodapproach.
Table3-3:Asetoftestcasesvaryinginvalidvaluesonebyone.
Table3-4:Asetoftestcasesvaryinginvalidvaluesonebyonebutalsovaryingthevalid
values.
Table3-5:Asetoftestcasesvaryinginvalidvaluesonebyone.
Chapter4:BoundaryValueTesting
Table4-1:Asetoftestcasescontainingcombinationsofvalid(ontheboundary)valuesand
invalid(offtheboundary)points.
Chapter5:DecisionTableTesting
Table5-1:Thegeneralformofadecisiontable.
Table5-2:Adecisiontablewithtwobinaryconditions.
Table5-3:Addingasingleactiontoadecisiontable.
Table5-4:Adecisiontablewithmultipleactions.
Table5-5:Adecisiontablewithnon-binaryconditions.
Table5-6:Sampletestcases.
Table5-7:Adecisiontableconvertedtoatestcasetable.
Table5-8:AdecisiontablefortheBrown&DonaldsonBuyorder.
Table5-9:Acollapseddecisiontablereflecting"Don'tCare"conditions.
Table5-10:Afurthercollapseddecisiontablereflecting"Don'tCare"conditions.
Table5-11:AdecisiontableforStatelessUniversityRegistrationSystem.
Chapter6:PairwiseTesting
Table6-1:L4(23)OrthogonalArray
Table6-2:L9(34)OrthogonalArray
Table6-3:L18(35)OrthogonalArray
Table6-4:L18(2137)OrthogonalArray
Table6-5:L64(8243)OrthogonalArray
Table6-6:L64(8243)withapartialmappingofitsfirstcolumn.
Table6-7:L64(8243)withafullmappingofitsfirstcolumn.
Table6-8:L64(8243)withafullmappingofitsfirstandsecondcolumns.
Table6-9:L64(8243)withafullmappingofallitscolumns.
Table6-10:L64(8243)withafullmappingofallitscolumnsincludingthe"extra"cells.
Table6-11:InputtotheAllpairsprogram.
Table6-12:OutputfromtheAllpairsprogram.
Chapter7:State-TransitionTesting
Table7-1:State-TransitiontableforReservation.
Table7-2:TestingallvalidtransitionsfromaState-transitiontable.
Chapter8:DomainAnalysisTesting
Table8-1:ExampleDomainTestMatrix.
Table8-2:StatelessUniversityAdmissionsMatrix.
Table8-3:1x1DomainAnalysistestcasesforStatelessUniversityadmissions.
Chapter9:UseCaseTesting
Table9-1:Usecasetemplate.
Table9-2:Exampleusecase.
Chapter10:ControlFlowTesting
Table10-1:Datavaluestosensitizethedifferentcontrolflowpaths.
Chapter14:TestPlanning
Table14-1:Classicalplanningvs.Adaptiveplanning.
Table14-2:Classicaltestplanningvs.Exploratorytestplanning.
Chapter15:DefectTaxonomies
Table15-1:TheSEITaxonomy-BasedRiskIdentificationtaxonomy.
Table15-2:TheISO9126QualityCharacteristicstaxonomy.
Table15-3:AportionofBeizer'sBugTaxonomy.
Table15-4:AportionofthedefecttaxonomyfromTestingComputerSoftware.
Table15-5:AportionofBinder'sMethodScopeFaultTaxonomy.
Table15-6:AportionofBinder'sClassScopeFaultTaxonomy.
Table15-7:AportionofWhittaker'sFaultTaxonomy.
ListofExamples
Chapter3:EquivalenceClassTesting
Example1
Example2
Example3
Example4
Chapter4:BoundaryValueTesting
Example1
Example2
Chapter5:DecisionTableTesting
Example1
Example2

Navigation menu