SlideShare a Scribd company logo
1 of 144
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
ā€¢ In a procedural programming language, a unit can be
ā€“ A single procedure
ā€“ A function
ā€“ A body of code that implements a single function
ā€“ Source code that fits on one page
ā€“ A body of code that represents work done in 4 to 40 hours
(as in a work breakdown structure)
ā€“ The smallest body of code that can be compiled and
executed by itself
ā€¢ In Object Oriented Programming, a unit can be
- Methods of a class might be limited by any of the
ā€œdefinitionsā€ of a unit
ā€¢ Bottom line is that ā€œunitā€ is probably best defined by
organizations implementing code
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
ā€¢ Boundary Value Analysis is a black box test
design technique where test case are designed by
using boundary values
ā€¢ Boundary value analysis (BVA) is based on
testing at the boundaries between partitions
ā€¢ Most errors occur at extremes (< instead of <=,
counter off by one)
ā€¢ Here we have both:
ā€“ valid boundaries (in the valid partitions) and
ā€“ invalid boundaries (in the invalid partitions)
ā€¢ BVA is used in range checking
ā€¢ Mainly useful for looping
ā€¢ When a function F is implemented as a
program, the input variables x1 and x2 will
have some boundaries:
a <= x1 <=b
c <= x2 <=d
where
- [a,b] and [c,d] are the intervals
BVA focuses on the boundary of the input
space to identify test cases
EXAMPLE 1 FOR BVA
ā€¢ Suppose you have to check the User Name and Password field that accepts
ā€“ minimum 8 characters and
ā€“ maximum 12 characters
ā€“ Valid range 8-12
ā€“ Invalid range 7 or less than 7
ā€“ Invalid range 13 or more than 13
ā€¢ Test Cases for Valid partition value, Invalid partition value and exact
boundary value
ā€¢ Test Cases 1: Consider password length less than 8.
ā€¢ Test Cases 2: Consider password of length exactly 8.
ā€¢ Test Cases 3: Consider password of length between 9 and 11.
ā€¢ Test Cases 4: Consider password of length exactly 12.
ā€¢ Test Cases 5: Consider password of length more than 12.
EXAMPLE 2 FOR BVA
ā€¢ Test cases for the application whose input box accepts numbers
between 1-1000
- Valid range 1-1000
- Invalid range 0 and
- Invalid range 1001 or more
ā€¢ Test Cases for Valid partition value, Invalid partition value and
exact boundary value.
ā€¢ Test Cases 1: Consider test data exactly as the input boundaries of
input domain i.e. values 1 and 1000
ā€¢ Test Cases 2: Consider test data with values just below the extreme
edges of input domains i.e. values 0 and 999
ā€¢ Test Cases 3: Consider test data with values just above the extreme
edges of input domain i.e. values 2 and 1001
ā€¢ SINGLE FAULT ASSUMPTION
Assumes the ā€˜single faultā€™ or ā€œindependence of
input variables.ā€
ā€“ Failures are rarely the result of the simultaneous
occurrence of two (or more) faults
ā€“ e.g. If there are 2 input variables, these input
variables are independent of each other.
ā€¢ MULTIPLE FAULT ASSUMPTION
ā€œdependence among the inputsā€
VARIANTS OF BVA
ā€¢ Four variations of boundary value testing:
ā€“Normal boundary value testing
ā€“Robust boundary value testing
ā€“ Worst-case boundary value testing
ā€“ Robust worst-case boundary value testing
NORMAL BOUNDARY VALUE
TESTING
ā€¢ Basic idea of BVA is to use input variable values
at their: blue shaded region ā€“ input domain
space
- Minimum (min)
- Above Minimum (min+)
- Nominal Value (nom) (Average Value)
- Below Maximum (max-)
- Maximum (max)
VALUE SELECTION IN BVA
a <= x1 <=b
c <= x2 <=d
X1, X2ļƒ  Variables
Dots ļƒ  Represents a test value at
which the program is to be tested
INPUT BOUNDARY VALUE TEST CASES
(2 VARIABLES)
TEST CASES (BY NUMBER OF VARIABLES)
ā€¢ <X1nom, X2min>, <10,25>
ā€¢ <X1nom, X2min+>, <10,26>
ā€¢ <X1nom, X2nom>, <10,30>
ā€¢ <X1nom, X2max>, <10,35>
ā€¢ <X1nom, X2max->, <10,34>
ā€¢ <X1min, X2nom>, <5,30>
ā€¢ <X1min+, X2nom>, <6,30>
ā€¢ <X1nom, X2nom>, <10,30>
ā€¢ <X1max, X2nom>, <15,30>
ā€¢ <X1max+, X2nom>, <14,30>
INPUTS
5<=X1<=15
25<=X2<=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
ā€¢ Robustness can also be defined as the ability of an algorithm to
continue operating despite abnormalities in input, calculations, etc.
ā€¢ Robustness testing is a simple extension of boundary value analysis
ā€¢ In addition to the 5 BVA values of variables includes, add values slightly
greater than the maximum (max+) and a value slightly less than the
minimum (min-)
ā€“ Min ā€“ 1
ā€“ Min
ā€“ Min +1
ā€“ Nom
ā€“ Max -1
ā€“ Max
ā€“ Max +1
ā€¢ Main value of robustness testing is to force attention on exception
handling
ā€¢ In some strongly typed languages values beyond the predefined range will
cause a run-time error
Number of TC = 6n+1
6 ļƒ  Values
n ļƒ  Number of Variables
1ļƒ  Nom (Average Value)
ROBUSTNESS TEST CASES FOR A FUNCTION
OF TWO VARIABLES
Dots that are outside the range
[a, b] of variable x1.
Similarly, for variable x2, we have
crossed its legitimate boundary of
[c, d] of variable x2.
WORST ā€“ CASE TESTING
Min
Min+
Nom
Max-
Max
Min
Min+
Nom
Max-
Max
ROBUST WORST-CASE TEST CASE
Involves 7n test cases
SPECIAL VALUE TESTING
ā€¢ Most widely practiced form of functional testing
ā€¢ Tester uses (to devise test cases):
ā€“ his/her domain knowledge,
ā€“ experience with similar programs, and
ā€“ information about ā€œsoft spotsā€
ā€¢ Dependent on the abilities of the tester!!!
ā€¢ Test cases involving Feb 28, 29 and leap years are most
likely to be identified as test cases using special value
testing
ā€¢ Robustness testing and worst case testing do not
identify Feb 28 as a test case
ā€¢ Also known as Ad-hoc Testing
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
ā€¢ Basic idea is that, rather than always choose the
min, min+, nom, max-, and max values of a
bounded variable, use a random number
generator to pick test case values
ā€¢ In Visual Basic application, to pick values for a
bounded variable a<=x<=b, uses
x=Int((b-a+1)*Rnd+a)
where,
Int ļƒ  Returns the integer part of floating
point number
Rnd ļƒ  Function generates random numbers
in the interval [0,1]
HOW MANY TEST CASES DO WE MAKE?
ā€¢ Related to the probability of producing every
outcome at least once
ā€¢ Related to the probability of executing every
statement / path at least once
EQUIVALENCE CLASS TESTING
ā€¢ Boundary Value Testing derives test cases with
Serious gaps
Massive redundancy
ā€¢ Motivations for equivalence class testing are
Complete testing
Avoid redundancy
CONS OF BVA
ā€¢ Black Box Technique
ā€¢ Utilizes a subset of data which is representative of a larger
class
ā€¢ Equivalence partitioning involves partitioning of the input
domain of a software system into several equivalent classes
in a manner that the testing of one particular representative
from a class is equivalent to the testing of some different value
from the subject class
ā€¢ Applicability
ā€“ Program is a function from input to output
ā€“ Input and/or output variables have well defined intervals
AIRLINE RESERVATION SYSTEM
Any number
above or
below 1 and
10 is invalid
1...10 are
valid
ā€¢ Here is the test condition
ā€¢ Number > 10 entered in the reservation column (let say 11) is considered
invalid
ā€¢ Number < 1 that is 0 or below, then it is considered invalid
ā€¢ Numbers 1 to 10 are considered valid
ā€¢ Any 3 Digit Number say -100 is invalid
ā€¢ We cannot test all the possible values because if done, number of test cases
will be more than 100
ā€¢ To address this problem, we use equivalence partitioning hypothesis where
we divide the possible values of tickets into groups or sets as shown below
where the system behavior can be considered the same
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 is that 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
ā€¢ Consider a numerical input variable, i, whose values
may range from -200 through +200. Then a possible
partitioning of testing input variable, i, by 4
partitions may be:
ā€“ -200 to -100
ā€“ -101 to 0
ā€“ 1 to 100
ā€“ 101 to 200
ā€¢ Define ā€œsame signā€ as the equivalence relation, R,
defined over the input variableā€™s value set, i = {-200 -
-,0, - -, +200}. Then one partitioning will be:
ā€“ -200 to -1 (negative sign)
ā€“ 0 (no sign)
ā€“ 1 to 200 (positive sign)
DIFFERENCE BETWEEN BVAAND
EQUIVALENCE PARTITIONING
TRADITIONAL EQUIVALENCE CLASS TESTING
ā€¢ Nearly identical to Weak
Robust Equivalence
Class Testing
ā€¢ Focuses on Invalid data
values
ā€¢ The idea of equivalence class testing is to identify test cases by
using one element from each equivalence class
ā€¢ If the equivalence classes are chosen wisely, the potential
redundancy among test cases can be reduced
ā€¢ [ ļƒ  Closed Interval ļƒ  Includes end-points
ā€¢ ) ļƒ  Open Interval ļƒ  Does not include end-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) Weak Normal Equivalence Class Testing
2) Strong Normal Equivalence Class Testing
3) Weak Robust Equivalence Class Testing
4) Strong Robust Equivalence Class Testing
WEAK NORMAL EQUIVALENCE CLASS
TESTING
ā€¢ Weak ļƒ  Single Fault Assumption (One
from each class)
ā€¢ Normal ļƒ  Classes of Valid Values of Input
(Identify Classes)
ā€¢ Choose the test case from each of the
equivalence classes for each input variable
independently of the other input variable
ā€¢ Test cases have all valid values
ā€¢ Detects faults due to calculations with valid
values of single variable
DOT ļƒ  Indicates a Valid
Value (Test Data)
Valid value one from each
class
Example
Assume the equivalence partitioning of input X2 is: 1 to 10; 11 to 20, 21 to 30
and the equivalence partitioning of input X1 is: 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
We have covered everyone of
the 3 equivalence classes for
input X.
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 ļƒ  Multiple Fault Assumption (One
from each class in Cartesian
Product)
ā€¢ Normal ļƒ  Identify equivalence classes of Valid
Inputs
ā€¢ Test cases from Cartesian Product of valid
values
ā€¢ Cartesian Product guarantees notion of
completeness
ā€¢ Detects faults due to interaction with valid values
of any number of variables
Dots ļƒ  Valid
values but with all
possibilities
COVERS ONE
POSSIBLE
COMBINATION
FROM EACH
PARTITION
Example of : Strong Normal Equivalence testing
Assume the equivalence partitioning of input X2 is: 1 to 10; 11 to 2; 21 to 30
and the equivalence partitioning of input X1 is: 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
We have covered everyone of
the 3 x 4 Cartesian product of
equivalence classes
PROBLEM: Doesnā€™t test values outside of intervals
WEAK ROBUST EQUIVALENCE CLASS
TESTING
ā€¢ Weak ļƒ  Single Fault Assumption (One from each
class)
ā€¢ Robust ļƒ  Classes of valid and invalid values of
input
ā€¢ Up to now we have only considered partitioning the
valid input space
ā€¢ ā€œWeak robustā€ is similar to ā€œweak normalā€
equivalence test except that the invalid input variables
are now considered
Example of : Weak Robust Equivalence testing
Assume the equivalence partitioning of input X2 is 1 to 10; 11 to 20, 21 to 30
and the equivalence partitioning of input X1 is 1 to 5; 6 to 10; 11 to 15; and 16 to 20
X2
X11
10
20
30
1 5 10 15 20
We have covered
everyone of the 5
equivalence classes for
input X.
PROBLEM: Misses some equivalence classes
PROBLEMS WITH ROBUST EQUIVALENCE TESTING
a) Very often the specification does not define
what the expected output for an invalid test
case should be
b) Thus, testers spend a lot of time defining
expected outputs for these cases
c) Strongly typed languages like Pascal, Ada,
eliminate the need for the consideration of
invalid inputs
STRONG ROBUST EQUIVALENCE CLASS TESTING
ā€¢ Strong ļƒ  Multiple Fault Assumption (One
from each class in Cartesian
Product)
ā€¢ Robust ļƒ Classes of valid and invalid values
of input
ā€¢ Obtain the test cases from each element of the
Cartesian product of all the equivalence
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
We have covered everyone of
the 5 x 6 Cartesian product of
equivalence classes (including
invalid inputs)
Problem: None, but results in lots of test cases (expensive)
SAMPLE QUESTIONS
EQUIVALENCE CLASS TEST
CASES FOR THE TRIANGLE
PROBLEM
ā€¢ Four possible outputs:
ā€“ NotATriangle
ā€“ Scalene Triangle
ā€“ Isosceles Triangle
ā€“ Equilateral Triangle
ā€¢ Output (range) equivalence classes:
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
ā€¢ Because no valid subintervals of variables a,
b, and c exist, the strong normal equivalence
class test cases are identical to the weak
normal equivalence class test cases.
WEAK ROBUST TEST CASES
The invalid
values could be
- Zero (0)
- Any Negative
Number (-ve)
- Any number
>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
For example, triplet <1,4,1> has exactly one pair of
equal sides, but those sides do not form a triangle
If we want to be even more thorough, we could
separate the ā€œgreater than or equal toā€ to two
distinct cases as:
D6 will become:
D6ā€™={<a,b,c>:a=b+c}
D6ā€={<a,b,c>:a>b+c}
Similarly, for D7 and D8
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=M1UM2UM3
ā€“ 30 days months (M1)
ā€“ 31 days months (M2)
ā€“ February (M3)
ā€¢ Equivalence Classes for Years Y=Y1UY2UY3UY4
ā€“ Non-Century Common Years (Y1)
ā€“ Non-Century Leap Years (Y2)
ā€“ Common Century Years (Y3)
ā€“ Leap Century Years (Y4)
ā€¢ Equivalence Classes for Days D= D1UD2UD3ā€¦
ā€“D1=1ā€¦?
ā€“D2=?
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)
NUMBER OF TEST CASES = #classes in the
partition with the largest numbering of
subsets.
WEAK NORMAL EQUIVALENCE CLASS
NUMBER OF TEST CASES:
Based on Cartesian
product of the partition
subsets
3 MONTH CLASSES
4 DAY CLASSES
3 YEAR CLASSES
3*4*3=36
EQUIVALENCE CLASS TEST CASE FOR
COMMISSION PROBLEM
ā€¢ The input domain of the commission problem is
partitioned by the limits on:
ā€“ Locks
ā€“ Stocks
ā€“ Barrels
ā€¢ The first class is the valid input and other two are
invalid
ā€¢ When a value of -1 is given for locks, the while
loop terminates, and the values of totalLocks,
totalStocks, and totalBarrels are computed to
compute sales and then commission
End Commission
INPUT CLASSES
WEAK NORMALAND STRONG
NORMAL EQUIVALENCE CLASS
We will have exactly one weak normal
equivalence class test case and its identical to
the strong normal equivalence class test case
WEAK ROBUST TEST CASE
STRONG ROBUST EQUIVALENCE CLASS
TEST CASES
OUTPUT RANGE EQUIVALENCE CLASS TEST
ā€¢ Equivalence partitions are designed so that
every possible input belongs to one and only
one equivalence partition
ā€¢ It is appropriate when input data is defined in
terms of intervals
ā€¢ Equivalence class testing is strengthened by a
hybrid approach with boundary value testing
ADVANTAGES OF EQUIVALENCE PARTITIONING
ECT BVA
DISADVANTAGES
ā€¢ No guide lines for choosing inputs
ā€¢ Doesnā€™t test every input
ā€¢ Several tries may be needed before the right
equivalence relation is discovered
EDGE TESTING
ā€¢ Edge Testing ļƒ  Hybrid of boundary
value analysis and equivalence class
testing
ā€¢ Need for Edge Testing?
ā€“contiguous ranges of a particular
variable constitute equivalence classes
ā€¢ Normal test values for x1: {a, a+, bā€“, b, b+, cā€“, c, c+, dā€“, d}
ā€¢ Robust test values for x1: {aā€“, a, a+, bā€“, b, b+, cā€“, c, c+, dā€“, d, d+}
ā€¢ Normal test values for x2: {e, e+, fā€“, f, f+, gā€“, g}
ā€¢ Robust test values for x2: {eā€“, e, e+, fā€“, f, f+, gā€“, g, g+}
ā€¢ NOTE: One subtle difference is that edge test values do not include
the nominal values that we had with boundary value testing.
DECISION TABLE ā€“ BASED TESTING
DECISION-TABLE BASED TESTING
DECISION TABLE TERMINOLOGIES
CONDITION
STUB
ACTION
STUB
CONDITION ENTRIES
ACTION ENTRIES
ā€¢ A decision condition is constructed with a condition
stub and a condition entry
ā€¢ Condition Stub
ā€“ is declared as a statement of a condition
ā€¢ Condition Entry
ā€“ provides a value assigned to the condition stub
ā€¢ Similarly, an action (or decision) composes two elements:
an action stub and an action entry
ā€¢ Action Stub
ā€“ One states an action with an action stub
ā€¢ Action Entry
ā€“ specifies whether (or in what order) the action is to be performed
STRUCTURE OF DECISION TABLE
ā€¢ A column in the entry portion is known as a
rule
ā€¢ Rules indicate which actions are taken for the
conditional circumstances indicated in the
condition portion of the rule
ā€¢ Decision table is used for ā€œtest case
identificationā€
ā€¢ Decision tables are declarative that conditions
and actions follows no particular order
TYPES OF DECISION TABLES
ā€¢ Limited Entry Decision Table
ā€“ Decision tables in which all conditions are binary
are known as ā€œLimited entry decision tablesā€
ā€¢ Extended Entry Decision Table
ā€“ If conditions are allowed to have several values,
the resulting tables are known as ā€œExtended entry
decision tablesā€
DECISION TABLE INTERPRETATION
ā€¢ How are condition entries in a decision table interpreted with respect
to a program?
Conditions are interpreted as:
Input
Equivalence classes of inputs
ā€¢ How are action entries in a decision table interpreted with respect to a
program?
Actions are interpreted as:
Output
Major functional processing portions
ā€¢ What is the relationship between decision tables and test cases?
ā€“ Rules are interpreted as test cases
ā€“ With a complete decision table, have a complete set of test cases
ā€¢ Donā€™t Care Entries
ā€“ Donā€™t care entries indicates, that the
condition is irrelevant or condition does
not apply
ā€“Helps in giving a complete decision table
ā€“Represented by using the symbol ā€˜__ā€™
ā€¢ Use of donā€™t care entries
ā€“ Reduce the number of explicit rules by implying
the existence on non-explicitly stated rules
ā€¢ In Limited Entry Decision Table:
ENTRIES NOTATION USED
CONDITION ENTRIES T (TRUE), F (FALSE)
ACTION ENTRIES X
DONā€™T CARE ENTRIES __
TRIANGLE DECISION TABLE
A5ļƒ  Action added by tester, showing rule impossible
Action impossible shows when a rule is logically impossible
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
1 2 3 4 5 6 7 8 9
TIPS TO REMEMBER THE TABLE
TRIANGLE DECISION TABLE - REFINED
Number of Rules = 2Number of Conditions
So therefore, Number of Rules = 26 = 64
What are we going to consider here?
A more detailed view of the three
inequalities of the triangle property.
If any one of these fails, the three
integers do not constitute sides of a triangle.
TRIANGLE DECISION TABLE - REFINED
Number of Rules = 2Number of Conditions
So therefore, Number of Rules = 26 = 64
1 2 3 4 5 6 7 8 9 10 11
TIPS TO REMEMBER THE TABLE
ā€¢ For limited entry decision table:
ā€“ If n conditions exist, there must be 2n rules
ā€“ When donā€™t care entries really indicate that the
condition is irrelevant, we can develop a rule count as
follows:
ā€¢ Rules in which donā€™t care entries do not occur count as
one rule
ā€¢ And each donā€™t care entry in a rule doubles the count of
that rule
ā€¢ Usefulness of rule count
ā€“ Less rules than combination rule count, indicates
missing rules
ā€“ More rules than combination rule count, indicates
redundant rules or indicate inconsistent table
DECISION TABLE WITH RULE COUNT
When donā€™t care entries really indicate that the condition is
irrelevant, we can develop a rule count as follows:
Rules in which donā€™t care entries do not occur
count as one rule
And each donā€™t care entry in a rule doubles the
count of that rule
If n conditions
exist, there must
be 2n rules
Here, n=6
So, rules 64
We can make sure that
this is a complete
decision table by
counting the total
number of rules:
32+16+8+1+1+1+1+1+1+
1+1= 64 = 26
TEST CASE FOR TRIANGLE PROBLEM
ā€¢ Using the decision table, we obtain 11
functional test cases:
ā€“ 1 way to get a scalene triangle
ā€“ 1 way to get an equilateral triangle
ā€“ 3 impossible cases
ā€“ 3 ways to fail the triangle property
ā€“ 3 ways to get an isosceles triangle
TEST CASE FOR THE NEXTDATE FUNCTION
FIRST TRY
ā€¢ Suppose we start with a set of equivalence
classes:
ā€¢ In the NextDate problem, three of the conditions can be the
equivalence classes of the months
c1 : M1 ļƒ  30 Days a1 : Impossible
c2 : M2 ļƒ  31 Days a2 : Next Date
c3 : M3 ļƒ  Feb
ā€¢ Since the equivalence classes are mutually exclusive, then a
month can only exist in one condition, i.e. we cannot have a
rule in which two of these three conditions are true
DECISION TABLE WITH MUTUALLY
EXCLUSIVE CONDITION
DONā€™T CARE ENTRY MEANS,
MUST BE FALSE IN THIS CASE
RULE COUNT
HOW TO REMEMBER????
DONā€™T CARE ENTRY MEANS,
MUST BE FALSE IN THIS CASE
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
ā€¢ Decision tables are precise and compact way to model
complicated logic
ā€¢ Testing also works iteratively. The table that is drawn
in the first iteration, acts as a stepping stone to derive
new decision tables (s)
ā€¢ These tables guarantee that we consider every possible
combination of condition values. This is known as its
ā€œcompleteness propertyā€
ā€¢ Decision tables are declarative. There is no particular
order for conditions and actions to occur
DISADVANTAGES OF DECISION TABLE
ā€¢ Decision tables do not scale up well. We need
to ā€œfactorā€ large tables into smaller ones to
remove redundancy
REFERENCE
ā€¢ Paul C. Jorgensen: Software Testing, A
Craftsmanā€™s Approach, 4th Edition, Auerbach
Publications, 2013.
END
THANKS FOR VIEWING ļŠ

