Sub topic 13
Building and running a regression test set
This chapter assumes you can edit topics, instructions, and actions in Agentforce Builder. It also assumes you have already diagnosed a failure from a real conversation. A regression test set is a saved list of test cases. You rerun it after every change, so you can see whether a fix broke something that used to work.
Why a test set matters
Agent behavior comes from a language model reading your topic descriptions, instructions, and action descriptions. A small wording change can move a request to a different topic. A fix for one conversation can quietly break another. Checking by hand each time is slow, and people skip it. A saved test set makes the check cheap and repeatable.
Turn a failed conversation into a test case
Start with conversations you reviewed. Each failure you fixed becomes one test case. A good test case has four parts:
- A short name that says what is being checked.
- The user utterance, copied from the real conversation with personal data removed.
- The expected topic and expected action.
- The expected response behavior, described as what the reply must do and must not do.
Here is a failed conversation where a returns request went to the order topic:
Test case: Returns request is not handled by the order topic
User utterance: I want to send back the shoes I bought last week.
Expected topic: Returns
Expected action: none until the order number is confirmed
Expected response: Asks for the order number or return reason, does not give a delivery date.Describe the expected response by behavior, not exact wording. The model phrases replies differently each run, so an exact-text match would fail for no real reason.
What to include
Build the set from three groups:
- Fixed failures. One case for each problem you diagnosed.
- Healthy common requests. Cases for your highest-volume topics, such as order status, so a fix elsewhere cannot break them.
- Boundary cases. Requests that sit between two topics, and requests the agent should escalate or decline.
Add several paraphrases of each important request. Customers rarely use the same words twice.
Run the set
Run the full set after every change, not only the cases related to it. When a case fails, open its reasoning trace. Check whether the wrong topic was picked, the wrong action was called, or the right steps were followed with a poor reply. Then fix the cause.
Common errors
- Testing only the fixed failure. The fix passes, but a neighboring topic breaks.
- Expecting exact wording, which creates false failures.
- Never adding new cases. The set should grow whenever a new failure type appears.
- Keeping customer names or order numbers in test utterances. Replace them with placeholders.
Exercise
A customer wrote "Where is my refund?" and the agent used the order status topic. You rewrite the order topic to exclude refunds. Name three test cases you would add or rerun.
Show answer
Add the refund utterance with the expected topic Refunds (or Returns) and no order status lookup. Add a paraphrase such as "When will I get my money back?" to check the fix is not tied to one wording. Rerun an ordinary order status case, such as "Where is my package?", to confirm the narrowed topic still handles what it should.