unit – 2 boundary value testing, equivalence class testing ... · unit –2 boundary value...
TRANSCRIPT
Unit – 2Boundary Value Testing,
Equivalence Class Testing, Decision Table-Based Testing
ST
8th Sem, A’ Div
2017 - 18
Prof. Mouna M. Naravani
Decision Tables
• Decision tables are used to represent and analyse complex logical relationships.
• Ideal for describing situations in which a number of combinations of actions are
taken under varying sets of conditions.
08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 2
➢A Decision table has 4 parts:
➢Condition stub
➢Condition entries
➢Action stub
➢Action entries
➢ The left most column is the stub portion
➢ The right is the entry portion
➢ Condition portion is denoted by c’s.
➢ Action portion is denoted by a’s
➢ A column in entry portion is a rule.
➢ -- “don’t care” entry
➢ The don’t care entry has two
interpretation:
➢ Condition is irrelevant
➢ Condition does not apply
➢ Also denoted as “n/a”
08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 3
Indicate
inputs
Indicate
outputs
Rules are interpreted as test cases.08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 4
➢Decision tables in which all the conditions are binary are called Limited Entry
Decision Tables.
➢ If conditions are allowed to have several values, the resulting tables are called
Extended Entry Decision Tables.
➢When we have binary conditions (true/false, Yes/No, 0/1), the condition portion of a
decision table is a truth table.
➢This structure guarantees that we consider every possible combination of condition
values.
➢For Limited Entry Decision Tables, if n conditions exist, there must be 2n rules.
08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 5
Decision table for Login Page
Conditions
Valid ID
Valid Password
Actions
Home Page
Show message “Invalid Credentials”
08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 6
Rule 1 Rule 2 Rule 3 Rule 4
c1: Valid Id T T F F
c2: Valid Password T F T F
a1: Home Page X
a2: Show message “Invalid
Credentials”X X X
08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 7
Decision table for Online Money Transfer
Conditions
Account already approved
OTP matched
Sufficient money in account
Actions
Transfer money
Show message as insufficient balance
Block transaction in case of suspicious transactions
08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 8
Rule 1 Rule 2 Rule 3 Rule 4 Rule 5 Rule 6 Rule 7 Rule 8
c1 Account already
approvedT T T T F F F F
c2 OTP Matched T T F F T F F T
c3 Sufficient money in
accountT F T F T F T F
a1 Transfer money X
a2 Show message as
insufficient balanceX
a3 Block transaction in
case of suspicious
transactionsX X X X X X
08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 9
Rule 1 Rule 2 Rule 3 Rule 4 Rule 5 Rule 6 Rule 7 Rule 8
c1 Account already
approvedT T T T F F F F
c2 OTP Matched T T F F T F F T
c3 Sufficient money in
accountT F T F T F T F
a1 Transfer money X
a2 Show message as
insufficient balanceX
a3 Block transaction in
case of suspicious
transactionsX X X X X X
08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 10
Rule 1 Rule 2 Rule 3 Rule 4 Rule 5
c1 Account already
approvedT T T T F
c2 OTP Matched T T F F --
c3 Sufficient money in
accountT F T F --
a1 Transfer money X
a2 Show message as
insufficient balanceX
a3 Block transaction in
case of suspicious
transactionsX X X
Rule Count = 8
08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 11
Decision Table for Triangle Problem
Conditions:
- a, b, c, form a triangle?
- a = b?
- a = c?
- b = c?
Actions:
- Not a Triangle
- Scalene
- Isosceles
- Equilateral
- Impossible
08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 12
Decision Table for Triangle Problem
Rule Counts?
08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 13
Why are rules 3, 4, and 6 impossible?
If two pairs of integers are equal, by transitivity, the third pair must be equal; thus,
the negative entry makes these rules impossible.
Refined Decision Table for the Triangle Problem
- The choice of conditions can greatly expand the size of decision table.
- Here, the old condition (c1: a, b, c form a triangle?) is expanded to 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.
08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 14
Refined Decision Table for Triangle Problem
Conditions:
- a < b + c?
- b < a + c? a, b, c, form a triangle?
- c < a + b?
- a = b?
- a = c?
- b = c?
Actions:
- Not a Triangle
- Scalene
- Isosceles
- Equilateral
- Impossible
08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 15
Refined Decision Table for the Triangle Problem
Rule Counts?
X
08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 16
Rule Counts = 64
X
08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 17
Test Cases for the Triangle Problem
08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 18
08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 19
08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 20
08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 21
Inconsistent – Because the
action set are different for rules 4
and 9.
Non-Deterministic – Because
there is no way to decide whether
to apply rule 4 or rule 9.
Testers should take care when
“don’t care” entries are used in
table.
08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 22
Decision Table for NextDate Function
• Example for extended entry decision table.
Conditions:
- Month in
- Day in
- Year in
Actions:
- Impossible
- Increment day
- Reset day
- Increment month
- Reset month
- Increment year
08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 23
The cartesian product of these contains 40 elements.08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 24
Decision Table for NextDate Function (first half)
08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 25
Decision Table for NextDate Function (next half)
08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 26
08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 27
08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 28
08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 29
08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 30
References
➢ Paul C. Jorgensen: Software Testing, A Craftsman’s Approach, 3rd Edition, Auerbach
Publications, 2008.
08-03-2018 Dept. of CSE, BLDEACET, Vijayapur 31