SyncOnAI360

Apex Test Coverage

Know your real Apex coverage before release day does.

Coverage from the org's own last test run, every class under 75% named, code-quality findings with the source lines, and deploys that check coverage before they run.

Acme Production

Org health · synced 4 minutes ago

82

Health · B

Health

82

Confidence

74

Coverage

91

Apex coverage 78%, from the org's last test run

  • 3 Flows on Case run on the same trigger
  • 11 Apex classes below 75% coverage
  • Managed package source hidden by Salesforce: 2 packages

In one paragraph

SyncOnAI 360 Apex Test Coverage reports coverage from each org's last Apex test run, org-wide and for every class below 75%, excluding managed packages. The audit flags classes without tests and risky code, generated Apex ships with tests, and every proposal checks whether it can pass Salesforce's coverage gate.

Salesforce's production coverage bar, checked per class
75%Salesforce's production coverage bar, checked per class
Apex and code checks in the audit
9Apex and code checks in the audit
Never shown when no test run exists; it says Not recorded
0%Never shown when no test run exists; it says Not recorded
Coverage check on every proposal with Apex
1Coverage check on every proposal with Apex

01The problem

Why Apex coverage surprises teams at the worst moment

Salesforce requires coverage for production deploys, and most teams only look at the number when a deploy fails. By then the release is blocked and the fix is a rushed test that asserts nothing.

  1. 01

    Coverage seen too late

    The real number is discovered when a production deploy fails on coverage.

  2. 02

    Org-wide averages hide problems

    A healthy average can hide individual classes with no meaningful tests at all.

  3. 03

    Zero versus unknown

    Tools that show 0% when no test run exists send teams chasing the wrong problem.

  4. 04

    Tests written last

    Tests added under deadline pressure cover lines without checking behaviour.

02measured

How is Apex test coverage measured in SyncOnAI 360?

Coverage comes from the org's own last Apex test run: the org-wide figure and every class below 75%. Managed package classes are left out, because they are not yours to test.

If the org has no test run recorded, the page says Not recorded rather than 0%. Run your tests in Salesforce, or ask the chat to run them, refresh the org, and the figure updates.

  • Org-wide and per-class coverage
  • Managed packages excluded
  • Not recorded when there is no run

Acme Production

Org health · synced 4 minutes ago

82

Health · B

Health

82

Confidence

74

Coverage

91

Apex coverage 78%, from the org's last test run

  • 3 Flows on Case run on the same trigger
  • 11 Apex classes below 75% coverage
  • Managed package source hidden by Salesforce: 2 packages

03quality

Which Apex code-quality issues are flagged?

The audit's Apex section checks for classes without a test class, coverage under 75%, SOQL and DML inside loops, hardcoded ids and URLs, ancient API versions, empty catch blocks, oversized classes and more than one trigger per object.

Each finding opens to the Apex source lines behind it, with a severity and an effort estimate, and can be sent to the chat to draft a fix as a proposal.

  • Missing tests and low coverage
  • SOQL and DML in loops
  • Hardcoded ids, empty catches, old API versions
  • Multiple triggers per object

Org Audit

Acme Production · last run 6 minutes ago

Grade C
high

Flow has no fault path

Case_Intake_Route · Automation & Flows · Effort: hours · $600

<!-- Case_Intake_Route.flow-meta.xml -->
<recordUpdates>
  <name>Assign_Queue</name>
  <!-- no <faultConnector> -->
  <object>Case</object>
</recordUpdates>

04gate

Will a deploy pass Salesforce's coverage gate?

Every proposal containing Apex runs a test coverage check. If it carries its own tests, Salesforce will run those in production and needs each deployed class covered. If it carries none, Salesforce runs every test in the org and needs the overall average at the bar, and the check warns you before you find out the hard way.

Production deploys that include Apex run its tests at Salesforce's 75% bar. A Developer Edition org counts as production for this.

  • Coverage checked before deploy
  • Warns when a proposal carries no tests
  • Tests run on production deploys

Proposal: Case intake fault handling

Acme Production

Checks passed
  • Validated against the org without changing it
  • No component outside the change is modified
  • Apex tests pass, coverage 81%
  • No freeze window in effect
  • Policy: production requires a second admin

Blast radius

  • 2 Flows read Case.Priority
  • 1 report filters on it
  • Case_Intake_Route assigns from it

Risk: medium

05write

How does SyncOnAI 360 help raise Apex coverage?

Generated Apex comes with tests, built around the org's own patterns, and a component can be proposed together with its controller and its test as one change. The Apex Engineer agent writes classes, triggers and tests on request.

Audit findings for missing tests can be turned into work items or sent to the chat, so raising coverage becomes planned work rather than a release-day scramble.

  • Tests with generated Apex
  • Apex Engineer agent
  • Coverage gaps as planned work

OpportunityWonHandler.cls

Apex Logic · Component builder

  • For each Opportunity in trigger.new
  • If StageName changed to Closed Won
  • Collect AccountId
  • Query Accounts once, outside the loop
  • Update Account.Last_Won_Date__c

Edit: move the query back inside the loop

Compiles. Test class included in the proposal.

06raise

How should Apex coverage be raised in an existing org?

Start with the classes the audit flags for missing or weak tests, ordered by severity and effort, rather than chasing the overall percentage. Turning those findings into work items gives the team a plan it can work through between releases.

Each test written goes through a proposal and is validated against the org, so coverage rises with tests that actually run, and the next refresh after a test run shows the new figure.

  • Start from flagged classes
  • Plan it as work items
  • Tests validated against the org

Org Audit

Acme Production · last run 6 minutes ago

Grade C

C

74 / 100

Fair, technical debt accumulating

Automation & Flows

64

Permissions & Security

71

Apex & Code

78

Fields & Data Quality

82

Limits & Performance

91

Change Intelligence

69

55 checks run · 37 open findings · 2 checks skipped, with the reason shown

07How it works

Raising coverage

From an honest number to a passing release.

  1. 01

    Measure

    Read coverage from the org's last test run.

  2. 02

    Find

    See every class under the bar and the quality findings.

  3. 03

    Write

    Draft tests with the Apex Engineer agent.

  4. 04

    Check

    Proposals warn when coverage may fail.

  5. 05

    Deploy

    Tests run on production, and the receipt records it.

08Before and after

Coverage, with and without SyncOnAI 360

Without

With SyncOnAI 360

Found out when a deploy fails

Known from the last test run, class by class

0% when nothing ran

Not recorded, until tests actually run

Averages hiding untested classes

Every class under the bar named

Tests written last

Tests proposed with the code

No warning before the gate

A coverage check on every Apex proposal

10Questions

Frequently asked questions

From the org's own last Apex test run, org-wide and per class, excluding managed package classes.

Because the org has no Apex test run recorded. Run tests and refresh the org to see coverage.

Salesforce requires 75% coverage for production deploys that include Apex.

Every proposal with Apex runs a coverage check and warns when it carries no tests of its own.

Yes. Generated Apex comes with tests, and the Apex Engineer agent writes tests on request.

Yes. Apex test runs are part of live org access.

Missing tests, low coverage, SOQL and DML in loops, hardcoded ids, old API versions, empty catches, oversized classes and multiple triggers per object.

Yes. Every plan includes every feature.

Start in 5 minutes. No card required.

Connect your Salesforce org. Run your first health scan. Ask your first question. See what you've been missing.

  • Anthropic
  • OpenAI