Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decision Table

priyasoundar 2,626 views 144 slides Sep 27, 2020
Slide 1
Slide 1 of 144
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59
Slide 60
60
Slide 61
61
Slide 62
62
Slide 63
63
Slide 64
64
Slide 65
65
Slide 66
66
Slide 67
67
Slide 68
68
Slide 69
69
Slide 70
70
Slide 71
71
Slide 72
72
Slide 73
73
Slide 74
74
Slide 75
75
Slide 76
76
Slide 77
77
Slide 78
78
Slide 79
79
Slide 80
80
Slide 81
81
Slide 82
82
Slide 83
83
Slide 84
84
Slide 85
85
Slide 86
86
Slide 87
87
Slide 88
88
Slide 89
89
Slide 90
90
Slide 91
91
Slide 92
92
Slide 93
93
Slide 94
94
Slide 95
95
Slide 96
96
Slide 97
97
Slide 98
98
Slide 99
99
Slide 100
100
Slide 101
101
Slide 102
102
Slide 103
103
Slide 104
104
Slide 105
105
Slide 106
106
Slide 107
107
Slide 108
108
Slide 109
109
Slide 110
110
Slide 111
111
Slide 112
112
Slide 113
113
Slide 114
114
Slide 115
115
Slide 116
116
Slide 117
117
Slide 118
118
Slide 119
119
Slide 120
120
Slide 121
121
Slide 122
122
Slide 123
123
Slide 124
124
Slide 125
125
Slide 126
126
Slide 127
127
Slide 128
128
Slide 129
129
Slide 130
130
Slide 131
131
Slide 132
132
Slide 133
133
Slide 134
134
Slide 135
135
Slide 136
136
Slide 137
137
Slide 138
138
Slide 139
139
Slide 140
140
Slide 141
141
Slide 142
142
Slide 143
143
Slide 144
144

About This Presentation

These slides will be useful for understanding BVA, ECP, DT concepts in Software Testing


Slide Content

SOFTWARE TESTING
BLACK BOX TESTING
Prepared by
Ms. S. Shanmuga Priya
Senior Assistant Professor
Department of Computer Science and Engineering
New Horizon College of Engineering
Bangalore
Karnataka
India

BLACK BOX TESTING
BOUNDARY VALUE TESTING
EQUIVALENCE CLASS TESTING
DECISION –TABLE BASED TESTING

CONCEPTS DISCUSSED

UNIT TESTING
•Inaproceduralprogramminglanguage,aunitcanbe
–Asingleprocedure
–Afunction
–Abodyofcodethatimplementsasinglefunction
–Sourcecodethatfitsononepage
–Abodyofcodethatrepresentsworkdonein4to40hours
(asinaworkbreakdownstructure)
–Thesmallestbodyofcodethatcanbecompiledand
executedbyitself
•InObjectOrientedProgramming,aunitcanbe
-Methodsofaclassmightbelimitedbyanyofthe
“definitions”ofaunit
•Bottomlineisthat“unit”isprobablybestdefinedby
organizationsimplementingcode

Black Box Test Design Techniques
Types of Black Box Testing Techniques
1)Boundary Value Analysis
2) Equivalence Classes Partitioning
3)Decision Table Testing

BOUNDARY VALUE ANALYSIS

BOUNDARY VALUE ANALYSIS (BVA)
Definition
•BoundaryValueAnalysisisablackboxtest
designtechniquewheretestcasearedesignedby
usingboundaryvalues
•Boundaryvalueanalysis(BVA)isbasedon
testingattheboundariesbetweenpartitions
•Mosterrorsoccuratextremes(<insteadof<=,
counteroffbyone)

•Herewehaveboth:
–validboundaries(inthevalidpartitions)and
–invalidboundaries(intheinvalidpartitions)
•BVAisusedinrangechecking
•Mainlyusefulforlooping

•WhenafunctionFisimplementedasa
program,theinputvariablesx
1andx
2will
havesomeboundaries:
a<=x
1<=b
c<=x
2<=d
where
-[a,b]and[c,d]aretheintervals
BVAfocusesontheboundaryoftheinput
spacetoidentifytestcases

EXAMPLE 1 FOR BVA
•SupposeyouhavetochecktheUserNameandPasswordfieldthataccepts
–minimum8charactersand
–maximum12characters
–Validrange8-12
–Invalidrange7orlessthan7
–Invalidrange13ormorethan13
•TestCasesforValidpartitionvalue,Invalidpartitionvalueandexact
boundaryvalue
•TestCases1:Considerpasswordlengthlessthan8.
•TestCases2:Considerpasswordoflengthexactly8.
•TestCases3:Considerpasswordoflengthbetween9and11.
•TestCases4:Considerpasswordoflengthexactly12.
•TestCases5:Considerpasswordoflengthmorethan12.

EXAMPLE 2 FOR BVA
•Testcasesfortheapplicationwhoseinputboxacceptsnumbers
between1-1000
-Validrange1-1000
-Invalidrange0and
-Invalidrange1001ormore
•TestCasesforValidpartitionvalue,Invalidpartitionvalueand
exactboundaryvalue.
•TestCases1:Considertestdataexactlyastheinputboundariesof
inputdomaini.e.values1and1000
•TestCases2:Considertestdatawithvaluesjustbelowtheextreme
edgesofinputdomainsi.e.values0and999
•TestCases3:Considertestdatawithvaluesjustabovetheextreme
edgesofinputdomaini.e.values2and1001

•SINGLEFAULTASSUMPTION
Assumesthe‘singlefault’or“independenceof
inputvariables.”
–Failuresarerarelytheresultofthesimultaneous
occurrenceoftwo(ormore)faults
–e.g.Ifthereare2inputvariables,theseinput
variablesareindependentofeachother.
•MULTIPLEFAULTASSUMPTION
“dependenceamongtheinputs”

VARIANTS OF BVA
•Fourvariationsofboundaryvaluetesting:
–Normalboundaryvaluetesting
–Robustboundaryvaluetesting
–Worst-caseboundaryvaluetesting
–Robustworst-caseboundaryvaluetesting

NORMAL BOUNDARY VALUE
TESTING

•BasicideaofBVAistouseinputvariablevalues
attheir:blueshadedregion–inputdomain
space
-Minimum(min)
-AboveMinimum(min+)
-NominalValue(nom)(AverageValue)
-BelowMaximum(max-)
-Maximum(max)
VALUE SELECTION IN BVA
a<=x
1<=b
c<=x
2<=d

X1,X2Variables
DotsRepresentsatestvalueat
whichtheprogramistobetested
INPUT BOUNDARY VALUE TEST CASES
(2 VARIABLES)

TEST CASES (BY NUMBER OF VARIABLES)
•<X
1nom,X
2min>,<10,25>
•<X
1nom,X
2min+>,<10,26>
•<X
1nom,X
2nom>,<10,30>
•<X
1nom,X
2max>,<10,35>
•<X
1nom,X
2max->,<10,34>
•<X
1min,X
2nom>,<5,30>
•<X
1min+,X
2nom>,<6,30>
•<X
1nom,X
2nom>,<10,30>
•<X
1max,X
2nom>,<15,30>
•<X
1max+,X
2nom>,<14,30>
INPUTS
5<=X
1<=15
25<=X
2<=35

GENERALIZING BVA
•BVA can be generalized in two ways:
–By the number of variables (4n+1) test cases
for n variables
•Where,
–4 Values (min, min+, max, max-)
–n, number of variables
–1, nor (average value)
•By the kinds of ranges of variables
–Programming language dependent
–Logical variables
–Bounded (upper or lower bounds clearly defined)
–Unbounded (no upper or lower bounds clearly defined)

EXAMPLES
TRIANGLE PROBLEM BVA TEST CASES
CONDITIONS
c1: 1<=a<=200
c2: 1<=b<=200
c3: 1<=c<=200
Min = 1
Min+ = 2
Nom = 100
Max-= 199
Max = 200
Min
Min+
Nom
Max-
Max

TEST CASE FOR NEXT DATE FUNCTION
Min
Min+
Nom
Max-
Max

LIMITATIONS OF BVA

