MR
Mayur Rathi
@github
⭐ 34.1k GitHub stars

Qa-Engineering-Best-Practices

Qa-Engineering-Best-Practices是一款productivity方向的AI技能,核心价值是Comprehensive QA engineering best practices covering test strategy, test pyramid, naming conventions, assertion patterns, bug reporting, and automation guidelines for modern software projects,可用于解决开发者在productivity领域的实际问题,帮助用户提升效率、自动化重复任务或优化工作流。

Comprehensive QA engineering best practices covering test strategy, test pyramid, naming conventions, assertion patterns, bug reporting, and automation guidelines for modern software projects.

Last verified on: 2026-05-30
mkdir -p ./skills/qa-engineering-best-practices && curl -sfL https://raw.githubusercontent.com/github/awesome-copilot/main/skills/qa-engineering-best-practices/SKILL.md -o ./skills/qa-engineering-best-practices/SKILL.md

Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).

Skill Content

# QA Engineering Best Practices


A structured set of instructions for GitHub Copilot to assist with quality assurance engineering tasks including test design, automation, and defect management across any technology stack.


---


Core Testing Principles


- **Test early, test often**: Shift testing left — write tests alongside code, not after.

- **Test one thing at a time**: Each test case should verify a single behaviour or assertion.

- **Tests are first-class code**: Apply the same readability, naming, and refactoring standards to test code as to production code.

- **Fail fast**: Tests should produce clear, actionable failures that point directly to the broken behaviour.

- **Deterministic tests**: Tests must produce the same result on every run. Eliminate randomness, timing dependencies, and shared mutable state.

- **Independent tests**: No test should depend on another test's side effects. Tests must be runnable in any order.


---


Test Pyramid


Follow the test pyramid to balance coverage, speed, and maintenance cost:


| Layer | Scope | Quantity | Speed |

|-------|-------|----------|-------|

| Unit | Single function / class | Many (60–70 %) | Milliseconds |

| Integration | Module boundaries, DB, API contracts | Moderate (20–30 %) | Seconds |

| End-to-End | Full user journey across UI + backend | Few (5–10 %) | Minutes |


- Prefer unit tests for business logic and edge cases.

- Use integration tests to validate contracts between services and external dependencies.

- Reserve end-to-end tests for critical user paths and smoke suites.


---


Test Naming Conventions


Use the **Given / When / Then** (GWT) or **should_doX_whenY** pattern consistently.


text
// Good – describes scenario, action, expected result
test('should return 404 when product id does not exist')
test('given an expired token, when the user calls /me, then it returns 401')

// Bad – vague, implementation-focused
test('test1')
test('check user')

- Group related tests in `describe` / `context` blocks named after the unit under test.

- Use `it` or `test` for individual cases.

- Test names must be readable as standalone sentences.


---


Assertion Best Practices


- **One logical assertion per test** where practical; avoid asserting multiple unrelated things.

- Use **specific matchers** over equality checks (`toContain`, `toBeGreaterThan`, `toMatchObject`).

- Always assert the **exact expected value**, not just truthiness (`expect(result).toBe(42)` not `expect(result).toBeTruthy()`).

- For exception testing, assert both the exception type and message.

- Prefer **positive assertions** over negative ones when testing the happy path.


typescript
// Good
expect(response.status).toBe(200);
expect(response.body.items).toHaveLength(3);

// Avoid
expect(response).toBeTruthy();
expect(response.body).not.toBeNull();

---


Test Data Management


- Use **factories or builders** to create test data — avoid hardcoding raw objects in every test.

- Keep test data **minimal**: only include fields relevant to the test.

- Use **unique identifiers** per test run to avoid collision in shared environments.

- Never use production data or PII in tests.

- Reset or isolate state between tests (in-memory DB, transactions rolled back, mocked dependencies).


---


Mocking and Stubbing Guidelines


- Mock **at the boundary** (HTTP clients, DB adapters, message queues) — not deep inside business logic.

- Prefer **real implementations** for pure functions and simple value objects.

- Stubs return controlled data; mocks additionally verify interactions — choose the right tool.

- Reset all mocks between tests to prevent state leakage.

- Document why a dependency is mocked if the reason is non-obvious.


---


API Testing


- Validate **status code**, **response schema**, **headers**, and **response time** for every endpoint.

- Test all **HTTP methods** the endpoint exposes (GET, POST, PUT, PATCH, DELETE).

- Cover **authentication and authorisation** paths: valid token, expired tok

🎯 Best For

  • QA engineers
  • Developers writing unit tests
  • UI designers
  • Product designers
  • Claude users

💡 Use Cases

  • Generating test cases for edge conditions
  • Writing integration test suites
  • Generating component mockups
  • Creating design system tokens

📖 How to Use This Skill

  1. 1

    Install the Skill

    Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.

  2. 2

    Load into Your AI Assistant

    Open Claude or GitHub Copilot and reference the skill. Paste the SKILL.md content or use the system prompt tab.

  3. 3

    Apply Qa-Engineering-Best-Practices to Your Work

    Provide context for your task — paste source material, describe your audience, or share existing work to guide the AI.

  4. 4

    Review and Refine

    Edit the AI output for accuracy, tone, and completeness. Add human insight where the AI lacks context.

❓ Frequently Asked Questions

Does this generate test mocks?

Many testing skills include mock generation. Check the install command and skill content for details.

Does this work with Figma?

Some design skills integrate with Figma plugins. Check the Works With section for supported tools.

How do I install Qa-Engineering-Best-Practices?

Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/qa-engineering-best-practices/SKILL.md, ready to use.

Can I customize this skill for my team?

Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.

⚠️ Common Mistakes to Avoid

Not testing edge cases

AI tends to generate happy-path tests. Manually review for boundary conditions.

Skipping usability testing

AI-generated designs should be validated with real users before development.

Not reading the full skill

Skills contain important context and edge cases beyond the quick start.

🔗 Related Skills