What problem does it solve?
This skill helps Salesforce developers create well-structured Apex unit tests that increase code coverage, catch governor limit issues, and reduce deployment failures due to insufficient tests.
Core Features & Use Cases
- Test structure & naming: Enforces Arrange-Act-Assert patterns and standardized test method names for readability and maintainability.
- TestDataFactory & TestSetup: Promotes centralized factory classes and TestSetup usage to produce consistent data and isolated transactions across tests.
- Governor limit and async testing: Covers bulk-trigger scenarios, Queueable/@future execution, and use of Test.startTest/Test.stopTest to validate limits and asynchronous behavior.
- Mocks and stubs: Shows HttpCalloutMock, multi-callout mock patterns, and System.createStub usage for dependency injection and deterministic tests.
- Coverage strategy: Advises branch testing, use of @testFor and RunRelevantTests when available, and practical approaches to reach target coverage thresholds.
Quick Start
Ask the sf-apex-testing skill to audit a failing deployment and generate concrete test methods, factory patterns, and mock implementations to raise coverage and verify governor-limit behavior.