Why PPT is Popular >>
<< Keso的“无言”与鲁迅的“不在沉默中爆发,就在沉默中死亡”
The Three Rules of TDD [TDD的三条军规(摘要)]

Author Zhou Renjian Create@ 2006-08-28 10:07
whizz Note icon

The Three Rules of TDD

Over the years I have come to describe Test Driven Development in terms of three simple rules. They are:

  1. You are not allowed to write any production code unless it is to make a failing unit test pass.
  2. You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failures.
  3. You are not allowed to write any more production code than is sufficient to pass the one failing unit test.
TDD的三条军规 (原文最终修订于 2006-04-09 晚上09:45:01)

这些年来,我喜欢下面三条简单的规则来描述测试驱动开发:

  1. 除非这能让失败的单元测试通过,否则不允许去编写任何的产品代码。
  2. 只允许编写刚好能够导致失败的单元测试。 (编译失败也属于一种失败)
  3. 只允许编写刚好能够导致一个单元测试失败的产品代码。
本记录所在类别:
本记录相关记录: