For the complete documentation index, see llms.txt. This page is also available as Markdown.

Using AI Test Class

Written for the Old UI

Overview

This article explains how to use the AI Test Class Creator to automatically generate a Salesforce test class for the selected component. Once generated, you can review and commit the test class as a new component to the branch.

Since deploying components to Salesforce typically requires sufficient test coverage, the AI Test Class Creator helps accelerate test coverage by:

  • Improving deployment readiness by adding missing test coverage.

  • Reducing deployment failures caused by insufficient or failing tests.

  • Standardizing baseline test patterns across teams.

  • Accelerating delivery by reducing manual test scaffolding effort.

Default AI Limitations

By default, Flosum provides a free shared DeepSeek AI model for DevOps through DeepSeek’s API. Because it is shared across tenants, performance and availability depend on system load and token capacity. During heavy usage, you may see higher latency or temporary errors. To avoid this, you can add your own custom AI model. See the following article.

Best Practices

  • Review the generated test data setup to ensure it matches your organization’s validation rules and required fields.

  • Ensure the test class follows your team’s naming conventions and deployment standards.

  • When possible, commit test classes separately to keep changes easy to review and track.

Using AI Test Class

1

Select a Branch and Component

  1. Click Code from the left sidebar menu.

  2. Click the branch that contains the component you want to create a test class for.

  3. Click the component you want to create a test class for.

2

Create Test Class

The generated test class will use the component name, with “Test” appended.

  1. Click AI Tools next to Edit.

  2. Click AI Test Class from the dropdown menu.

  3. While the test class is being generated, AI is generating... is displayed.

  4. Review the test class after it is created and make any necessary changes.

  5. Click Commit changes.

  6. Enter a Commit message in the textbox.

  7. Click Commit.

  8. Once created, the new test class is added to the branch as a new component.

Last updated

Was this helpful?