More Related Content

What's hot

Software Engineering (Testing techniques)
Software Engineering (Testing techniques)Software Engineering (Testing techniques)
Software Engineering (Testing techniques)ShudipPal
Ā 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box TestingTestbytes
Ā 
Software Requirements in Software Engineering SE5
Software Requirements in Software Engineering SE5Software Requirements in Software Engineering SE5
Software Requirements in Software Engineering SE5koolkampus
Ā 
Whitebox testing
Whitebox testingWhitebox testing
Whitebox testingOana Feidi
Ā 
Software Testing
Software TestingSoftware Testing
Software TestingMousmi Pawar
Ā 
White Box Testing
White Box TestingWhite Box Testing
White Box TestingAlisha Roy
Ā 
EquivalencePartition
EquivalencePartitionEquivalencePartition
EquivalencePartitionswornim nepal
Ā 
Unit testing
Unit testing Unit testing
Unit testing Mani Kanth
Ā 
Introduction to White box testing
Introduction to White box testingIntroduction to White box testing
Introduction to White box testingAliaa Monier Ismaail
Ā 
Software testing - EXAMPLE
Software testing  - EXAMPLESoftware testing  - EXAMPLE
Software testing - EXAMPLEpriyasoundar
Ā 
Integration testing
Integration testingIntegration testing
Integration testingqueen jemila
Ā 
Equivalence class testing
Equivalence  class testingEquivalence  class testing
Equivalence class testingMani Kanth
Ā 
Decision Table Based Testing
Decision Table Based TestingDecision Table Based Testing
Decision Table Based TestingHimani Solanki
Ā 
boundary value analysis and equivalence partition
boundary value analysis and equivalence partitionboundary value analysis and equivalence partition
boundary value analysis and equivalence partitionSimran Bhatia
Ā 
Test case techniques
Test case techniquesTest case techniques
Test case techniquesPina Parmar
Ā 

