tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Agentic AI > ADK Agent Testing > Regression Testing ADK Agents After Prompt Changes

Regression Testing ADK Agents After Prompt Changes

Author: Venkata Sudhakar

When ShopMax India's team updates an ADK agent's system prompt to improve tone or add new product lines, existing behaviors can break silently. A golden-set regression test suite locks in expected behavior before the change and fails immediately if any critical behavior regresses after the update. This gives the team confidence to iterate on prompts without manual re-testing of every known scenario.

A regression suite stores a list of test cases, each with an input query, a list of terms the response must contain, and a list of terms it must not contain. Tests are parameterized with pytest.mark.parametrize so a single test function covers the whole golden set. The LLM response is mocked to return deterministic text that mimics the expected agent behavior, and assertions enforce the must_contain and must_not_contain rules on every run.

The example below shows a three-case golden set for ShopMax India covering order tracking, pricing, and refund scenarios, with both positive and negative content assertions on each response.


It gives the following output,

tests/test_regression.py::test_golden_set_regression[case0] PASSED
tests/test_regression.py::test_golden_set_regression[case1] PASSED
tests/test_regression.py::test_golden_set_regression[case2] PASSED

3 passed in 0.29s

In production, load GOLDEN_SET from a JSON file under tests/golden/ so non-engineers can add test cases without touching Python code. Run the regression suite as a required CI check on every pull request that modifies agent instructions, tool definitions, or model version. When a case fails after a prompt change, treat it as a deliberate behavior change that needs a sign-off - update the golden set only after the team agrees the new behavior is correct.


 
  


  
bl  br