Backend testing strategies and test automation. Unit, integration, E2E, and load testing with best practices.
Generates unit, integration, and load tests with best practices. Use when you need to write test files or configure test frameworks like pytest and k6.
/plugin marketplace add pluginagentmarketplace/custom-plugin-backend/plugin install backend-development-assistant@pluginagentmarketplace-backendThis skill inherits all available tools. When active, it can use any tool Claude has access to.
assets/config.yamlassets/schema.jsonreferences/GUIDE.mdreferences/PATTERNS.mdscripts/validate.pyBonded to: testing-security-agent (Secondary)
# Invoke testing skill
"Write unit tests for my user service"
"Set up integration tests with database"
"Configure load testing with k6"
/\
/E2E\ Few, slow, expensive
/────\
/Integration\ Some, medium speed
/────────────\
/ Unit Tests \ Many, fast, cheap
/────────────────\
| Type | Coverage | Speed | Cost |
|---|---|---|---|
| Unit | 80%+ | Fast | Low |
| Integration | 60%+ | Medium | Medium |
| E2E | Critical paths | Slow | High |
import pytest
from unittest.mock import Mock
from app.services.user_service import UserService
class TestUserService:
@pytest.fixture
def service(self):
return UserService(db=Mock())
def test_get_user_returns_user(self, service):
service.db.get_user.return_value = {"id": 1, "name": "John"}
result = service.get_user(1)
assert result["name"] == "John"
service.db.get_user.assert_called_once_with(1)
def test_get_user_raises_when_not_found(self, service):
service.db.get_user.return_value = None
with pytest.raises(UserNotFoundError):
service.get_user(999)
import pytest
from fastapi.testclient import TestClient
from app.main import app
from app.database import get_db
@pytest.fixture
def client(test_db):
def override_get_db():
return test_db
app.dependency_overrides[get_db] = override_get_db
with TestClient(app) as c:
yield c
def test_create_and_get_user(client):
# Create user
response = client.post("/users", json={"email": "test@example.com"})
assert response.status_code == 201
user_id = response.json()["id"]
# Get user
response = client.get(f"/users/{user_id}")
assert response.status_code == 200
assert response.json()["email"] == "test@example.com"
import http from 'k6/http';
import { check, sleep } from 'k6';
export const options = {
stages: [
{ duration: '30s', target: 100 },
{ duration: '1m', target: 100 },
{ duration: '30s', target: 0 },
],
thresholds: {
http_req_duration: ['p(95)<200'],
http_req_failed: ['rate<0.01'],
},
};
export default function () {
const res = http.get('http://localhost:8000/api/v1/users');
check(res, {
'status is 200': (r) => r.status === 200,
'response time < 200ms': (r) => r.timings.duration < 200,
});
sleep(1);
}
| Issue | Cause | Solution |
|---|---|---|
| Flaky tests | Race conditions | Use mocks, fix async |
| Slow suite | Too many E2E | Optimize pyramid |
| Low coverage | Untested edges | Add boundary tests |
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.