What's hot (20)

Black & White Box testing
Black & White Box testingBlack & White Box testing
Black & White Box testing
Ā 
Software Engineering (Testing techniques)
Software Engineering (Testing techniques)Software Engineering (Testing techniques)
Software Engineering (Testing techniques)
Ā 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box Testing
Ā 
Software Requirements in Software Engineering SE5
Software Requirements in Software Engineering SE5Software Requirements in Software Engineering SE5
Software Requirements in Software Engineering SE5
Ā 
Whitebox testing
Whitebox testingWhitebox testing
Whitebox testing
Ā 
Software Testing
Software TestingSoftware Testing
Software Testing
Ā 
White Box Testing
White Box TestingWhite Box Testing
White Box Testing
Ā 
EquivalencePartition
EquivalencePartitionEquivalencePartition
EquivalencePartition
Ā 
Unit testing
Unit testing Unit testing
Unit testing
Ā 
Introduction to White box testing
Introduction to White box testingIntroduction to White box testing
Introduction to White box testing
Ā 
Software testing - EXAMPLE
Software testing  - EXAMPLESoftware testing  - EXAMPLE
Software testing - EXAMPLE
Ā 
Integration testing
Integration testingIntegration testing
Integration testing
Ā 
Software testing ppt
Software testing pptSoftware testing ppt
Software testing ppt
Ā 
Equivalence class testing
Equivalence  class testingEquivalence  class testing
Equivalence class testing
Ā 
Decision Table Based Testing
Decision Table Based TestingDecision Table Based Testing
Decision Table Based Testing
Ā 
boundary value analysis and equivalence partition
boundary value analysis and equivalence partitionboundary value analysis and equivalence partition
boundary value analysis and equivalence partition
Ā 
Testing
TestingTesting
Testing
Ā 
Test case techniques
Test case techniquesTest case techniques
Test case techniques
Ā 
Software testing
Software testingSoftware testing
Software testing
Ā 
Test planning
Test planningTest planning
Test planning
Ā 

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

