Article 20 : Taming Complexity with a Grid with Decision Table Technique

Article 20 : Taming Complexity with a Grid with Decision Table Technique

In the dynamic landscape of software testing, the ability to handle complex scenarios with multiple variables is crucial. Decision Table Technique emerges as a powerful tool, providing a structured way to model and test combinations of inputs and their corresponding outcomes. This article delves into the intricacies of the Decision Table Technique, demonstrating its efficacy through a real-world example of refund calculations for a bus pass system.

Understanding Decision Table Technique:

  • Decision Table Technique is a systematic approach that helps in capturing and organizing the logic of complex business rules.
  • By creating a matrix of conditions and actions, testers can ensure comprehensive test coverage. This technique is particularly useful for testing systems with multiple input combinations and varying outcomes.

Example: Refund Calculation for a 3-Month Bus Pass: Consider a scenario where a user purchases a 3-month bus pass valued at 100 Rs with a discount of 20 Rs. If the pass is canceled, the refund amount needs to be calculated based on the number of days the pass was used.

In this example, the table shows how refunds are calculated based on the day of cancellation. It highlights the adjustments needed to ensure the refund does not become negative when the discount is applied.

Test Case 1: Full Refund

  • Start Date: Day 1
  • Cancellation Date: Day 1 (within the grace period)
  • Days Used: 0
  • Days Remaining: 90
  • Expected Refund:Full Amount: 100 RsRefund Without Discount: 100 Rs (not applicable since there's a discount)Refund With Discount: 80 Rs (100 Rs - 20 Rs discount)
  • Final Refund Amount: 80 Rs (considering the discount)

Test Case 2: Partial Refund (Used for 30 days)

  • Start Date: Day 1
  • Cancellation Date: Day 30
  • Days Used: 30
  • Days Remaining: 60
  • Expected Refund:Full Amount: 100 RsRefund Without Discount: 66.67 Rs (100 Rs / 3 months * 2 months remaining)Refund With Discount: 46.67 Rs (66.67 Rs - 20 Rs discount)
  • Final Refund Amount: 46.67 Rs (considering the discount)

Test Case 3: Partial Refund (Used for 45 days)

  • Start Date: Day 1
  • Cancellation Date: Day 45
  • Days Used: 45
  • Days Remaining: 45
  • Expected Refund:Full Amount: 100 RsRefund Without Discount: 50 Rs (100 Rs / 3 months * 1.5 months remaining)Refund With Discount: 30 Rs (50 Rs - 20 Rs discount)
  • Final Refund Amount: 30 Rs (considering the discount)

Test Case 4: No Refund (Used beyond 75 days)

  • Start Date: Day 1
  • Cancellation Date: Day 75
  • Days Used: 75
  • Days Remaining: 15
  • Expected Refund:Full Amount: 100 RsRefund Without Discount: 16.67 Rs (100 Rs / 3 months * 0.5 months remaining)Refund With Discount: -3.33 Rs (16.67 Rs - 20 Rs discount) (Negative value indicates no refund)
  • Final Refund Amount: 0 Rs (No refund since the calculated amount is negative)

Test Case 5: Edge Case (Cancellation on the last day)

  • Start Date: Day 1
  • Cancellation Date: Day 90
  • Days Used: 90
  • Days Remaining: 0
  • Expected Refund:Full Amount: 100 RsRefund Without Discount: 0 Rs (no days remaining)Refund With Discount: -20 Rs (0 Rs - 20 Rs discount) (Negative value indicates no refund)
  • Final Refund Amount: 0 Rs (No refund since the calculated amount is negative)


Benefits of Decision Table Technique:

  1. Comprehensive Coverage: Decision tables ensure all possible combinations of inputs and conditions are tested, providing thorough coverage.
  2. Clarity and Organization: They offer a clear and organized way to document complex business rules and decision logic.
  3. Efficiency: By structuring the conditions and actions, decision tables help in identifying redundant or missing test cases, optimizing the testing process.
  4. Enhanced Communication: These tables facilitate better communication among stakeholders by clearly depicting the decision logic.

Conclusion: The Decision Table Technique is a valuable asset in the software tester’s toolkit, especially when dealing with complex scenarios involving multiple conditions and outcomes. By applying this technique to the bus pass refund calculation example, we demonstrate how it ensures accurate and fair refunds while maintaining clarity and organization. Embracing decision tables can significantly enhance the effectiveness of your testing strategy, leading to higher quality software and improved user satisfaction.

要查看或添加评论,请登录

Aashi S.的更多文章

社区洞察

其他会员也浏览了