ROBUSTNESS TESTING
•Robustnesscanalsobedefinedastheabilityofanalgorithmto
continueoperatingdespiteabnormalitiesininput,calculations,etc.
•Robustnesstestingisasimpleextensionofboundaryvalueanalysis
•Inadditiontothe5BVAvaluesofvariablesincludes,addvaluesslightly
greaterthanthemaximum(max+)andavalueslightlylessthanthe
minimum(min-)
–Min–1
–Min
–Min+1
–Nom
–Max-1
–Max
–Max+1
•Mainvalueofrobustnesstestingistoforceattentiononexception
handling
•Insomestronglytypedlanguagesvaluesbeyondthepredefinedrangewill
causearun-timeerror
Number of TC = 6n+1
6 Values
n Number of Variables
1Nom (Average Value)

ROBUSTNESS TEST CASES FOR A FUNCTION
OF TWO VARIABLES
Dotsthatareoutsidetherange
[a,b]ofvariablex1.
Similarly,forvariablex2,wehave
crosseditslegitimateboundaryof
[c,d]ofvariablex2.

WORST –CASE TESTING

Min
Min+
Nom
Max-
Max

Min
Min+
Nom
Max-
Max

ROBUST WORST-CASE TEST CASE
Involves 7
n
test cases

SPECIAL VALUE TESTING
•Mostwidelypracticedformoffunctionaltesting
•Testeruses(todevisetestcases):
–his/herdomainknowledge,
–experiencewithsimilarprograms,and
–informationabout“softspots”
•Dependentontheabilitiesofthetester!!!
•TestcasesinvolvingFeb28,29andleapyearsaremost
likelytobeidentifiedastestcasesusingspecialvalue
testing
•Robustnesstestingandworstcasetestingdonot
identifyFeb28asatestcase
•AlsoknownasAd-hocTesting

TEST CASE FOR COMMISSION PROBLEM

EXAMPLE TEST CASE USING OUTPUT
RANGE VALUE

LOCK: $45 STOCK: $30 BARREL: $25
CONSTRAINT(s)
1.Sales person should sell at least
one complete rifle per month
2.Production limit/month:
LOCK: 70, STOCK: 80, BARREL: 90

TEST CASE 9 IS THE $1000
BORDER POINT

1
2
3
4
5
6
7
8

OUTPUT SPECIAL VALUE TEST CASES

RANDOM TESTING
•Basicideaisthat,ratherthanalwayschoosethe
min,min+,nom,max-,andmaxvaluesofa
boundedvariable,usearandomnumber
generatortopicktestcasevalues
•InVisualBasicapplication,topickvaluesfora
boundedvariablea<=x<=b,uses
x=Int((b-a+1)*Rnd+a)
where,
IntReturnstheintegerpartoffloating
pointnumber
RndFunctiongeneratesrandomnumbers
intheinterval[0,1]

HOW MANY TEST CASES DO WE MAKE?
•Relatedtotheprobabilityofproducingevery
outcomeatleastonce
•Relatedtotheprobabilityofexecutingevery
statement/pathatleastonce

EQUIVALENCE CLASS TESTING

•BoundaryValueTestingderivestestcaseswith
Seriousgaps
Massiveredundancy
•Motivationsforequivalenceclasstestingare
Completetesting
Avoidredundancy
CONS OF BVA

•BlackBoxTechnique
•Utilizesasubsetofdatawhichisrepresentativeofalarger
class
•Equivalencepartitioninginvolvespartitioningoftheinput
domainofasoftwaresystemintoseveralequivalentclasses
inamannerthatthetestingofoneparticularrepresentative
fromaclassisequivalenttothetestingofsomedifferentvalue
fromthesubjectclass
•Applicability
–Programisafunctionfrominputtooutput
–Inputand/oroutputvariableshavewelldefinedintervals

AIRLINE RESERVATION SYSTEM

Any number
above or
below 1 and
10 is invalid
1...10 are
valid

