文章是以下链接的总结:
http://sd.csdn.net/a/20110825/303570.html
http://techniquesofdesign.com/2009/01/17/that%E2%80%99s-not-tdd/
1、测试驱动开发,为了让测试发挥效用,必须较少开发人员等待测试结果的时间。
2、测试应该是测试那些不受控制的东西,对于测试所依赖的东西,应该使用模拟工具使它们处于控制之中。
“Remember, a test should test everything NOT under its control so you should mock out all dependencies to get them under your control.”
例如:通过依赖注入的方式伪造对象来模拟数据库。
So I showed him a technique called Dependency Injections that allowed him to insert a mock object instead of the database.
3、QA是来保证程序能正确的运行的。TDD是使用断言(assertion)来表现系统的关键特征。在QA里,我们用尽可能多的方法来测试系统中可能会出错的地方。在TDD里,我们用应尽可能少的测试来表现系统的关键特征。