testing-best-practices

Guide software testing with TDD, coverage standards, and test types.

4|1|Updated Jan 4, 2026
One-click install
npx skills add https://github.com/hebertzhu/vibecoding-rules-skills --skill testing-best-practices-hebertzhu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-best-practices
Source: https://github.com/hebertzhu/vibecoding-rules-skills/tree/main/cn/skills/testing-best-practices
Command: npx skills add https://github.com/hebertzhu/vibecoding-rules-skills --skill testing-best-practices-hebertzhu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to writing effective tests, ensuring code quality, and adhering to industry best practices, reducing bugs and improving software reliability.

Core Features & Use Cases

  • TDD Workflow: Guides users through the RED-GREEN-REFACTOR cycle for test-driven development.
  • Coverage Standards: Details minimum coverage requirements (Statements, Branches, Functions, Lines) and how to check them.
  • Test Types: Explains and provides examples for Unit, Integration, and E2E tests.
  • Quality Guidelines: Covers naming conventions, AAA pattern, single assertion per test, and testing edge cases.
  • Pitfall Avoidance: Highlights common mistakes in test isolation, mocking, and async handling.
  • Use Case: When developing a new feature, follow the TDD workflow outlined here to write tests before implementation, ensuring the feature works as expected and meets coverage goals.

Quick Start

Follow the RED-GREEN-REFACTOR cycle to implement a new test.

Frequently Asked Questions about testing-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the RED-GREEN-REFACTOR cycle in test-driven development?

Test-driven development (TDD) uses the RED-GREEN-REFACTOR cycle to write failing tests, implement minimum code to pass them, and refactor safely. This ensures robust software and improves code reliability.

How do I check my code coverage standards for unit testing?

To check code coverage standards, verify that your unit testing meets the minimum requirements for statements, branches, functions, and lines. This ensures comprehensive test coverage and improves overall code quality.

What are common testing pitfalls with mocking and async handling?

Common testing pitfalls involve improper test isolation, incorrect mocking implementations, and unhandled async operations. Avoiding these mistakes ensures reliable integration testing and prevents false positives in test execution.

How do I write effective unit, integration, and e2e tests?

To write effective unit, integration, and e2e tests, follow the AAA pattern, maintain single assertions per test, and cover edge cases. This methodology ensures robust software and minimizes bugs across testing types.

When do I need e2e testing versus integration testing?

You need e2e testing to validate entire user workflows from start to finish, whereas integration testing verifies interactions between specific modules. Both test types are essential for comprehensive software testing methodologies.