testing-quality
Skill1 starsChanged 3 months agoMITView on GitHub
Comprehensive testing strategy across unit, integration, smoke, and regression tests using pytest, fixtures, vitest, and code quality tools.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- chenmijiang/cmj_toolstheir own version, first seen Oct 15, 2026
- yiweiwan/skillstheir own version, first seen May 12, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- yiweiwan/skills★ 1same name
- chenmijiang/cmj_tools★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository30 other files it gives its agents.
- AGENTS.mdAGENTS.md
- adr-managementSkill
- agentic-developmentSkill
- ci-cdSkill
- code-architectureSkill
- database-postgresqlSkill
- data-engineeringSkill
- debuggingSkill
- deep-learningSkill
- dependency-managementSkill
- deploymentSkill
- dockerSkill
- documentation-orchestratorSkill
- documentationSkill
- environment-guardrailsSkill
- frontend-react-typescriptSkill
- git-githubSkill
- machine-learningSkill
- observabilitySkill
- performance-optimizationSkill
- portfolio-readinessSkill
- project-bootstrapSkill
- project-knowledgeSkill
- python-apiSkill
- python-environmentSkill
- rag-ocr-llmSkill
- release-engineeringSkill
- reusable-componentsSkill
- security-secretsSkill
- supply-chain-securitySkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use this skill when:
- Distinctive: line 16
Never consider any engineering task complete until tests have been executed and verified.
- Very specific: line 25
Existing Test Fixtures: Look in tests/conftest.py for database mocks, client fixtures (AsyncClient, TestClient), and synthetic data …
- Distinctive: line 26
Current Test Pass Rate: Run existing tests before making code changes to establish a clean baseline.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Testing & Quality Skill
1. When Should I Use This?
Use this skill when:
- Writing unit, integration, or regression tests for backend APIs, ML pipelines, or frontend components.
- Verifying code changes after a bug fix or feature addition.
- Setting up testing harnesses, fixtures, mocks, and coverage reporting.
- Enforcing quality gates (linting, formatting, type checking, security static analysis).
Never consider any engineering task complete until tests have been executed and verified.
2. What Should I Inspect First?
- Test Runner & Config:
- Python: Check
pytest.ini,[tool.pytest.ini_options]inpyproject.toml, orconftest.py. - Frontend: Check
vitest.config.ts,jest.config.js, ornpm testscript.
- Python: Check
- Existing Test Fixtures: Look in
tests/conftest.pyfor database mocks, client fixtures (AsyncClient,TestClient), and synthetic data generators. - Current Test Pass Rate: Run existing tests before making code changes to establish a clean baseline.
3. What Workflow Should I Follow?
Establish Baseline Test State
↓
Implement / Modify Feature or Fix
↓
Write / Update Focused Unit Tests (fast, isolated, mocked I/O)
↓
Write / Update Integration Tests (database transactions, API contracts)
↓
Run Code Quality Suite (Ruff, ESLint, Mypy/TypeScript)
↓
Execute Full Test Suite + Measure Coverage
↓
Inspect Diff to Ensure No Test TamperingThe Testing Pyramid Structure
▲
/ \ Smoke / E2E Tests (5-10%)
/ \ - Complete API lifecycle, Docker health, live ping
/─────\
/ \ Integration Tests (20-30%)
/ \ - Real DB queries, Redis cache, multi-service flows
/───────────\
/ \ Unit Tests (60-70%)
/ \ - Pure business logic, schemas, transforms, math
/─────────────────\Robust Pytest Harness Example (conftest.py)
# tests/conftest.py
import pytest
from fastapi.testclient import TestClient
from app.main import app
from app.api.v1.dependencies.database import get_db
class MockDB:
def __init__(self):
self.storage = {}
def get(self, item_id: str):
return self.storage.get(item_id)
def save(self, item_id: str, data: dict):
self.storage[item_id] = data
return data
@pytest.fixture
def mock_db():
return MockDB()
@pytest.fixture
def client(mock_db):
def override_get_db():
return mock_db
app.dependency_overrides[get_db] = override_get_db
with TestClient(app) as test_client:
yield test_client
app.dependency_overrides.clear()Writing Deterministic Unit & Integration Tests
# tests/unit/test_validation.py
import pytest
from pydantic import ValidationError
from app.schemas.auth import UserRegisterSchema
def test_user_register_schema_valid():
data = {"email": "user@example.com", "password": "SecurePassword123!"}
user = UserRegisterSchema(**data)
assert user.email == "user@example.com"
def test_user_register_schema_invalid_email():
with pytest.raises(ValidationError):
UserRegisterSchema(email="not-an-email", password="123")# tests/integration/test_api_endpoints.py
def test_create_and_fetch_document(client):
payload = {"title": "Contract Spec", "content": "Sample OCR content"}
response = client.post("/api/v1/documents", json=payload)
assert response.status_code == 201
doc_id = response.json()["id"]
get_resp = client.get(f"/api/v1/documents/{doc_id}")
assert get_resp.status_code == 200
assert get_resp.json()["title"] == "Contract Spec"4. What Decisions Should I Make?
| Testing Need | Tool / Strategy |
| HTTP API Testing | httpx.AsyncClient (for async FastAPI) or fastapi.testclient.TestClient |
| External Service Mocking | unittest.mock.patch or pytest-mock (for LLMs, Stripe, S3, OCR models) |
| Frontend UI Testing | vitest + @testing-library/react |
| Coverage Threshold | Target >= 80% coverage on domain and service layers; 100% on security/auth utilities. |
5. What Should I Avoid?
- NEVER delete or skip failing tests: Fix the underlying regression rather than annotating
@pytest.mark.skipor commenting tests out. - NEVER rely on live network in unit tests: Unit tests must not call live external APIs (OpenAI, AWS S3, external payment gateways).
- NEVER make tests order-dependent: Each test must be completely isolated, creating and destroying its own fixture state.
- NEVER mock what you want to test: Mock only external boundary dependencies, not the internal code under test.
6. How Should I Verify Success?
# 1. Run full test suite with verbose output
pytest -v --tb=short
# 2. Run coverage report
pytest --cov=app --cov-report=term-missing
# 3. Run linting and static typing
ruff check .
ruff format --check .
mypy app/
# 4. Frontend verification
npm run lint
npm run type-check
npm test -- --runDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

