State Transition - Decision Table Testing
State Transition - Decision Table Testing
An FSM is a behavioral model whose outcome depends upon both previous and
current inputs.
State Transition Diagram
(4) Actions: The state change may result in the software taking action.
(example: Outputting an invalid pin message.)
State Transition Diagram
(Example1:ATM Withdrawal process)
State Transition Table
Each operand or variable in a logical expression takes on the value, TRUE or FALSE.
DECISION TABLE-BASED TESTING
(1) Condition stub: It is a list of input conditions for which the complex combination is
made.
(2) Action stub: It is a list of resulting actions which will be performed if a combination
of input condition is satisfied.
(‘X’ denotes the action entry).
(‘I’ denotes the Don’t-Care state or immaterial state) i.e. condition entry, which has
no effect whether it is True or False.
(3) Rule: When we enter TRUE or FALSE for all input conditions for a particular
combination, then it is called a Rule.
Decision table structure
EXAMPLE: 1
The Food delivery company offer the following discounts for their customers
based on the given conditions:
Rules
1 2 3 4 5 6 7 8
Condition C1: New Customer T T T T F F F F
Stub: : 15%
C2: Repeat T T F F T T F F
Customer : 10%
C3: Coupon Code T F T F T F T F
: 30%
Action Invalid Invalid 45% 15% 40% 10% I I
Stub:
EXAMPLE: 2
A program calculates the total salary of an employee with the conditions that if
the working hours are less than or equal to 48, then give normal salary.
The hours over 48 on normal working days are calculated at the rate of 1.25 of
the salary.
However, on holidays or Sundays, the hours are calculated at the rate of 2.00
times of the salary.
The test cases derived from the decision table are given below:
EXAMPLE: 3
The program reads the marks in the three subjects and generates the following
outputs:
(i) Not eligible
(ii) Eligible for scholarship course
(iii) Eligible for normal course
Design test cases for this program using decision table testing.
Solution:
The test cases derived from the decision table are given below:
EXAMPLE: 4
A wholesaler has three commodities to sell and has three types of customers.
Discount is given as per the following procedure:
(i) For DGS & D orders, 10% discount is given irrespective of the value of the
order.
(ii) For orders of more than Rs 50,000, agents get a discount of 15% and the
retailer gets a discount of 10%.
(iii) For orders of Rs 20,000 or more and up to Rs 50,000, agents get 12% and
the retailer gets 8% discount.
(iv) For orders of less than Rs 20,000, agents get 8% and the retailer gets 5%
discount.
The above rules do not apply to the furniture items wherein a flat rate of 10%
discount is admissible to all customers irrespective of the value of the order.
Design test cases for this system using decision table testing.
Solution:
The test cases derived from the decision table are given below: