Individual skill
qa/unit-testing
单元测试方法论,覆盖 AAA 模式、Test Doubles、跨语言示例(JS/TS、Python、Go、Java)、前后端单元测试、边界与属性测试、变异测试
skill/skills/qa/unit-testing/SKILL.md
Source commit d5646446c812a6bf954240fbe5b6df5114b2c937
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- No
- Repository scan complete
- No
- Skill scan complete
- No
- Observed behavior
- Not checked yet
- Last checked
- Nov 6, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
Standard SKILL.md format has not been attested at this commit. No installation command is available; inspect the source.
Repository context
- Repository stars (not skill ratings)
- 546
- Repository last updated
- Nov 8, 2026
- License
- MIT
Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.
- ai-agents Repository topic
- bmad Repository topic
- bmad-workflow Repository topic
- claude-code Repository topic
- cursor Repository topic
- skill Repository topic
- trae Repository topic
- testing Derived category
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Browse files
Read excerpt
# 单元测试方法论
## 单元测试的定义与原则
单元测试验证**最小可测试单元**(函数、方法、类、组件)的行为,隔离外部依赖。
### 核心原则
| 原则 | 说明 |
| -------- | ------------------------------------------------ |
| **隔离** | 一个测试只验证一个行为,不依赖其他测试或外部系统 |
| **快速** | 毫秒级执行,全部单元测试应在秒级完成 |
| **确定** | 相同输入多次运行结果一致,不依赖时间/网络/随机数 |
| **可读** | 测试代码即文档,命名清晰表达意图 |