Testing
Software testingisaninvestigationconductedtoprovidestakeholders
withinformationaboutthequalityoftheproductorserviceunder
test.Softwaretestingcanalsoprovideanobjective,independentviewof
thesoftwaretoallowthebusinesstoappreciateandunderstandtherisks
ofsoftwareimplementation.Testtechniquesincludetheprocessof
executingaprogramorapplicationwiththeintentoffindingsoftware
bugs(errorsorotherdefects).
Itinvolvestheexecutionofasoftwarecomponentorsystemcomponent
toevaluateoneormorepropertiesofinterest.Ingeneral,these
propertiesindicatetheextenttowhichthecomponentorsystemunder
test:
meetstherequirementsthatguideditsdesignanddevelopment,
respondscorrectlytoallkindsofinputs,
performsitsfunctionswithinanacceptabletime,
issufficientlyusable,
canbeinstalledandruninitsintendedenvironments,and
achievesthegeneralresultitsstakeholdersdesire.
Test phases
Unit Testing
awhite-boxapproach
Testingbasedonthecoverageoftheexecutedprogram (source)
code.
Differentcoverage criteria:
statementcoverage
pathcoverage
conditioncoverage
definition-usecoverage
..
Itisoftenthecasethatitisnotpossibletocoverallcode.For
instance:
-forthepresenceofdeadcode(notexecutablecode)
-forthepresenceofnotfeasiblepathintheCFG
-etc.
ablack-boxapproach
1.describethesystemusingaUse-CasesDiagram
* a use-case of that diagram represents a functionality implemented by
thesystem
3.defineallinstancesofeachuse-case(scenarios)executing
thesystemforrealizingthefunctionality
4.define,atleast,onetestcaseforeachscenario
5.(opt) define additional test cases to test the interaction
betweenuse-cases.
Howtoselectinputvalues?
Differentapproachescanbeused:
-
Random values:
-
Tester Experience:
-
foreachinputparameterwerandomlyselectthevalues
Domain knowledge:
-
Howtoselectinputvalues?
Differentapproachescanbeused:
-
Equivalence classes:
-
wesubdividetheinputdomainintoasmallnumberofsub-domains
theequivalenceclassesarecreatedassumingthattheSUTexhibits
thesamebehavioronallelements
fewvaluesforeachclassescanbeusedforourtesting
Boundary values:
Howtoselectinputvalues?
-
Combinatorial testing:
-
testallpossiblecombinationoftheinputsisoftenimpossible
e.g.,method(a:int,b:int,c:int)..howmanycombinations?
with10valuesperinput:103=1000
with100valuesperinput:1003=1000000
selectionofrelevantcombinationsisimportant
-
Pairwise testing (aka 2-way): cover all combinations for each pair of
inputs
<a,b><a,c><b,c>=102+102+102=300
dontcareaboutthevalueofthethirdinput
11