The Three Rules/Laws of TDD
Posted roastpiglet
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了The Three Rules/Laws of TDD相关的知识,希望对你有一定的参考价值。
- You are not allowed to write any production code unless it is to make a failing unit test pass.
除非为了使一个失败的unit test通过,否则不允许编写任何产品代码
- You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failures.
在一个单元测试中只允许编写刚好能够导致失败的内容(编译错误也算失败)
- 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的主要内容,如果未能解决你的问题,请参考以下文章
return three values that can be the lengths of the sides of a triangle,
CF1006C Three Parts of the Array
a period of three years和three years有啥区别
三江源区高寒草地地上生物量遥感反演模型研究 Modeling Aboveground Biomass of Alpine Grassland in the Three-River Headwaters