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