码迷,mamicode.com
首页 > 其他好文 > 详细

The Three Rules/Laws of TDD

时间:2019-12-22 12:24:41      阅读:75      评论:0      收藏:0      [点我收藏+]

标签:产品   res   允许   blog   less   tail   article   代码   href   

  1. You are not allowed to write any production code unless it is to make a failing unit test pass.

除非为了使一个失败的unit test通过,否则不允许编写任何产品代码

  1. You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failures.

在一个单元测试中只允许编写刚好能够导致失败的内容(编译错误也算失败)

  1. You are not allowed to write any more production code than is sufficient to pass the one failing unit test.

只允许编写刚好能够使一个失败的unit test通过的产品代码

中英双语

中文翻译

The Three Rules/Laws of TDD

标签:产品   res   允许   blog   less   tail   article   代码   href   

原文地址:https://www.cnblogs.com/roastpiglet/p/12079196.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!