About TDD(Test Driven Development)

看到一点关于TDD(Test Driven Development)的精辟论述,原文如下:

Actually,writing unit test makes you think (or,design). For example,with TDD method,you can hardly write tight-coupled code,because it's difficult to write test for them. That's why I always say that TDD does not slow down your development. Without TDD,do you spend all the time on coding? Absolutely no. Still lots of time spent on thinking and designing,however you don't have an approach to record the result of thinking. TDD is something makes you think accurately,and record the result,and prove it again and again.

(实际上,做单元测试会促使你去思考或去设计.例如,使用TDD方法,你几乎不能去写一个高聚合的代码,因为去为他们写测试是很困难的事情.这就是为什么我们常常说的,TDD不会减慢你的开发速度.如果没有TDD,你会把你的全部时间都花费在写代码上吗???绝对是不可能的,你仍然会有许多时间在思考,在设计,然而,你却没有一个方法去记录你思考的结果.TDD是一个使你精准的去思考,并且可以一遍一遍的去证明你思考的结果的好小编....)

我们要测试先行!

相关文章

什么是设计模式一套被反复使用、多数人知晓的、经过分类编目...
单一职责原则定义(Single Responsibility Principle,SRP)...
动态代理和CGLib代理分不清吗,看看这篇文章,写的非常好,强...
适配器模式将一个类的接口转换成客户期望的另一个接口,使得...
策略模式定义了一系列算法族,并封装在类中,它们之间可以互...
设计模式讲的是如何编写可扩展、可维护、可读的高质量代码,...