Chinaunix首页 | 论坛 | 博客
  • 博客访问: 209194
  • 博文数量: 136
  • 博客积分: 2919
  • 博客等级: 少校
  • 技术积分: 1299
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-11 09:08
文章分类

全部博文(136)

文章存档

2013年(1)

2011年(135)

我的朋友

分类: 项目管理

2011-04-01 08:48:46

from Kent Beck. Test-Driven Development by Example.

1. Test-Driven Development Simple Rules:
  • Write new code only if an auomated test has failed
  • Eliminate duplication
2. TDD Generating Rules:
  • We must design organically, with running code providing feedback between decisions.
  • We must write our own tests, because we can't wait 20 times per day for someone else to write a test.
  • Our development environment must provide rapid reponse to small changes.
  • Our designs must consist of many highly cohesive, loosely coupled components, just to make testing easy.

3. The Order of Programming:
  • Red---Write a little test that doesn't work, and perhaps dosn't even compile at first.
  • Green---Make the test work quickly, committing whatever sins necessary in the process.
  • Refactor---Eliminate all of the duplication created in merely getting the test to work.

Red/green/refactor---the TDD mantra.


阅读(430) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~