Back to Skills

testing-guide

Testing pyramid and test writing standards for UT/IT/ST/E2E.Use when: writing tests, discussing test coverage, test strategy, or test naming.Keywords: test, unit, integration, e2e, coverage, mock, 測試, 單元, 整合, 端對端.

44stars10forksUpdated 2/25/2026

Security Assessment

Safe(100/100)
Security Score100/100

About testing-guide

The 'testing-guide' skill provides a set of best practices and standards for writing tests across different levels of testing, including Unit Testing (UT), Integration Testing (IT), System Testing (ST), and End-to-End Testing (E2E). It offers a systematic approach to test writing, ensuring efficient coverage and appropriate test levels for each type of test. This skill helps developers understand the testing pyramid, maintain high-quality code, and improve test reliability while reducing unnecessary complexity in testing frameworks.

The key features of the 'testing-guide' skill include coverage targets, test naming conventions, and the use of various test doubles such as mocks, stubs, fakes, and spies. It also outlines the proper patterns for writing tests, such as the AAA (Arrange, Act, Assert) pattern and FIRST principles (Fast, Independent, Repeatable, Self-validating, Timely). This skill is designed for developers working in teams that require clear, standardized testing practices to ensure consistent quality across projects.

Targeted users include software developers, QA engineers, and teams responsible for ensuring reliable and maintainable code. The skill is particularly useful for those who need to establish or refine testing strategies, define test coverage goals, and create a shared understanding of test writing practices.

FAQ

What is the testing pyramid and why is it important?

The testing pyramid represents a hierarchy of test types, with Unit Tests (UT) at the base, followed by Integration Tests (IT), System Tests (ST), and finally, End-to-End Tests (E2E) at the top. This approach encourages a greater emphasis on unit tests, which are fast and isolated, while limiting the slower and more complex E2E tests. The pyramid ensures that testing is efficient and provides good coverage without excessive overhead.

How do I implement the recommended coverage targets?

The recommended coverage targets are 85% for line coverage, 80% for branch coverage, and 90% for function coverage. These targets can be customized depending on your project needs, but they represent a solid baseline for achieving high-quality, maintainable tests. These targets should be documented in the 'CONTRIBUTING.md' file of your project to ensure consistency across team members.

What should I do if my project hasn't configured testing standards yet?

If no testing standards are configured, you can use the skill's default coverage targets or prompt the user to customize the settings. You can suggest documenting the coverage targets in the 'CONTRIBUTING.md' file under a 'Testing Standards' section to ensure consistency across the team.

Are there any specific tools or frameworks required for using this skill?

The 'testing-guide' skill is framework-agnostic, meaning it can be applied to any testing framework. However, the skill assumes that you are using common testing frameworks such as Jest, Mocha, NUnit, or PyTest, and follows naming conventions and best practices that work with most popular languages and testing tools.

How should I handle test dependencies in different test levels?

Each test level has specific requirements for handling dependencies. For Unit Tests (UT), all external dependencies should be mocked or stubbed. For Integration Tests (IT), use fakes for databases and stubs for external APIs. System Tests (ST) involve real components, but external services can be faked. End-to-End Tests (E2E) require real implementations of all components, including APIs and databases.

All Files

2 files
SKILL.md4.2 KB
View
testing-pyramid.md9.5 KB
View

Install testing-guide

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill