Generate Tests from Subagents and Actions

Evaluate how well your agent handles key subagents and actions. Generate relevant, test-ready utterances by using your subagent and action metadata as well as information from connected data libraries.

Required Editions

green checkmark

This article applies to:

New Testing Center in Agentforce Studio (Beta)
red crossmark

This article doesn’t apply to:

Legacy Agentforce Testing Center in Setup
Available in: Lightning Experience
Available in: Enterprise, Performance, Unlimited, and Developer Editions. Required add-on licenses vary by agent type.
User Permissions Needed
To create tests in the Testing Center:

Manage Agentforce Grids

AND

Manage Agentforce Testing

To get started select the subagents you want to test, define the test focus with a brief description, and have the system generate test cases. Test cases are formatted as conversations, enabling evaluation at both the single-utterance and multi-turn conversation level.

  1. For conversation-level testing, under Select Conversation Output, choose how conversations are delivered to your agent.
    Data step in testing center for conversation level output with text only select.
    • Text only. Conversations are delivered as text.
    • Text and voice. Conversations are delivered as text and as audio. Results include an audio recording of the simulated conversation.
    Note
    Note Agentforce Employee Agents support only text outputs in the Testing Center.
  2. Under Select Customer Personas, choose the persona that best matches your expected user base.
    Customer personas simulate real-world conditions such as background noise, natural conversation flow, accents and phonetic spelling, incomplete information, and verification issues.
  3. To create test cases from subagents and actions, select Generate test cases based on subagents and actions.
    Note
    Note Test cases are drafted in the Agentforce Agent's default language. For supported languages, see Considerations for Testing Center.
  4. Specify how many test cases you want to generate. You can generate up to 200 test cases at a time.
  5. Enter a description to help guide the AI model about the purpose and scope of your testing.

    How does the test description influence my tests?

    The test description is included in the prompt and guides how your test cases are generated by defining the test focus or theme. Keywords and phrases in the description help narrow the information that tests are built around, which is especially useful when your agent is linked to multiple sources like articles or PDFs.

    While you can’t customize the format or complexity of tests in the description, you can help define the test focus by using relevant terms and phrases. Although perfect grammar isn’t required, using complete sentences to write out the description helps both AI and human reviewers understand your intent and improves the output's relevance.

    The description is for focus and scope, not configuration. Don't include a test case count, a specific subagent name, or instructions that restate the task like "generate test cases" or "test the agent."

  6. Select the subagents that you want to test. Click Next.

    How do I select which subagents and actions to test?

    Agentforce Testing Center identifies the subagents and actions accessible to the agent that you're testing and uses this information to create targeted test cases. Test utterances are then drafted based on the subagent and action instructions, aiming to trigger the agents to select them. When your agent recieves and processes an utterance, we confirm that the agent correctly selected the intended subagent and action.

    To assess your agent's overall effectiveness, generate test cases across all available subagents. This comprehensive approach provides a broad understanding of your agent's performance, so you can pinpoint areas of weakness and prioritize further, more targeted testing. By identifying and addressing these pain points early, you can significantly improve your agent's accuracy before deployment.

    Alternatively, if you've modified a specific subagent or action, select those subagents to validate the changes and ensure correct behavior. For example, if you've updated the "Refund Request" subagent, you can isolate tests to only that subagent to ensure the changes function as intended, saving time and increasing confidence in your agent's performance.

    You can also select a cluster of subagents related to a specific business area. For instance, you could select a group of subagents related to Order Management, like Order Status, Cancel Order, Modify Order, to comprehensively test how your agent handles a customer's end-to-end order-related queries. Clustering related subagents can ensure a seamless and accurate experience across all touchpoints.

Note
Note Generative AI can generate test cases for Account, Lead, Opportunity, and Contact objects. With specific instructions in the description, it can also create test cases for custom objects and the Answer Questions with Knowledge action. For example, for custom objects, use a description similar to this: “Generate test cases for [custom object name]. Sample utterances are: [sample utterance related to custom object], [sample utterance related to custom object].” To have AI create test cases for the Answer Questions with Knowledge action, use a description similar to this: “Generate test cases for the Answer Questions with Knowledge action. Use the following knowledge articles for generating tests: [title of an article], [title of an article].”