tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Agentic AI > ADK Agent Testing > Decision Table Testing for ADK Agent Business Rules

Decision Table Testing for ADK Agent Business Rules

Author: Venkata Sudhakar

Decision table testing systematically covers all combinations of conditions that determine an ADK agent tool's output, ensuring no business rule combination is missed. ShopMax India uses decision tables to test its discount eligibility tool where the outcome depends on multiple conditions - membership tier, order value, and coupon presence - and every combination of these three factors must be verified before the tool goes live for customers in Bangalore and Chennai.

A decision table lists all condition combinations as rows and the expected action or output as the final column. With three boolean conditions there are 2^3 = 8 rows. The table is translated directly into a pytest.mark.parametrize fixture so the test code mirrors the business specification. When a new condition is added, the table expands and the coverage gap is immediately visible as missing parametrize rows.

The example below defines a discount eligibility tool with three conditions (is_member, order_rs >= 2000, has_coupon), builds the full 8-row decision table, and asserts the correct discount percentage for every combination.


It gives the following output,

member=True order=3000 coupon=True -> 20% off
member=True order=3000 coupon=False -> 15% off
member=True order=1000 coupon=True -> 10% off
member=True order=1000 coupon=False -> 5% off
member=False order=3000 coupon=True -> 8% off
member=False order=3000 coupon=False -> 0% off
member=False order=1000 coupon=True -> 8% off
member=False order=1000 coupon=False -> 0% off
8 passed in 0.07s

Store the decision table as a CSV or YAML file so that business analysts can review and update it without reading Python code. Load it in conftest.py and feed it into pytest.mark.parametrize dynamically so the test count in CI always matches the number of rows in the spec. When ShopMax India adds a new loyalty tier, the table grows by a factor and the coverage gap in the old test suite is immediately apparent from the missing rows.


 
  


  
bl  br