Coverage Lens: real-time Apex coverage, AI quick-fix test scaffolds, flakiness detection, and CI-friendly JUnit outputs—accelerate Salesforce test delivery.
## What’s new in Test Class Generator
Today we’re shipping Coverage Lens — a set of tools designed to make Apex test coverage actionable and repeatable across development and CI. Coverage Lens combines real-time coverage mapping, AI-driven quick-fix scaffolds, flakiness detection, and CI-friendly outputs so engineering teams can close coverage gaps faster and with less manual effort.
### Why this matters for Salesforce teams
Hidden coverage gaps, flaky tests, and inconsistent CI outputs are a major drag on release velocity. Coverage Lens tackles these pain points by giving you three practical capabilities:
- Real-time coverage mapping: see exactly which lines and branches of a class are exercised by your tests, with inline annotations in the generated test class and a coverage dashboard for the repo.
- AI quick-fix scaffolds: for uncovered code paths, get generated test methods and data-builder templates you can review and apply. Each suggestion includes the minimal setup, mocks, and assertions needed to hit the uncovered branch.
- CI-friendly output and flakiness insights: export JUnit XML and enriched logs for your CI toolchain, and get diagnostics that flag intermittent failures and suggest stabilization steps.
## How to use Coverage Lens in your workflow
1. Scan locally or in CI: run Test Class Generator as part of your local dev workflow or in CI. Coverage Lens works with both sandbox orgs and scratch orgs — configure your org connection once in the project settings.
2. Review the Coverage Dashboard: open the dashboard for the target package or class. Uncovered lines are highlighted and prioritized by risk score (how critical the uncovered branch is based on DML, integrations, or permissions).
3. Apply AI quick-fix scaffolds: for a missed branch, click Generate. The tool produces a test method, required test data builders, and mock stubs where external calls occur. You get editable code you can accept, modify, or reject.
4. Re-run and iterate: execute tests locally or in CI. Coverage Lens updates the map in real time and recalculates risk. Use the flakiness analyzer if intermittent failures occur — it will surface likely causes (time-sensitive logic, mixed DML order, or asynchronous timing issues) and offer stabilization patterns.
## Integration and configuration
- CI outputs: Coverage Lens emits JUnit XML, code coverage summaries, and an optional HTML dashboard artifact you can publish from GitHub Actions, CircleCI, or Jenkins.
- Custom templates: add your organization’s test templates and data-builder patterns to the project-level template library to keep generated code consistent with your standards.
- Thresholds: set project-level coverage thresholds and risk tolerances so PR checks fail only when your policies are breached.
## Practical benefits
- Faster test authoring: AI-generated scaffolds reduce boilerplate and speed PR completion.
- Fewer flaky failures: automated diagnostics reduce time spent debugging intermittent tests.
- Clear CI signals: standardized outputs make it trivial to enforce coverage gates in pull requests.
Conclusion / Call to action
Coverage Lens is available now to all Test Class Generator customers. Get started by enabling Coverage Lens in your project settings, run a scan, and try generating quick-fix scaffolds on a high-risk class. If you want a walkthrough, schedule a demo with our success team — we’ll help you integrate Coverage Lens into your CI pipeline and test strategy.