•Hereisthetestcondition
•Number>10enteredinthereservationcolumn(letsay11)isconsidered
invalid
•Number<1thatis0orbelow,thenitisconsideredinvalid
•Numbers1to10areconsideredvalid
•Any3DigitNumbersay-100isinvalid
•Wecannottestallthepossiblevaluesbecauseifdone,numberoftestcases
willbemorethan100
•Toaddressthisproblem,weuseequivalencepartitioninghypothesiswhere
wedividethepossiblevaluesofticketsintogroupsorsetsasshownbelow
wherethesystembehaviorcanbeconsideredthesame

The divided sets are called Equivalence Partitions or Equivalence Classes. Then we
pick only one value from each partition for testing. The hypothesis behind this
technique isthat if one condition/value in a partition passes all others will also pass.
Likewise, if one condition in a partition fails, all other conditions in that partition will
fail.

EQUIVALENCE CLASS TEST CASE
•Consideranumericalinputvariable,i,whosevalues
mayrangefrom-200through+200.Thenapossible
partitioningoftestinginputvariable,i,by4
partitionsmaybe:
–-200to-100
–-101to0
–1to100
–101to200
•Define“samesign”astheequivalencerelation,R,
definedovertheinputvariable’svalueset,i={-200-
-,0,--,+200}.Thenonepartitioningwillbe:
–-200to-1(negativesign)
–0 (nosign)
–1to200(positivesign)

DIFFERENCE BETWEEN BVA AND
EQUIVALENCE PARTITIONING

TRADITIONAL EQUIVALENCE CLASS TESTING
•NearlyidenticaltoWeak
Robust Equivalence
ClassTesting
•FocusesonInvaliddata
values

•Theideaofequivalenceclasstestingistoidentifytestcasesby
usingoneelementfromeachequivalenceclass
•Iftheequivalenceclassesarechosenwisely,thepotential
redundancyamongtestcasescanbereduced
•[ClosedIntervalIncludesend-points
•)OpenIntervalDoesnotincludeend-points
Example (0,1) means greater than 0 and less than 1
IMPROVED EQUIVALENCE CLASS TESTING

•Invalid values of x1 and x2 are
–x1 <a, x1> d, and x2 <e, x2> g.
•The equivalence classes of valid values are
V1 = {x1: a ≤ x1 < b},
V2 = {x1: b ≤ x1 < c},
V3 = {x1: c ≤ x1 ≤ d},
V4 = {x2: e ≤ x2 < f },
V5 = {x2: f ≤ x2 ≤ g}
•The equivalence classes of invalid values are
NV1 = {x1: x1 < a},
NV2 = {x1: d < x1},
NV3 = {x2: x2 < e},
NV4 = {x2: g < x2}

TYPES OF EQUIVALENCE CLASS TESTING
1)WeakNormalEquivalenceClassTesting
2)StrongNormalEquivalenceClassTesting
3)WeakRobustEquivalenceClassTesting
4)StrongRobustEquivalenceClassTesting

WEAK NORMAL EQUIVALENCE CLASS
TESTING
•WeakSingleFaultAssumption(One
fromeachclass)
•NormalClassesofValidValuesofInput
(IdentifyClasses)
•Choosethetestcasefromeachofthe
equivalenceclassesforeachinputvariable
independentlyoftheotherinputvariable
•Testcaseshaveallvalidvalues
•Detectsfaultsduetocalculationswithvalid
valuesofsinglevariable

DOTIndicatesaValid
Value(TestData)
Validvalueonefromeach
class

Example
Assume the equivalence partitioning of inputX2 is: 1 to 10; 11 to 20, 21 to 30
and the equivalence partitioning of input X1is: 1 to 5; 6 to 10; 11 to 15; and 16 to 20
NUMBER OF TEST CASES = #classes in the partition with the largest numbering of
subsets.
X2
X1
1
10
20
30
1 5 10 15 20
Wehavecoveredeveryoneof
the3equivalenceclassesfor
inputX.
For ( X2, X1 )
we have:
(24,2)
(15, 8)
( 4,13)
(23,17)
PROBLEM: May miss some equivalence classes

STRONG NORMAL EQUIVALENCE CLASS TESTING
•StrongMultipleFaultAssumption(One
fromeachclassinCartesian
Product)
•NormalIdentifyequivalenceclassesofValid
Inputs
•TestcasesfromCartesianProductofvalid
values
•CartesianProductguaranteesnotionof
completeness
•Detectsfaultsduetointeractionwithvalidvalues
ofanynumberofvariables

