Files
nexus/wiki/concepts/Test-Driven-Development.md
2026-04-20 00:02:56 +08:00

33 lines
855 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
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