Auto-sync: 2026-04-20 00:02

This commit is contained in:
2026-04-20 00:02:56 +08:00
parent 8341ee6cc4
commit 6ab2838935
104 changed files with 4077 additions and 31 deletions

View File

@@ -0,0 +1,33 @@
---
title: "Test-Driven Development"
type: concept
tags:
- Testing
- Development
- TDD
date Added: 2026-04-19
---
## Summary
测试驱动开发Test-Driven DevelopmentTDD是一种软件开发方法论先写测试再实现功能确保聚焦开发目标并构建全面的测试套件。
## Definition
测试驱动开发是一种迭代开发方法论,通过先编写测试来定义期望行为,然后编写最小代码通过测试,最后重构改进。
## Workflow
1. 编写测试Red定义期望行为
2. 实现代码Green编写最小代码通过测试
3. 重构Refactor优化代码结构
## Benefits
- 确保功能可测试
- 构建全面测试套件
- 聚焦开发目标
- 提高代码质量
## Sources
- [[ctp-topic-56-automated-infrastructure-testing]]
## Aliases
- TDD
- Test-Driven Development