DotsValid
valuesbutwithall
possibilities
COVERS ONE
POSSIBLE
COMBINATION
FROM EACH
PARTITION

Example of : Strong Normal Equivalence testing
Assume the equivalence partitioning of input X2is: 1 to 10; 11 to 2; 21 to 30
and the equivalence partitioning of input X1is: 1 to 5; 6 to 10; 11 to 15; and 16 to 20
NUMBER OF TEST CASES: Based on Cartesian product of the partition subsets
X2
X1
1
10
20
30
1 5 10 15 20
Wehavecoveredeveryoneof
the3x4Cartesianproductof
equivalenceclasses
PROBLEM: Doesn’t test values outside of intervals

WEAK ROBUST EQUIVALENCE CLASS
TESTING
•WeakSingleFaultAssumption(Onefromeach
class)
•RobustClassesofvalidandinvalidvaluesof
input
•Uptonowwehaveonlyconsideredpartitioningthe
validinputspace
•“Weakrobust”issimilarto“weaknormal”
equivalencetestexceptthattheinvalidinputvariables
arenowconsidered

Example of : Weak RobustEquivalence testing
Assume the equivalence partitioning of input X2 is 1 to 10; 11 to 20, 21 to 30
and the equivalence partitioning of input X1is 1 to 5; 6 to 10; 11 to 15; and 16 to 20
X2
X1
1
10
20
30
1 5 10 15 20
Wehavecovered
everyoneofthe5
equivalenceclassesfor
inputX.
PROBLEM: Misses some equivalence classes

PROBLEMS WITH ROBUST EQUIVALENCE TESTING
a)Veryoftenthespecificationdoesnotdefine
whattheexpectedoutputforaninvalidtest
caseshouldbe
b)Thus,testersspendalotoftimedefining
expectedoutputsforthesecases
c)StronglytypedlanguageslikePascal,Ada,
eliminatetheneedfortheconsiderationof
invalidinputs

STRONG ROBUST EQUIVALENCE CLASS TESTING
•StrongMultipleFaultAssumption(One
fromeachclassinCartesian
Product)
•RobustClassesofvalidandinvalidvalues
ofinput
•Obtainthetestcasesfromeachelementofthe
Cartesianproductofalltheequivalence
classes

Example of : Strong Robust Equivalence testing
Assume the equivalence partitioning of input X is: 1 to 10; 11 to 20, 21 to 30
and the equivalence partitioning of input Y is: 1 to 5; 6 to 10; 11 to 15; and 16 to 20
X
Y
1
10
20
30
1 5 10 15 20
Wehavecoveredeveryoneof
the5x6Cartesianproductof
equivalenceclasses(including
invalidinputs)
Problem: None, but results in lots of test cases (expensive)

SAMPLE QUESTIONS

EQUIVALENCE CLASS TEST
CASES FOR THE TRIANGLE
PROBLEM

•Fourpossibleoutputs:
–NotATriangle
–ScaleneTriangle
–IsoscelesTriangle
–EquilateralTriangle
•Output(range)equivalenceclasses:
INPUT OUTPUT

WEAK NORMAL EQUIVALENCE CLASS TEST CASE
Four weak normal equivalence class test cases,
chosen arbitrarily from each class

STRONG NORMAL EQUIVALENCE CLASS TEST CASE
•Becausenovalidsubintervalsofvariablesa,
b,andcexist,thestrongnormalequivalence
classtestcasesareidenticaltotheweak
normalequivalenceclasstestcases.

WEAK ROBUST TEST CASES
The invalid
valuescouldbe
-Zero(0)
-AnyNegative
Number(-ve)
-Anynumber
>200
Considering, the invalid values for a, b, and c
yield the above additional
weak robust equivalence class test cases

STRONG ROBUST TEST CASE

TRIANGLE INPUT EQUIVALENCE CLASSES
Forexample,triplet<1,4,1>hasexactlyonepairof
equalsides,butthosesidesdonotformatriangle

