Testing strategies, test pyramid guidance, and quality assurance patterns for PACT Test phase. Use when: designing test suites, implementing unit tests, integration tests, E2E tests, performance testing, security testing, or determining test coverage priorities. Triggers on: test design, unit testing, integration testing, E2E testing, test coverage, test pyramid, mocking, fixtures, performance testing, test phase.
View on GitHubProfSynapse/PACT-prompt
PACT
January 25, 2026
Select agents to install to:
npx add-skill https://github.com/ProfSynapse/PACT-prompt/blob/main/pact-plugin/skills/pact-testing-strategies/SKILL.md -a claude-code --skill pact-testing-strategiesInstallation paths:
.claude/skills/pact-testing-strategies/# PACT Testing Strategies
Testing guidance for the Test phase of PACT. This skill provides frameworks
for designing comprehensive test suites and links to detailed testing patterns.
## Test Pyramid
The test pyramid guides the distribution of test types for optimal coverage and speed.
```
/\
/ \ E2E Tests (Few)
/ \ - Critical user journeys
/ E2E \ - Slow, expensive
/--------\
/ \ Integration Tests (Some)
/Integration \ - API contracts
/--------------\ - Service interactions
/ \
/ Unit Tests \ Unit Tests (Many)
/ \ - Fast, isolated
/______________________\ - Business logic
```
### Coverage Targets
| Layer | Target | Focus | Speed |
|-------|--------|-------|-------|
| **Unit** | 80%+ line coverage | Business logic, edge cases | <1s per test |
| **Integration** | Key paths covered | API contracts, data flow | <10s per test |
| **E2E** | Critical flows only | User journeys, happy paths | <60s per test |
---
## Unit Testing Patterns
### Arrange-Act-Assert (AAA)
```javascript
describe('OrderService', () => {
describe('calculateTotal', () => {
it('should apply discount for orders over $100', () => {
// Arrange
const orderService = new OrderService();
const items = [
{ price: 50, quantity: 2 },
{ price: 20, quantity: 1 }
];
// Act
const total = orderService.calculateTotal(items);
// Assert
expect(total).toBe(108); // $120 - 10% discount
});
});
});
```
### Test Behavior, Not Implementation
```javascript
// BAD: Testing implementation details
it('should call repository.save once', () => {
await userService.createUser(userData);
expect(userRepository.save).toHaveBeenCalledTimes(1);
});
// GOOD: Testing behavior
it('should create a user with has