sf-testing

Automate Apex test execution and coverage analysis with sf commands.

423|97|Updated Nov 30, 2025
One-click install
npx skills add https://github.com/Jaganpro/sf-skills --skill sf-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sf-testing
Source: https://github.com/Jaganpro/sf-skills/tree/main/sf-testing
Command: npx skills add https://github.com/Jaganpro/sf-skills --skill sf-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill targets fast, reliable Apex testing through mock frameworks, test data factories, and an agentic test-fix loop to fix failures efficiently.

Core Features & Use Cases

  • Test execution with coverage analysis
  • Mocking DML and SOQL for ultra-fast tests
  • Agentic test-fix loops to iteratively repair failures
  • Bulk testing patterns (251+ records)

Quick Start

Run tests with 90%+ coverage, using Test Data Factories to generate data and Mock frameworks to avoid real DML.

Frequently Asked Questions about sf-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run Apex tests with coverage analysis in Salesforce?

Apex test execution with coverage analysis automates running single classes, test suites, or all local tests while measuring code coverage. This Skill executes tests via sf apex commands, analyzes failures, and generates coverage reports to identify untested code paths.

What's the best way to write fast Apex unit tests using mocks?

Mocking DML and SOQL operations eliminates real database calls, making tests run faster and more reliably. Mock frameworks and test data factories reduce dependencies and enable tests to run in isolation without external system calls or governor limits.

How do I fix failing Apex tests automatically?

Agentic test-fix loops iteratively repair test failures by analyzing failure patterns, generating corrections, and re-executing tests with safety checks for governor limits. This workflow discovers issues, executes tests, analyzes results, and applies fixes in cycles.

Can I run bulk Apex tests with large datasets in Salesforce?

Bulk testing patterns support executing tests with 251+ records through phase-based workflows that manage test data, execute suites, and analyze results. This approach handles high-volume scenarios while maintaining test reliability and coverage insights.

Do I need a test data factory to use this testing approach?

Test data factories are recommended to generate consistent, reusable test data across test classes. They work alongside mock frameworks to provide both realistic data structures and isolated test execution without hitting real DML operations.

What happens if my Apex tests hit governor limits?

The agentic fix loop includes governor-limit safety checks to detect and handle limit violations during test execution. This prevents tests from failing due to resource constraints and triggers corrective adjustments in the repair cycle.