Black boxtesting
Black boxtestingBlack boxtesting
Black boxtestingfuntest06
Ā 
Software Testing - Test Design Techniques
Software Testing - Test Design TechniquesSoftware Testing - Test Design Techniques
Software Testing - Test Design TechniquesRegina Vitalicio
Ā 
Boundary Value Analysis & Equivalence Partitioning with Examples (1) (2).pptx
Boundary Value Analysis & Equivalence Partitioning with Examples (1) (2).pptxBoundary Value Analysis & Equivalence Partitioning with Examples (1) (2).pptx
Boundary Value Analysis & Equivalence Partitioning with Examples (1) (2).pptxANSHIKANIGAMRA201103
Ā 
Testing foundations
Testing foundationsTesting foundations
Testing foundationsNeha Singh
Ā 
AutoTest.ppt
AutoTest.pptAutoTest.ppt
AutoTest.pptCHANDUKAYALA
Ā 
AutoTest.ppt
AutoTest.pptAutoTest.ppt
AutoTest.pptRohit846825
Ā 
Boundary Value Analysis and Equivalence class Partitioning Testing.pptx
Boundary Value Analysis and Equivalence class Partitioning Testing.pptxBoundary Value Analysis and Equivalence class Partitioning Testing.pptx
Boundary Value Analysis and Equivalence class Partitioning Testing.pptxlandesc
Ā 
Testing part 2 bb
Testing part 2 bbTesting part 2 bb
Testing part 2 bbRavi Prakash
Ā 
Software Testing Introduction (Part 2)
Software Testing Introduction (Part 2)Software Testing Introduction (Part 2)
Software Testing Introduction (Part 2)Thapar Institute
Ā 
Dynamic Testing
Dynamic TestingDynamic Testing
Dynamic TestingJimi Patel
Ā 
Equivalence-Partition-Testing-Notes-17122022-083818pm.pptx
Equivalence-Partition-Testing-Notes-17122022-083818pm.pptxEquivalence-Partition-Testing-Notes-17122022-083818pm.pptx
Equivalence-Partition-Testing-Notes-17122022-083818pm.pptxKhayal Abbas Akhtar
Ā 
black-box-1.pdf
black-box-1.pdfblack-box-1.pdf
black-box-1.pdfSupunLakshan4
Ā 
Black Box Testing.pdf
Black Box Testing.pdfBlack Box Testing.pdf
Black Box Testing.pdfSupunLakshan4
Ā 
Fundamentals of Software Engineering
Fundamentals of Software Engineering Fundamentals of Software Engineering
Fundamentals of Software Engineering Madhar Khan Pathan
Ā 
Test design techniques
Test design techniquesTest design techniques
Test design techniquesManindra Simhadri
Ā 
Software Testing Foundations Part 4 - Black Box Testing
Software Testing Foundations Part 4 - Black Box TestingSoftware Testing Foundations Part 4 - Black Box Testing
Software Testing Foundations Part 4 - Black Box TestingNikita Knysh
Ā 