Ifwewanttobeevenmorethorough,wecould
separatethe“greaterthanorequalto”totwo
distinctcasesas:
D6willbecome:
D6’={<a,b,c>:a=b+c}
D6”={<a,b,c>:a>b+c}
Similarly,forD7andD8

EQUIVALENCE CLASS TEST CASES FOR THE
NEXTDATE FUNCTION
•Intervals of valid values defined as follows:
M1= {month : 1 <= month <=12}
D1 = {day : 1<= day <= 31}
Y1 = {year : 1812 <= year <= 2012}

WEAK NORMAL EQUIVALENCE CLASS

WEAK ROBUST TEST CASES

STRONG ROBUST TEST CASES

EQUIVALENCE CLASS TEST CASES FOR THE
NEXTDATE FUNCTION
•Variables:
–Month
–Day
–Year
•Equivalence Classes for Months M=M
1UM
2UM
3
–30 days months (M1)
–31 days months (M2)
–February (M3)

•Equivalence Classes for YearsY=Y
1UY
2UY
3UY
4
–Non-Century Common Years (Y
1)
–Non-Century Leap Years (Y
2)
–Common Century Years (Y
3)
–Leap Century Years (Y
4)
•Equivalence Classes for DaysD= D
1UD
2UD
3…
–D
1=1…?
–D
2=?
MAY GIVE A SOLUTION, BUT
THE CLASSES MAY BE LARGE

31 --> Jan(1), March(3), May(5), July(7),
August(8), Oct(10), Dec(12)
30 --> April(4), June(6), Sept(9), Nov(11)

NUMBEROFTESTCASES=#classesinthe
partitionwiththelargestnumberingof
subsets.
WEAK NORMAL EQUIVALENCE CLASS

NUMBEROFTESTCASES:
BasedonCartesian
productofthepartition
subsets
3MONTHCLASSES
4DAYCLASSES
3YEARCLASSES
3*4*3=36

EQUIVALENCE CLASS TEST CASE FOR
COMMISSION PROBLEM
•Theinputdomainofthecommissionproblemis
partitionedbythelimitson:
–Locks
–Stocks
–Barrels
•Thefirstclassisthevalidinputandothertwoare
invalid
•Whenavalueof-1isgivenforlocks,thewhile
loopterminates,andthevaluesoftotalLocks,
totalStocks,andtotalBarrelsarecomputedto
computesalesandthencommission

End Commission

INPUT CLASSES

WEAK NORMAL AND STRONG
NORMAL EQUIVALENCE CLASS
Wewillhaveexactlyoneweaknormal
equivalenceclasstestcaseanditsidenticalto
thestrongnormalequivalenceclasstestcase

WEAK ROBUST TEST CASE

STRONG ROBUST EQUIVALENCE CLASS
TEST CASES

OUTPUT RANGE EQUIVALENCE CLASS TEST

•Equivalencepartitionsaredesignedsothat
everypossibleinputbelongstooneandonly
oneequivalencepartition
•Itisappropriatewheninputdataisdefinedin
termsofintervals
•Equivalenceclasstestingisstrengthenedbya
hybridapproachwithboundaryvaluetesting
ADVANTAGES OF EQUIVALENCE PARTITIONING
ECT BVA

DISADVANTAGES
•Noguidelinesforchoosinginputs
•Doesn’ttesteveryinput
•Severaltriesmaybeneededbeforetheright
equivalencerelationisdiscovered

EDGE TESTING
•EdgeTestingHybridofboundary
valueanalysisandequivalenceclass
testing
•NeedforEdgeTesting?
–contiguousrangesofaparticular
variableconstituteequivalenceclasses

•Normaltestvaluesforx1:{a,a+,b–,b,b+,c–,c,c+,d–,d}
•Robusttestvaluesforx1:{a–,a,a+,b–,b,b+,c–,c,c+,d–,d,d+}
•Normaltestvaluesforx2:{e,e+,f–,f,f+,g–,g}
•Robusttestvaluesforx2:{e–,e,e+,f–,f,f+,g–,g,g+}
•NOTE:Onesubtledifferenceisthatedgetestvaluesdonotinclude
thenominalvaluesthatwehadwithboundaryvaluetesting.

