Extreme Programming · Archive
XP 12项核心实践
从开发过程、代码与设计,到团队协作,重新梳理 Kent Beck 所提出的 Extreme Programming(XP)核心实践。
归档来源:《Extreme Programming Explained: Embrace Change》 · Kent Beck · 1999
XP 的实践并不是彼此孤立的技巧,而是一套围绕反馈、沟通、简单性与持续交付建立的工程协作方式。以下按原有三组结构归档,中文为主,保留英文原意说明。
01 — Process & Release
开发过程实践
01
计划游戏
The Planning Game
结合业务优先级与技术工作量评估,快速确定下一个迭代/发布的范围。
Quickly determine the scope of the next release by combining business priorities and technical estimates.
02
小型发布
Small Releases
快速将简单系统投入生产,随后以极短的周期持续发布新版本。
Put a simple system into production quickly, then release new versions on very short cycles.
03
隐喻
Metaphor
用全团队通用的简单故事/比喻来引导整个系统的工作原理与架构视角。
Guide all development with a simple shared story of how the whole system works.
04
现场客户
On-site Customer
让真实用户或业务代表全职驻留团队,实时解答疑问与验收功能。
Include a real, live user on the team, available full-time to answer questions.
02 — Engineering & Quality
代码与设计实践
05
简单设计
Simple Design
任何时刻都保持最简设计(YAGNI/KISS),一旦发现多余的复杂度立即移除。
The system should be designed as simply as possible at any given moment. Extra complexity is removed as soon as it is discovered.
06
测试驱动开发
Testing / TDD
持续编写自动化测试,所有测试必须完全通过才能继续后续开发(红-绿-重构)。
Programmers continually write unit tests, which must pass completely for development to continue.
07
重构
Refactoring
在不改变外部行为的前提下调整代码结构,消除重复、提升清晰度与灵活性。
Programmers restructure the system without changing its behavior to remove duplication, simplify, or add flexibility.
03 — Team & Environment
团队协作实践
08
结对编程
Pair Programming
所有生产代码均由两位程序员在一台电脑上共同编写(Driver & Navigator)。
All production code is written with two programmers at one machine.
09
集体代码所有权
Collective Ownership
消除知识孤岛,团队中任何人可以在任何时间修改系统中的任意代码。
Anyone can change any code anywhere in the system at any time.
10
持续集成
Continuous Integration
每完成一个任务就集成并构建系统,保持每天多次的高频集成。
Integrate and build the system many times a day, every time a task is completed.
11
每周40小时工作制
40-Hour Week
保持可持续的开发节奏(Sustainable Pace),拒绝连续加班以维持高代码质量。
Work no more than 40 hours a week as a rule. Never work a second week of overtime in a row.
12
编码标准
Coding Standards
统一团队编码规范,强调通过代码本身传递清晰的意图与沟通。
Programmers write all code in accordance with rules emphasizing communication through the code.