Similar to Software Testing - Boundary Value Analysis, Equivalent Class Partition, Decision Table (20)

Black boxtesting
Black boxtestingBlack boxtesting
Black boxtesting
Ā 
Unit testing
Unit testingUnit testing
Unit testing
Ā 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box Testing
Ā 
st_unit_2.ppt
st_unit_2.pptst_unit_2.ppt
st_unit_2.ppt
Ā 
Software Testing - Test Design Techniques
Software Testing - Test Design TechniquesSoftware Testing - Test Design Techniques
Software Testing - Test Design Techniques
Ā 
Boundary Value Analysis & Equivalence Partitioning with Examples (1) (2).pptx
Boundary Value Analysis & Equivalence Partitioning with Examples (1) (2).pptxBoundary Value Analysis & Equivalence Partitioning with Examples (1) (2).pptx
Boundary Value Analysis & Equivalence Partitioning with Examples (1) (2).pptx
Ā 
Testing foundations
Testing foundationsTesting foundations
Testing foundations
Ā 
AutoTest.ppt
AutoTest.pptAutoTest.ppt
AutoTest.ppt
Ā 
AutoTest.ppt
AutoTest.pptAutoTest.ppt
AutoTest.ppt
Ā 
AutoTest.ppt
AutoTest.pptAutoTest.ppt
AutoTest.ppt
Ā 
Boundary Value Analysis and Equivalence class Partitioning Testing.pptx
Boundary Value Analysis and Equivalence class Partitioning Testing.pptxBoundary Value Analysis and Equivalence class Partitioning Testing.pptx
Boundary Value Analysis and Equivalence class Partitioning Testing.pptx
Ā 
Testing part 2 bb
Testing part 2 bbTesting part 2 bb
Testing part 2 bb
Ā 
Software Testing Introduction (Part 2)
Software Testing Introduction (Part 2)Software Testing Introduction (Part 2)
Software Testing Introduction (Part 2)
Ā 
Dynamic Testing
Dynamic TestingDynamic Testing
Dynamic Testing
Ā 
Equivalence-Partition-Testing-Notes-17122022-083818pm.pptx
Equivalence-Partition-Testing-Notes-17122022-083818pm.pptxEquivalence-Partition-Testing-Notes-17122022-083818pm.pptx
Equivalence-Partition-Testing-Notes-17122022-083818pm.pptx
Ā 
black-box-1.pdf
black-box-1.pdfblack-box-1.pdf
black-box-1.pdf
Ā 
Black Box Testing.pdf
Black Box Testing.pdfBlack Box Testing.pdf
Black Box Testing.pdf
Ā 
Fundamentals of Software Engineering
Fundamentals of Software Engineering Fundamentals of Software Engineering
Fundamentals of Software Engineering
Ā 
Test design techniques
Test design techniquesTest design techniques
Test design techniques
Ā 
Software Testing Foundations Part 4 - Black Box Testing
Software Testing Foundations Part 4 - Black Box TestingSoftware Testing Foundations Part 4 - Black Box Testing
Software Testing Foundations Part 4 - Black Box Testing
Ā 

Recently uploaded

How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
Ā 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
Ā 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
Ā 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
Ā 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
Ā 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
Ā 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
Ā 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
Ā 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
Ā 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
Ā 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
Ā 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
Ā 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
Ā 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
Ā 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
Ā 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
Ā 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
Ā 

Recently uploaded (20)

