Individual skill
tdd
测试驱动开发。当用户想以测试先行构建功能或修复 bug、提到 "red-green-refactor",或想要集成测试时使用。
skills/engineering/tdd/SKILL.md
Source commit 30fc5dbf9380144598f3593e6c1e22c713a52c2a
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- No
- Repository scan complete
- No
- Skill scan complete
- Yes
- Observed behavior
- Not checked yet
- Last checked
- Nov 7, 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.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 535
- Repository last updated
- Nov 3, 2026
- License
- MIT
Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.
- ai-agent Repository topic
- chinese Repository topic
- prompt-engineering Repository topic
- skills Repository topic
- translation Repository topic
- engineering Derived category
- 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
SKILL.mdcore · 3,561 bytesagents/openai.yamlasset · 114 bytesmocking.mddoc · 1,526 bytestests.mddoc · 2,350 bytes
Read excerpt
# 测试驱动开发(Test-Driven Development)
TDD 是红 → 绿的循环。本技能是让这个循环产出值得保留的测试的参考:好测试是什么、测试放在哪里、反模式有哪些、循环的规则是什么。每一节在每一个循环中都适用——在循环之前和之中查阅它们,而不是之后。
探索代码库时,读 `GLOSSARY.md`(如果存在),让测试名称和接口词汇与项目的领域语言一致,并尊重你正在触碰的区域的 ADR。
## 好测试是什么
测试通过公共接口验证行为,而不是实现细节。代码可以彻底改变;测试不应该。好测试读起来像一份规格——"用户可以用有效购物车结账"精确地告诉你存在什么能力——而且因为它不关心内部结构,能在重构中存活。
示例见 [tests.md](tests.md),mocking 指南见 [mocking.md](mocking.md)。
## 接缝——测试放在哪里