DECISION TABLE –BASED TESTING

DECISION-TABLE BASED TESTING

DECISION TABLE TERMINOLOGIES
CONDITION
STUB
ACTION
STUB
CONDITION ENTRIES
ACTION ENTRIES

•Adecisionconditionisconstructedwithacondition
stubandaconditionentry
•ConditionStub
–isdeclaredasastatementofacondition
•ConditionEntry
–providesavalueassignedtotheconditionstub
•Similarly,anaction(ordecision)composestwoelements:
anactionstubandanactionentry
•ActionStub
–Onestatesanactionwithanactionstub
•ActionEntry
–specifieswhether(orinwhatorder)theactionistobeperformed

STRUCTURE OF DECISION TABLE
•Acolumnintheentryportionisknownasa
rule
•Rulesindicatewhichactionsaretakenforthe
conditionalcircumstancesindicatedinthe
conditionportionoftherule
•Decisiontableisusedfor“testcase
identification”
•Decisiontablesaredeclarativethatconditions
andactionsfollowsnoparticularorder

TYPES OF DECISION TABLES
•LimitedEntryDecisionTable
–Decisiontablesinwhichallconditionsarebinary
areknownas“Limitedentrydecisiontables”
•ExtendedEntryDecisionTable
–Ifconditionsareallowedtohaveseveralvalues,
theresultingtablesareknownas“Extendedentry
decisiontables”

DECISION TABLE INTERPRETATION
•Howareconditionentriesinadecisiontableinterpretedwithrespect
toaprogram?
Conditionsareinterpretedas:
Input
Equivalenceclassesofinputs
•Howareactionentriesinadecisiontableinterpretedwithrespecttoa
program?
Actionsareinterpretedas:
Output
Majorfunctionalprocessingportions
•Whatistherelationshipbetweendecisiontablesandtestcases?
–Rulesareinterpretedastestcases
–Withacompletedecisiontable,haveacompletesetoftestcases

•Don’tCareEntries
–Don’tcareentriesindicates,thatthe
conditionisirrelevantorconditiondoes
notapply
–Helpsingivingacompletedecisiontable
–Representedbyusingthesymbol‘__’
•Useofdon’tcareentries
–Reducethenumberofexplicitrulesbyimplying
theexistenceonnon-explicitlystatedrules

•InLimitedEntryDecisionTable:
ENTRIES NOTATION USED
CONDITIONENTRIES T (TRUE), F (FALSE)
ACTION ENTRIES X
DON’T CARE ENTRIES __

TRIANGLE DECISION TABLE
A5Actionaddedbytester,showingruleimpossible
Actionimpossibleshowswhenaruleislogicallyimpossible
CONDITION ENTRY
ACTION ENTRY
DON’T CARE ENTRY
Conditions Input
Actions Output
REASON : If two pairs of integers are equal, by transitivity,
the third pair must be equal
123456789

TIPS TO REMEMBER THE TABLE

TRIANGLE DECISION TABLE -REFINED
Number of Rules = 2
Numberof Conditions
So therefore, Number of Rules = 2
6
= 64
Whatarewegoingtoconsiderhere?
Amoredetailedviewofthethree
inequalitiesofthetriangleproperty.
Ifanyoneofthesefails,thethree
integersdonotconstitutesidesofatriangle.

TRIANGLE DECISION TABLE -REFINED
Number of Rules = 2
Numberof Conditions
So therefore, Number of Rules = 2
6
= 64
123 4567891011

TIPS TO REMEMBER THE TABLE

•Forlimitedentrydecisiontable:
–Ifnconditionsexist,theremustbe2
n
rules
–Whendon’tcareentriesreallyindicatethatthe
conditionisirrelevant,wecandeveloparulecountas
follows:
•Rulesinwhichdon’tcareentriesdonotoccurcountas
onerule
•Andeachdon’tcareentryinaruledoublesthecountof
thatrule
•Usefulness of rule count
–Lessrulesthancombinationrulecount,indicates
missingrules
–Morerulesthancombinationrulecount,indicates
redundantrulesorindicateinconsistenttable

