SKILL

tdd

测试驱动开发。用户希望先写测试再开发功能或修复缺陷、提到“红灯—绿灯—重构”,或希望编写集成测试时使用。

译文已校对
查看英文原文

Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.

适用对象:软件开发与测试。自动收录 · 待核查。

原作者说明节选

从固定版本的 SKILL.md 提取,保留原文语言。以下内容属于作者说明,本站尚未验证安装、兼容或运行结果。

查看英文原文

原文涵盖的主题

  • Test-Driven Development
  • What a good test is
  • Seams: where tests go
  • Anti-patterns
  • Rules of the loop

TDD is the red → green loop. This skill is the reference that makes that loop produce tests worth keeping: what a good test is, where tests go, the anti-patterns, and the rules of the loop. Every section applies on every cycle: consult them before and during the loop, not after. When exploring the codebase, read GLOSSARY.md (if it exists) so test names and interface vocabulary match the project's domain language, and respect ADRs in the area you're touching. Tests verify behavior through public interfaces, not implementation details. Code can change entirely; tests shouldn't. A good test reads like a specification: "user can checkout with valid cart" tells you exactly what capability exists, and it survives refactors because it doesn't care about internal structure. See tests.md for examples and mocking.md for mocking guidelines. A seam is the public boundary you test at: the interface where you observe behavior without reaching inside. Tests live at seams, never against internals. Test only at pre-agreed seams. Before writing any test, write down the seams under test and confirm them with the user. No test is written at an unconfirmed seam. You can't test everything, so agreeing t

这里只展示节选,请以完整原文和当前要求为准。

来源仓库
mattpocock/skills
源文件
skills/engineering/tdd/SKILL.md
固定版本
4ae2317ddb22b046e26455e4f9c9b3aaaf62212d
阅读完整原作者说明 ↗

来源与内容状态

本条为自动发现的元数据,尚未完成人工文档核查;适用性与运行结果待核查。

原作者:Matt Pocock Skills · 原作者仓库元数据。文档核查:未核查。最近来源检查:2026-11-10T21:01:23.412Z。

分类由名称、说明与路径规则生成,分类不代表已核实适配。

许可与权利归属

MIT。第三方内容及版权归原作者,使用条件以原文为准。

许可原文 ↗

本站没有因同步、复制或用户自报成功而将资源标为运行验证通过。

限制与注意事项

  • 元数据收录不代表本站已经安装、适配、实测或进行安全审查。