🎯

test-writer

🎯Skill

from teachingai/full-stack-skills

VibeIndex|
What it does

Generates comprehensive test cases and strategies across unit, integration, and end-to-end testing domains with best practices and framework support.

📦

Part of

teachingai/full-stack-skills(157 items)

test-writer

Installation

Add MarketplaceAdd marketplace to Claude Code
/plugin marketplace add https://github.com/teachingai/full-stack-skills.git
Add MarketplaceAdd marketplace to Claude Code
/plugin marketplace add teachingai/full-stack-skills
Claude CodeAdd plugin in Claude Code
/plugin marketplace remove full-stack-skills
Install PluginInstall plugin from marketplace
/plugin install development-skills@full-stack-skills
Install PluginInstall plugin from marketplace
/plugin install development-skills-utils@full-stack-skills

+ 11 more commands

📖 Extracted from docs: teachingai/full-stack-skills
10Installs
-
AddedFeb 4, 2026

Skill Details

SKILL.md

Provides comprehensive guidance for writing tests including test case creation, test structure, and testing best practices. Use when the user asks about writing tests, needs to create test cases, structure tests, or implement testing strategies.

Overview

# 测试编写技能

概述

本技能帮助您编写各种类型的测试,包括单元测试、集成测试和端到端测试。

关键词: 测试编写、单元测试、集成测试、端到端测试、测试用例、测试框架

核心功能

1. 单元测试编写

  • 为函数和类编写单元测试
  • 设计测试用例覆盖各种场景
  • 使用 Mock 和 Stub 隔离依赖
  • 确保测试的独立性和可重复性

2. 集成测试设计

  • 编写模块间的集成测试
  • 测试 API 接口和数据库交互
  • 验证系统组件的协作
  • 设计测试数据和测试环境

3. 端到端测试

  • 编写完整的用户流程测试
  • 测试关键业务场景
  • 验证系统端到端的功能
  • 使用自动化测试工具

4. 测试工具和框架

  • 支持主流测试框架(JUnit, pytest, Jest 等)
  • 生成测试报告和覆盖率报告
  • 创建测试配置和测试环境
  • 设计测试数据和 Fixture

使用指南

测试编写原则

  1. 全面性: 覆盖正常流程、边界情况和异常情况
  2. 独立性: 每个测试应独立运行,不依赖其他测试
  3. 可重复性: 测试结果应一致,不受环境影响
  4. 清晰性: 测试代码应清晰易懂
  5. 快速性: 测试应快速执行

测试用例设计

  • 正常场景: 测试正常的功能流程
  • 边界情况: 测试边界值和极限情况
  • 异常情况: 测试错误处理和异常情况
  • 性能测试: 测试性能和负载(如需要)

测试覆盖率

  • 目标覆盖率: 80% 以上(根据项目需求)
  • 关键路径: 100% 覆盖
  • 边界情况: 重点覆盖
  • 异常处理: 确保覆盖

输出格式

测试代码应包含:

  • 测试文件: 完整的测试代码文件
  • 测试用例: 清晰的测试用例和描述
  • 测试数据: 测试数据和 Fixture
  • 测试配置: 测试配置文件
  • 测试报告: 测试执行结果和覆盖率

最佳实践

  • 使用 AAA 模式(Arrange-Act-Assert)
  • 测试名称应描述测试内容
  • 一个测试只测试一个功能点
  • 使用 Mock 隔离外部依赖
  • 保持测试代码简洁
  • 定期运行测试,确保通过
  • 关注测试覆盖率,但不盲目追求 100%