test-driven-development
应用测试驱动开发
团队经常在代码之后才添加测试,从而漏掉已破坏的行为。此技能通过红灯、绿灯和重构检查点强制执行测试优先的工作方式。
使用我的智能体安装
将此请求复制给你的智能体,其中包含权威 Skill 页面和清单。
Review the Skillstore skill "test-driven-development" from https://skillstore.io/skills/codingcossack-test-driven-development.md and its manifest at https://skillstore.io/api/skills/codingcossack-test-driven-development/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.你的智能体仍应展示其计划,并按安全策略请求必要确认。
Agent 可读资源
当 AI Agent、爬虫或脚本需要干净上下文,而不是读取完整页面时,请使用这些链接。
测试它
正在使用“test-driven-development”。 为网络客户端添加重试行为。
预期结果:
- 第一个失败的测试,用于描述重试次数和最终成功。
- 一个只满足该测试的最小实现计划。
- 测试通过后的重构检查点。
正在使用“test-driven-development”。 修复空电子邮件地址被接受的问题。
预期结果:
- 一个在空电子邮件被接受时失败的回归测试。
- 一个让测试通过的小型验证变更。
- 建议将该测试保留为永久覆盖。
正在使用“test-driven-development”。 清理没有测试的遗留服务。
预期结果:
- 当前行为的特征测试列表。
- 在测试保持绿色的情况下进行安全重构的顺序。
- 新行为的边界:必须先使用失败的测试。
安全审计
安全All 29 static findings were adjudicated as false positives. The detections are Markdown fences, TypeScript snippets, local npm test examples, inline test API names, and a retry test-list bullet, with no malicious execution or network reconnaissance. No prompt injection or semantic security issue was found.
风险因素
⚙️ 外部命令 (28)
分享与引用此报告
分享版本化评估报告、中性徽章、嵌入卡片和引用。Skillstore 只报告证据,不判断该 Skill 是否安全。
复制报告链接
https://skillstore.io/skills/codingcossack-test-driven-development/audits/8?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown 徽章
[](https://skillstore.io/skills/codingcossack-test-driven-development?utm_source=security_passport_badge)HTML 徽章
<a href="https://skillstore.io/skills/codingcossack-test-driven-development?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/codingcossack-test-driven-development/security.svg" alt="Skillstore security assessment" loading="lazy"></a>嵌入卡片
<iframe src="https://skillstore.io/embed/skills/codingcossack-test-driven-development.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>学术引用 (APA · BibTeX · CFF)
APA 引用
CodingCossack. (2026). test-driven-development security audit report (audit version 8) [Author version unspecified]. Skillstore. https://skillstore.io/skills/codingcossack-test-driven-development/audits/8BibTeX 引用
@techreport{codingcossack-codingcossack-test-driven-development-2026,
author = {CodingCossack},
title = {test-driven-development security audit report (audit version 8)},
institution = {Skillstore},
year = {2026},
number = {8},
url = {https://skillstore.io/skills/codingcossack-test-driven-development/audits/8},
note = {Author version unspecified}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "test-driven-development security audit report (audit version 8)"
version: "unspecified"
type: report
authors:
- name: "CodingCossack"
date-released: "2026-07-06"
url: "https://skillstore.io/skills/codingcossack-test-driven-development/audits/8"
identifiers:
- type: other
value: "skillstore:codingcossack-test-driven-development:audit:8"
description: "Skillstore immutable audit report identifier"
比较变体
10 个可安装变体每位作者的技能都保持为独立的可安装项。推荐变体按 Skillstore 证据排序。
为什么此变体排名第一
dmjgilbert-test-driven-development
2026-09-09
cycleaddict-test-driven-development
2026-09-09
cygnusfear-test-driven-development
2026-09-09
addyosmani-test-driven-development
2026-09-22
codingcossack-test-driven-development
2026-09-09
zhanlincui-test-driven-development
2026-09-09
Skillstore 评分
评分依据 证据置信度: 高你能构建什么
安全地实现功能
创建一个失败的测试,添加最小的通过代码,然后在测试保持绿色的情况下重构。
修复回归
在修改生产代码之前,先用失败的测试复现缺陷,然后保留该测试作为覆盖。
改进遗留代码
在重构或添加新行为之前,添加特征测试来捕获当前行为。
试试这些提示
对此功能使用测试驱动开发:[describe feature]。先从一个失败的测试开始,并在实现前等待验证。
应用 TDD 来修复此缺陷:[describe bug]。首先编写一个会因当前行为而失败的测试,并说明该回归。
帮我重构 [component or module]。先识别现有行为测试,如有需要则添加特征测试,然后保持行为不变。
审查这些测试的 TDD 质量、mock 过度使用、脆弱断言和缺失的行为覆盖。在继续实现之前,推荐具体修改。
最佳实践
- 运行新测试,并在编写生产代码之前确认它会失败。
- 断言可观察行为,而不是内部实现细节。
- 只在测试通过后重构,并保持完整测试套件为绿色。
避免
- 先编写生产行为,再事后添加测试。
- 测试 mock 是否存在,而不是真实的用户可见行为。
- 为了方便而向生产类添加仅供测试使用的方法。
常见问题
这个技能会替我编写测试吗?
我可以将它用于遗留代码吗?
每次重构都需要一个新的失败测试吗?
如果测试一开始就通过了怎么办?
它需要特定的测试框架吗?
这可以安全发布吗?
开发者详情
许可证
MIT
Skillstore 修订
r1
版本提示
作者未声明版本。
引用
d11af420e07cd866fe39cfa937efef3223896c06
维护新鲜度
2026/7/26
使用量
11 次下载 · 297 次浏览
文件结构