Back to Blog

Introducing LATdx

LATdx runs Salesforce Apex tests from your project, reuses eligible cached results, and helps you focus on tests affected by code changes.

Posted by

A shorter Apex test feedback loop

LATdx is a CLI for running Salesforce Apex tests from an SFDX project. It can reuse results for unchanged tests and select tests affected by a code change, so you can get focused feedback while developing. You still choose when to run the full suite.

Run your first test suite

Install LATdx, authenticate the Salesforce CLI to your org, and run this from the directory containing sfdx-project.json:

latdx test run -o my-org

The first run executes the selected tests against the org. A later run can replay unchanged results from the local cache. Follow the CLI quickstart for installation, prerequisites, and sign-in details.

Reuse results with care

The cache keys a test result to its source, statically discovered dependencies, and org schema. A changed input triggers a fresh run. Tests marked @IsTest(SeeAllData=true) always run fresh. See the test caching guide for cache behavior and controls.

Static analysis cannot follow every dynamic Apex call, such as a class name passed to Type.forName. If code reached through dynamic dispatch changes, run the full suite without --affected and with --no-cache (or clear the cache first).

Focus a run on changed code

For a Git change, --affected narrows the run to tests whose static reach intersects the changed Apex or metadata files:

latdx test run --affected -o my-org --base origin/main

Some changes can affect tests without a static call graph edge, including triggers, flows, labels, and permission metadata. Run the full suite when these change. The CLI reference lists the other change types that need a full-suite run.