Use AI to Generate Tests
Learning Objectives
After completing this unit, you’ll be able to:
- Use AI to generate test cases.
- Execute batch testing in the Agentforce Testing Center.
Let AI Generate Your Tests
Manually creating a diverse and scalable set of test scenarios is time-consuming and complex. The Agentforce Testing Center has the solution. You can now use AI to effortlessly generate hundreds of synthetic interactions based on the agent’s topics and actions to be used as test cases. This helps ensure that your agents handle various customer interactions accurately.
Then you run those tests automatically in parallel to see what topics and actions the agent chooses. From there, you can iterate by adjusting agent instructions and guardrails as needed—saving time that would have been lost on manually testing many different variations of a conversation. The result is a faster time to testing and a faster time to a more trusted agent that you feel confident deploying.
A good-quality test case dataset has three quality attributes.
-
Volume: A sufficient number of test cases to ensure comprehensive coverage of different scenarios and edge cases.
-
Diversity: A wide range of inputs, contexts, and variations to test the AI agent’s adaptability across real-world use cases.
-
Quality: Well-defined, accurate, and relevant test cases aligned with the AI agent’s objectives.
To complete this unit, you’ll need to use the special Developer Edition org you created in the last unit. When you’re finished following the step-by-step instructions, click Check Challenge to Earn 500 Points at the bottom of the page.
Batch Testing
There are a couple of ways to get to the Agentforce Testing Center. You already used the direct way in the last unit. There’s also a Batch Test button right in Agentforce Builder that takes you right to the Agentforce Testing Center. Let’s give it a go.
- From Setup, in the Quick Find box, search for and select Agentforce Agents.
- Click Einstein Copilot or Agentforce (Default).
- Click Open in Builder.
- Click Batch Test. This opens up the Agentforce Testing Center in a new tab with the New Test window open and the Einstein Copilot - v1 or Agentforce (Default) v1 already selected.
- For Test Name, enter
Generated Test Agentforce v1
.
- For Description, enter
Test cases for Agentforce to verify account summaries and details
.
- Click Next.
- Click Next.
- Click Generate Test Cases.
- For Number of test cases, leave it at 20.
- For Describe the test cases and provide some examples, enter
Generate realistic inquiries that customers might ask about their user account, orders, and other general questions about products
. This is also where you can define the number of these test cases that are positive and negative to create diversity in your test cases.
- For Select the topics for your test cases, leave them all checked. Note that you can select different topics for the different tests you create.
- Click Next.
- Click Generate Test Cases.
- Wait for the test to be generated. You may have to refresh your browser as it may take a bit to generate the tests. Click Run Test Suite. You might have to refresh the page.
- Click
to refresh the results.
Once the tests are created, you can download them to make sure the agent is doing what you want it to do. You can also fine-tune the agent as needed. In the next unit, you take a closer look at the test results and use Agentforce Builder to troubleshoot a failed test.
Make sure to click Check Challenge to Earn 500 Points before moving on to the next unit.