DECISION TABLE WITH RULE COUNT
Whendon’tcareentriesreallyindicatethattheconditionis
irrelevant,wecandeveloparulecountasfollows:
Rulesinwhichdon’tcareentriesdonotoccur
countasonerule
Andeachdon’tcareentryinaruledoublesthe
countofthatrule
Ifnconditions
exist,theremust
be2
n
rules
Here,n=6
So,rules64
Wecanmakesurethat
thisisacomplete
decisiontableby
countingthetotal
number ofrules:
32+16+8+1+1+1+1+1+1+
1+1=64=2
6

TEST CASE FOR TRIANGLE PROBLEM

•Usingthedecisiontable,weobtain11
functionaltestcases:
–1waytogetascalenetriangle
–1waytogetanequilateraltriangle
–3impossiblecases
–3waystofailthetriangleproperty
–3waystogetanisoscelestriangle

TEST CASE FOR THE NEXTDATE FUNCTION
FIRST TRY
•Suppose we start with a set of equivalence
classes:

•IntheNextDateproblem,threeoftheconditionscanbethe
equivalenceclassesofthemonths
c
1
:M130Days a
1:Impossible
c
2
:M231Days a
2:NextDate
c
3
:M3Feb
•Sincetheequivalenceclassesaremutuallyexclusive,thena
monthcanonlyexistinonecondition,i.e.wecannothavea
ruleinwhichtwoofthesethreeconditionsaretrue
DECISION TABLE WITH MUTUALLY
EXCLUSIVE CONDITION
DON’TCAREENTRYMEANS,
MUSTBEFALSEINTHISCASE

RULE COUNT

HOW TO REMEMBER????
DON’TCAREENTRYMEANS,
MUSTBEFALSEINTHISCASE

REDUNDANT OR INCONSISTENT

SOLUTION????
EXTENDED ENTRY DECISION TABLE

SECOND TRY
To produce next date Actions
involved (manipulations) are:
1.Increment day
2.Reset day
3.Increment month
4.Reset month
5.Increment year
TOTAL
NUMBER OF
RULES:
3*4*3 = 36

M130 DAYS
M2 31 DAYS
M3 FEBRUARY (28/29)
D1 1-28
D2 29
D3 30
D4 31

SECOND TRY TABLE WITH 36 RULES
M130 DAYS
M2 31 DAYS
M3 FEBRUARY (28/29)
D1 1-28
D2 29
D3 30
D4 31

THIRD TRY

M130 DAYS
M2 31 DAYS EXCEPT
DECEMBER
M3 MONTH IS DECEMBER
M4 MONTH IS FEBRUARY
D1 1-27
D2 28
D3 29
D4 30
D5 31
Y1 LEAP YEAR
Y2 COMMON YEAR

M130 DAYS
M2 31 DAYS EXCEPT DECEMBER
M3 MONTH IS DECEMBER
M4 MONTH IS FEBRUARY
D1 1-27
D2 28
D3 29
D4 30
D5 31
Y1 LEAP YEAR
Y2 COMMON YEAR

TEST CASE FOR COMMISSION PROBLEM

APPLICATIONS WHERE DECISION TABLES
ARE USED
1.Where prominent if-then-else logic
2.Logical relationships among input variables
3.Calculations involving subsets of the input variables

ADVANTAGES OF DECISION TABLE
•Decisiontablesarepreciseandcompactwaytomodel
complicatedlogic
•Testingalsoworksiteratively.Thetablethatisdrawn
inthefirstiteration,actsasasteppingstonetoderive
newdecisiontables(s)
•Thesetablesguaranteethatweconsidereverypossible
combinationofconditionvalues.Thisisknownasits
“completenessproperty”
•Decisiontablesaredeclarative.Thereisnoparticular
orderforconditionsandactionstooccur

DISADVANTAGES OF DECISION TABLE
•Decisiontablesdonotscaleupwell.Weneed
to“factor”largetablesintosmalleronesto
removeredundancy

REFERENCE
•PaulC.Jorgensen:SoftwareTesting,A
Craftsman’sApproach,4thEdition,Auerbach
Publications,2013.

END
THANKS FOR VIEWING 