Skip to content
Back to skills

Testing Best Practices

ASecurity

Guidelines for implementing effective and maintainable tests.

  • 6 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 9, 2026
ai-agentsjavascriptpythongojavatestingdatabase

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned October 9, 2026

npx -y skills add MatrixFounder/Agentic-development --skill testing-best-practices --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Testing Best Practices?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Testing Best Practices
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/matrixfounder-testing-best-practices/badge)](https://www.skillsdirectory.com/skills/matrixfounder-testing-best-practices)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: testing-best-practices
description: "Guidelines for implementing effective and maintainable tests."
tier: 2
version: 1.1
---
# Testing Best Practices

## 1. Hierarchy & Strategy
- **E2E (End-to-End):** Mandatory for every task.
  - *Stub Stage:* Assert hardcoded values (verify structure).
  - *Impl Stage:* Assert real logic (verify behavior).
- **Unit:** Cover edge cases, error handling, and specific algorithms.
- **Regression:** ALWAYS run the full test suite before submitting.

## 2. Critical Rules
- **NO LLM MOCKING in Tests:** Do not mock OpenAI/Anthropic calls in standard tests. Use recorded responses (VCR.py) or separate integration environments.
- **Realism:** Minimize mocks. Test real component capability where possible.
- **Isolation:** Tests must be independent. Database state should be reset between tests.
- **Environment:** Use the project's virtual environment (e.g., `/opt/projects/.../venv`).

## 3. Naming & Structure
- **Clear Names:** `test_shoud_return_error_when_invalid_input`.
- **Organization:** Mirror source structure (`src/auth` -> `tests/auth`).
- **Docstrings:** specificy WHAT is being tested.
- **Reference Examples:**
  - Python: `examples/pytest_structure.py`
  - JavaScript: `examples/jest_structure.js`

## 4. Resources
- **Templates:** Use `assets/templates/test_boilerplate.py` to start new test files quickly.

Files in this skill

  • SKILL.md1.3 KB
  • assets/templates/test_boilerplate.py453 B
  • examples/jest_structure.js1.2 KB
  • examples/pytest_structure.py970 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…