How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
Ā 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
Ā 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
Ā 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
Ā 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
Ā 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
Ā 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
Ā 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
Ā 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
Ā 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Ā 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
Ā 
Model Call Girl in Tilak Nagar Delhi reach out to us at šŸ”9953056974šŸ”
Model Call Girl in Tilak Nagar Delhi reach out to us at šŸ”9953056974šŸ”Model Call Girl in Tilak Nagar Delhi reach out to us at šŸ”9953056974šŸ”
Model Call Girl in Tilak Nagar Delhi reach out to us at šŸ”9953056974šŸ”
Ā 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Ā 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
Ā 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
Ā 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Ā 
CĆ³digo Creativo y Arte de Software | Unidad 1
CĆ³digo Creativo y Arte de Software | Unidad 1CĆ³digo Creativo y Arte de Software | Unidad 1
CĆ³digo Creativo y Arte de Software | Unidad 1
Ā 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
Ā 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
Ā 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
Ā 

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

  • 1. 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
  • 2. BLACK BOX TESTING BOUNDARY VALUE TESTING EQUIVALENCE CLASS TESTING DECISION ā€“ TABLE BASED TESTING
  • 4. UNIT TESTING ā€¢ In a procedural programming language, a unit can be ā€“ A single procedure ā€“ A function ā€“ A body of code that implements a single function ā€“ Source code that fits on one page ā€“ A body of code that represents work done in 4 to 40 hours (as in a work breakdown structure) ā€“ The smallest body of code that can be compiled and executed by itself ā€¢ In Object Oriented Programming, a unit can be - Methods of a class might be limited by any of the ā€œdefinitionsā€ of a unit ā€¢ Bottom line is that ā€œunitā€ is probably best defined by organizations implementing code
  • 5. Black Box Test Design Techniques Types of Black Box Testing Techniques 1) Boundary Value Analysis 2) Equivalence Classes Partitioning 3) Decision Table Testing
  • 7. BOUNDARY VALUE ANALYSIS (BVA) Definition ā€¢ Boundary Value Analysis is a black box test design technique where test case are designed by using boundary values ā€¢ Boundary value analysis (BVA) is based on testing at the boundaries between partitions ā€¢ Most errors occur at extremes (< instead of <=, counter off by one)
  • 8. ā€¢ Here we have both: ā€“ valid boundaries (in the valid partitions) and ā€“ invalid boundaries (in the invalid partitions) ā€¢ BVA is used in range checking ā€¢ Mainly useful for looping
  • 9. ā€¢ When a function F is implemented as a program, the input variables x1 and x2 will have some boundaries: a <= x1 <=b c <= x2 <=d where - [a,b] and [c,d] are the intervals BVA focuses on the boundary of the input space to identify test cases
  • 10. EXAMPLE 1 FOR BVA ā€¢ Suppose you have to check the User Name and Password field that accepts ā€“ minimum 8 characters and ā€“ maximum 12 characters ā€“ Valid range 8-12 ā€“ Invalid range 7 or less than 7 ā€“ Invalid range 13 or more than 13 ā€¢ Test Cases for Valid partition value, Invalid partition value and exact boundary value ā€¢ Test Cases 1: Consider password length less than 8. ā€¢ Test Cases 2: Consider password of length exactly 8. ā€¢ Test Cases 3: Consider password of length between 9 and 11. ā€¢ Test Cases 4: Consider password of length exactly 12. ā€¢ Test Cases 5: Consider password of length more than 12.
  • 11. EXAMPLE 2 FOR BVA ā€¢ Test cases for the application whose input box accepts numbers between 1-1000 - Valid range 1-1000 - Invalid range 0 and - Invalid range 1001 or more ā€¢ Test Cases for Valid partition value, Invalid partition value and exact boundary value. ā€¢ Test Cases 1: Consider test data exactly as the input boundaries of input domain i.e. values 1 and 1000 ā€¢ Test Cases 2: Consider test data with values just below the extreme edges of input domains i.e. values 0 and 999 ā€¢ Test Cases 3: Consider test data with values just above the extreme edges of input domain i.e. values 2 and 1001
  • 12. ā€¢ SINGLE FAULT ASSUMPTION Assumes the ā€˜single faultā€™ or ā€œindependence of input variables.ā€ ā€“ Failures are rarely the result of the simultaneous occurrence of two (or more) faults ā€“ e.g. If there are 2 input variables, these input variables are independent of each other. ā€¢ MULTIPLE FAULT ASSUMPTION ā€œdependence among the inputsā€
  • 13. VARIANTS OF BVA ā€¢ Four variations of boundary value testing: ā€“Normal boundary value testing ā€“Robust boundary value testing ā€“ Worst-case boundary value testing ā€“ Robust worst-case boundary value testing
  • 15. ā€¢ Basic idea of BVA is to use input variable values at their: blue shaded region ā€“ input domain space - Minimum (min) - Above Minimum (min+) - Nominal Value (nom) (Average Value) - Below Maximum (max-) - Maximum (max) VALUE SELECTION IN BVA a <= x1 <=b c <= x2 <=d
  • 16. X1, X2ļƒ  Variables Dots ļƒ  Represents a test value at which the program is to be tested INPUT BOUNDARY VALUE TEST CASES (2 VARIABLES)
  • 17. TEST CASES (BY NUMBER OF VARIABLES) ā€¢ <X1nom, X2min>, <10,25> ā€¢ <X1nom, X2min+>, <10,26> ā€¢ <X1nom, X2nom>, <10,30> ā€¢ <X1nom, X2max>, <10,35> ā€¢ <X1nom, X2max->, <10,34> ā€¢ <X1min, X2nom>, <5,30> ā€¢ <X1min+, X2nom>, <6,30> ā€¢ <X1nom, X2nom>, <10,30> ā€¢ <X1max, X2nom>, <15,30> ā€¢ <X1max+, X2nom>, <14,30> INPUTS 5<=X1<=15 25<=X2<=35
  • 18. 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)
  • 19. 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
  • 20. TEST CASE FOR NEXT DATE FUNCTION Min Min+ Nom Max- Max
  • 22. ROBUSTNESS TESTING ā€¢ Robustness can also be defined as the ability of an algorithm to continue operating despite abnormalities in input, calculations, etc. ā€¢ Robustness testing is a simple extension of boundary value analysis ā€¢ In addition to the 5 BVA values of variables includes, add values slightly greater than the maximum (max+) and a value slightly less than the minimum (min-) ā€“ Min ā€“ 1 ā€“ Min ā€“ Min +1 ā€“ Nom ā€“ Max -1 ā€“ Max ā€“ Max +1 ā€¢ Main value of robustness testing is to force attention on exception handling ā€¢ In some strongly typed languages values beyond the predefined range will cause a run-time error Number of TC = 6n+1 6 ļƒ  Values n ļƒ  Number of Variables 1ļƒ  Nom (Average Value)
  • 23. ROBUSTNESS TEST CASES FOR A FUNCTION OF TWO VARIABLES Dots that are outside the range [a, b] of variable x1. Similarly, for variable x2, we have crossed its legitimate boundary of [c, d] of variable x2.
  • 24. WORST ā€“ CASE TESTING
  • 25.
  • 28. ROBUST WORST-CASE TEST CASE Involves 7n test cases
  • 29. SPECIAL VALUE TESTING ā€¢ Most widely practiced form of functional testing ā€¢ Tester uses (to devise test cases): ā€“ his/her domain knowledge, ā€“ experience with similar programs, and ā€“ information about ā€œsoft spotsā€ ā€¢ Dependent on the abilities of the tester!!! ā€¢ Test cases involving Feb 28, 29 and leap years are most likely to be identified as test cases using special value testing ā€¢ Robustness testing and worst case testing do not identify Feb 28 as a test case ā€¢ Also known as Ad-hoc Testing
  • 30. TEST CASE FOR COMMISSION PROBLEM
  • 31. EXAMPLE TEST CASE USING OUTPUT RANGE VALUE
  • 32. 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
  • 33. TEST CASE 9 IS THE $1000 BORDER POINT
  • 35. OUTPUT SPECIAL VALUE TEST CASES
  • 36. RANDOM TESTING ā€¢ Basic idea is that, rather than always choose the min, min+, nom, max-, and max values of a bounded variable, use a random number generator to pick test case values ā€¢ In Visual Basic application, to pick values for a bounded variable a<=x<=b, uses x=Int((b-a+1)*Rnd+a) where, Int ļƒ  Returns the integer part of floating point number Rnd ļƒ  Function generates random numbers in the interval [0,1]
  • 37. HOW MANY TEST CASES DO WE MAKE? ā€¢ Related to the probability of producing every outcome at least once ā€¢ Related to the probability of executing every statement / path at least once
  • 38.
  • 39.
  • 40.
  • 42. ā€¢ Boundary Value Testing derives test cases with Serious gaps Massive redundancy ā€¢ Motivations for equivalence class testing are Complete testing Avoid redundancy CONS OF BVA
  • 43. ā€¢ Black Box Technique ā€¢ Utilizes a subset of data which is representative of a larger class ā€¢ Equivalence partitioning involves partitioning of the input domain of a software system into several equivalent classes in a manner that the testing of one particular representative from a class is equivalent to the testing of some different value from the subject class ā€¢ Applicability ā€“ Program is a function from input to output ā€“ Input and/or output variables have well defined intervals
  • 45. Any number above or below 1 and 10 is invalid 1...10 are valid
  • 46. ā€¢ Here is the test condition ā€¢ Number > 10 entered in the reservation column (let say 11) is considered invalid ā€¢ Number < 1 that is 0 or below, then it is considered invalid ā€¢ Numbers 1 to 10 are considered valid ā€¢ Any 3 Digit Number say -100 is invalid ā€¢ We cannot test all the possible values because if done, number of test cases will be more than 100 ā€¢ To address this problem, we use equivalence partitioning hypothesis where we divide the possible values of tickets into groups or sets as shown below where the system behavior can be considered the same
  • 47. 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 is that 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.
  • 48. EQUIVALENCE CLASS TEST CASE ā€¢ Consider a numerical input variable, i, whose values may range from -200 through +200. Then a possible partitioning of testing input variable, i, by 4 partitions may be: ā€“ -200 to -100 ā€“ -101 to 0 ā€“ 1 to 100 ā€“ 101 to 200 ā€¢ Define ā€œsame signā€ as the equivalence relation, R, defined over the input variableā€™s value set, i = {-200 - -,0, - -, +200}. Then one partitioning will be: ā€“ -200 to -1 (negative sign) ā€“ 0 (no sign) ā€“ 1 to 200 (positive sign)
  • 50. TRADITIONAL EQUIVALENCE CLASS TESTING ā€¢ Nearly identical to Weak Robust Equivalence Class Testing ā€¢ Focuses on Invalid data values
  • 51. ā€¢ The idea of equivalence class testing is to identify test cases by using one element from each equivalence class ā€¢ If the equivalence classes are chosen wisely, the potential redundancy among test cases can be reduced ā€¢ [ ļƒ  Closed Interval ļƒ  Includes end-points ā€¢ ) ļƒ  Open Interval ļƒ  Does not include end-points Example (0,1) means greater than 0 and less than 1 IMPROVED EQUIVALENCE CLASS TESTING
  • 52. ā€¢ 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}
  • 53. TYPES OF EQUIVALENCE CLASS TESTING 1) Weak Normal Equivalence Class Testing 2) Strong Normal Equivalence Class Testing 3) Weak Robust Equivalence Class Testing 4) Strong Robust Equivalence Class Testing
  • 54.
  • 55. WEAK NORMAL EQUIVALENCE CLASS TESTING ā€¢ Weak ļƒ  Single Fault Assumption (One from each class) ā€¢ Normal ļƒ  Classes of Valid Values of Input (Identify Classes) ā€¢ Choose the test case from each of the equivalence classes for each input variable independently of the other input variable ā€¢ Test cases have all valid values ā€¢ Detects faults due to calculations with valid values of single variable
  • 56. DOT ļƒ  Indicates a Valid Value (Test Data) Valid value one from each class
  • 57. Example Assume the equivalence partitioning of input X2 is: 1 to 10; 11 to 20, 21 to 30 and the equivalence partitioning of input X1 is: 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 We have covered everyone of the 3 equivalence classes for input X. For ( X2, X1 ) we have: (24, 2) (15, 8 ) ( 4, 13) (23, 17) PROBLEM: May miss some equivalence classes
  • 58. STRONG NORMAL EQUIVALENCE CLASS TESTING ā€¢ Strong ļƒ  Multiple Fault Assumption (One from each class in Cartesian Product) ā€¢ Normal ļƒ  Identify equivalence classes of Valid Inputs ā€¢ Test cases from Cartesian Product of valid values ā€¢ Cartesian Product guarantees notion of completeness ā€¢ Detects faults due to interaction with valid values of any number of variables
  • 59. Dots ļƒ  Valid values but with all possibilities COVERS ONE POSSIBLE COMBINATION FROM EACH PARTITION
  • 60. Example of : Strong Normal Equivalence testing Assume the equivalence partitioning of input X2 is: 1 to 10; 11 to 2; 21 to 30 and the equivalence partitioning of input X1 is: 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 We have covered everyone of the 3 x 4 Cartesian product of equivalence classes PROBLEM: Doesnā€™t test values outside of intervals
  • 61. WEAK ROBUST EQUIVALENCE CLASS TESTING ā€¢ Weak ļƒ  Single Fault Assumption (One from each class) ā€¢ Robust ļƒ  Classes of valid and invalid values of input ā€¢ Up to now we have only considered partitioning the valid input space ā€¢ ā€œWeak robustā€ is similar to ā€œweak normalā€ equivalence test except that the invalid input variables are now considered
  • 62.
  • 63. Example of : Weak Robust Equivalence testing Assume the equivalence partitioning of input X2 is 1 to 10; 11 to 20, 21 to 30 and the equivalence partitioning of input X1 is 1 to 5; 6 to 10; 11 to 15; and 16 to 20 X2 X11 10 20 30 1 5 10 15 20 We have covered everyone of the 5 equivalence classes for input X. PROBLEM: Misses some equivalence classes
  • 64. PROBLEMS WITH ROBUST EQUIVALENCE TESTING a) Very often the specification does not define what the expected output for an invalid test case should be b) Thus, testers spend a lot of time defining expected outputs for these cases c) Strongly typed languages like Pascal, Ada, eliminate the need for the consideration of invalid inputs
  • 65. STRONG ROBUST EQUIVALENCE CLASS TESTING ā€¢ Strong ļƒ  Multiple Fault Assumption (One from each class in Cartesian Product) ā€¢ Robust ļƒ Classes of valid and invalid values of input ā€¢ Obtain the test cases from each element of the Cartesian product of all the equivalence classes
  • 66.
  • 67. 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 We have covered everyone of the 5 x 6 Cartesian product of equivalence classes (including invalid inputs) Problem: None, but results in lots of test cases (expensive)
  • 69. EQUIVALENCE CLASS TEST CASES FOR THE TRIANGLE PROBLEM
  • 70. ā€¢ Four possible outputs: ā€“ NotATriangle ā€“ Scalene Triangle ā€“ Isosceles Triangle ā€“ Equilateral Triangle ā€¢ Output (range) equivalence classes: INPUT OUTPUT
  • 71. WEAK NORMAL EQUIVALENCE CLASS TEST CASE Four weak normal equivalence class test cases, chosen arbitrarily from each class
  • 72. STRONG NORMAL EQUIVALENCE CLASS TEST CASE ā€¢ Because no valid subintervals of variables a, b, and c exist, the strong normal equivalence class test cases are identical to the weak normal equivalence class test cases.
  • 73. WEAK ROBUST TEST CASES The invalid values could be - Zero (0) - Any Negative Number (-ve) - Any number >200 Considering, the invalid values for a, b, and c yield the above additional weak robust equivalence class test cases
  • 75. TRIANGLE INPUT EQUIVALENCE CLASSES For example, triplet <1,4,1> has exactly one pair of equal sides, but those sides do not form a triangle
  • 76. If we want to be even more thorough, we could separate the ā€œgreater than or equal toā€ to two distinct cases as: D6 will become: D6ā€™={<a,b,c>:a=b+c} D6ā€={<a,b,c>:a>b+c} Similarly, for D7 and D8
  • 77. 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}
  • 78.
  • 82.
  • 83. EQUIVALENCE CLASS TEST CASES FOR THE NEXTDATE FUNCTION ā€¢ Variables: ā€“ Month ā€“ Day ā€“ Year ā€¢ Equivalence Classes for Months M=M1UM2UM3 ā€“ 30 days months (M1) ā€“ 31 days months (M2) ā€“ February (M3)
  • 84. ā€¢ Equivalence Classes for Years Y=Y1UY2UY3UY4 ā€“ Non-Century Common Years (Y1) ā€“ Non-Century Leap Years (Y2) ā€“ Common Century Years (Y3) ā€“ Leap Century Years (Y4) ā€¢ Equivalence Classes for Days D= D1UD2UD3ā€¦ ā€“D1=1ā€¦? ā€“D2=? MAY GIVE A SOLUTION, BUT THE CLASSES MAY BE LARGE
  • 85. 31 --> Jan(1), March(3), May(5), July(7), August(8), Oct(10), Dec(12) 30 --> April(4), June(6), Sept(9), Nov(11)
  • 86.
  • 87. NUMBER OF TEST CASES = #classes in the partition with the largest numbering of subsets. WEAK NORMAL EQUIVALENCE CLASS
  • 88.
  • 89. NUMBER OF TEST CASES: Based on Cartesian product of the partition subsets 3 MONTH CLASSES 4 DAY CLASSES 3 YEAR CLASSES 3*4*3=36
  • 90. EQUIVALENCE CLASS TEST CASE FOR COMMISSION PROBLEM ā€¢ The input domain of the commission problem is partitioned by the limits on: ā€“ Locks ā€“ Stocks ā€“ Barrels ā€¢ The first class is the valid input and other two are invalid ā€¢ When a value of -1 is given for locks, the while loop terminates, and the values of totalLocks, totalStocks, and totalBarrels are computed to compute sales and then commission
  • 91.
  • 94. WEAK NORMALAND STRONG NORMAL EQUIVALENCE CLASS We will have exactly one weak normal equivalence class test case and its identical to the strong normal equivalence class test case
  • 96. STRONG ROBUST EQUIVALENCE CLASS TEST CASES
  • 98. ā€¢ Equivalence partitions are designed so that every possible input belongs to one and only one equivalence partition ā€¢ It is appropriate when input data is defined in terms of intervals ā€¢ Equivalence class testing is strengthened by a hybrid approach with boundary value testing ADVANTAGES OF EQUIVALENCE PARTITIONING ECT BVA
  • 99. DISADVANTAGES ā€¢ No guide lines for choosing inputs ā€¢ Doesnā€™t test every input ā€¢ Several tries may be needed before the right equivalence relation is discovered
  • 100. EDGE TESTING ā€¢ Edge Testing ļƒ  Hybrid of boundary value analysis and equivalence class testing ā€¢ Need for Edge Testing? ā€“contiguous ranges of a particular variable constitute equivalence classes
  • 101. ā€¢ Normal test values for x1: {a, a+, bā€“, b, b+, cā€“, c, c+, dā€“, d} ā€¢ Robust test values for x1: {aā€“, a, a+, bā€“, b, b+, cā€“, c, c+, dā€“, d, d+} ā€¢ Normal test values for x2: {e, e+, fā€“, f, f+, gā€“, g} ā€¢ Robust test values for x2: {eā€“, e, e+, fā€“, f, f+, gā€“, g, g+} ā€¢ NOTE: One subtle difference is that edge test values do not include the nominal values that we had with boundary value testing.
  • 102. DECISION TABLE ā€“ BASED TESTING
  • 105. ā€¢ A decision condition is constructed with a condition stub and a condition entry ā€¢ Condition Stub ā€“ is declared as a statement of a condition ā€¢ Condition Entry ā€“ provides a value assigned to the condition stub ā€¢ Similarly, an action (or decision) composes two elements: an action stub and an action entry ā€¢ Action Stub ā€“ One states an action with an action stub ā€¢ Action Entry ā€“ specifies whether (or in what order) the action is to be performed
  • 106. STRUCTURE OF DECISION TABLE ā€¢ A column in the entry portion is known as a rule ā€¢ Rules indicate which actions are taken for the conditional circumstances indicated in the condition portion of the rule ā€¢ Decision table is used for ā€œtest case identificationā€ ā€¢ Decision tables are declarative that conditions and actions follows no particular order
  • 107. TYPES OF DECISION TABLES ā€¢ Limited Entry Decision Table ā€“ Decision tables in which all conditions are binary are known as ā€œLimited entry decision tablesā€ ā€¢ Extended Entry Decision Table ā€“ If conditions are allowed to have several values, the resulting tables are known as ā€œExtended entry decision tablesā€
  • 108. DECISION TABLE INTERPRETATION ā€¢ How are condition entries in a decision table interpreted with respect to a program? Conditions are interpreted as: Input Equivalence classes of inputs ā€¢ How are action entries in a decision table interpreted with respect to a program? Actions are interpreted as: Output Major functional processing portions ā€¢ What is the relationship between decision tables and test cases? ā€“ Rules are interpreted as test cases ā€“ With a complete decision table, have a complete set of test cases
  • 109. ā€¢ Donā€™t Care Entries ā€“ Donā€™t care entries indicates, that the condition is irrelevant or condition does not apply ā€“Helps in giving a complete decision table ā€“Represented by using the symbol ā€˜__ā€™ ā€¢ Use of donā€™t care entries ā€“ Reduce the number of explicit rules by implying the existence on non-explicitly stated rules
  • 110. ā€¢ In Limited Entry Decision Table: ENTRIES NOTATION USED CONDITION ENTRIES T (TRUE), F (FALSE) ACTION ENTRIES X DONā€™T CARE ENTRIES __
  • 111. TRIANGLE DECISION TABLE A5ļƒ  Action added by tester, showing rule impossible Action impossible shows when a rule is logically impossible 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 1 2 3 4 5 6 7 8 9
  • 112. TIPS TO REMEMBER THE TABLE
  • 113. TRIANGLE DECISION TABLE - REFINED Number of Rules = 2Number of Conditions So therefore, Number of Rules = 26 = 64 What are we going to consider here? A more detailed view of the three inequalities of the triangle property. If any one of these fails, the three integers do not constitute sides of a triangle.
  • 114. TRIANGLE DECISION TABLE - REFINED Number of Rules = 2Number of Conditions So therefore, Number of Rules = 26 = 64 1 2 3 4 5 6 7 8 9 10 11
  • 115. TIPS TO REMEMBER THE TABLE
  • 116. ā€¢ For limited entry decision table: ā€“ If n conditions exist, there must be 2n rules ā€“ When donā€™t care entries really indicate that the condition is irrelevant, we can develop a rule count as follows: ā€¢ Rules in which donā€™t care entries do not occur count as one rule ā€¢ And each donā€™t care entry in a rule doubles the count of that rule ā€¢ Usefulness of rule count ā€“ Less rules than combination rule count, indicates missing rules ā€“ More rules than combination rule count, indicates redundant rules or indicate inconsistent table
  • 117. DECISION TABLE WITH RULE COUNT When donā€™t care entries really indicate that the condition is irrelevant, we can develop a rule count as follows: Rules in which donā€™t care entries do not occur count as one rule And each donā€™t care entry in a rule doubles the count of that rule If n conditions exist, there must be 2n rules Here, n=6 So, rules 64 We can make sure that this is a complete decision table by counting the total number of rules: 32+16+8+1+1+1+1+1+1+ 1+1= 64 = 26
  • 118. TEST CASE FOR TRIANGLE PROBLEM
  • 119. ā€¢ Using the decision table, we obtain 11 functional test cases: ā€“ 1 way to get a scalene triangle ā€“ 1 way to get an equilateral triangle ā€“ 3 impossible cases ā€“ 3 ways to fail the triangle property ā€“ 3 ways to get an isosceles triangle
  • 120. TEST CASE FOR THE NEXTDATE FUNCTION FIRST TRY ā€¢ Suppose we start with a set of equivalence classes:
  • 121. ā€¢ In the NextDate problem, three of the conditions can be the equivalence classes of the months c1 : M1 ļƒ  30 Days a1 : Impossible c2 : M2 ļƒ  31 Days a2 : Next Date c3 : M3 ļƒ  Feb ā€¢ Since the equivalence classes are mutually exclusive, then a month can only exist in one condition, i.e. we cannot have a rule in which two of these three conditions are true DECISION TABLE WITH MUTUALLY EXCLUSIVE CONDITION DONā€™T CARE ENTRY MEANS, MUST BE FALSE IN THIS CASE
  • 123. HOW TO REMEMBER???? DONā€™T CARE ENTRY MEANS, MUST BE FALSE IN THIS CASE
  • 125.
  • 126.
  • 128. 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
  • 129. M1 ļƒ  30 DAYS M2 ļƒ  31 DAYS M3 ļƒ  FEBRUARY (28/29) D1 ļƒ  1-28 D2 ļƒ  29 D3 ļƒ  30 D4 ļƒ  31
  • 130. 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
  • 132. 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
  • 133. 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
  • 134.
  • 135.
  • 136.
  • 137. TEST CASE FOR COMMISSION PROBLEM
  • 138.
  • 139.
  • 140. 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
  • 141. ADVANTAGES OF DECISION TABLE ā€¢ Decision tables are precise and compact way to model complicated logic ā€¢ Testing also works iteratively. The table that is drawn in the first iteration, acts as a stepping stone to derive new decision tables (s) ā€¢ These tables guarantee that we consider every possible combination of condition values. This is known as its ā€œcompleteness propertyā€ ā€¢ Decision tables are declarative. There is no particular order for conditions and actions to occur
  • 142. DISADVANTAGES OF DECISION TABLE ā€¢ Decision tables do not scale up well. We need to ā€œfactorā€ large tables into smaller ones to remove redundancy
  • 143. REFERENCE ā€¢ Paul C. Jorgensen: Software Testing, A Craftsmanā€™s Approach, 4th Edition, Auerbach Publications, 2013.