2010年11月25日 星期四

TDD Test-driven development

TDD forces you to think through the testing process before you write the code.
TDD 強迫你要寫 code 前先把流程想過一遍。

Every developer has the experience of writing a class in one big bunch, making assumptions along the way. Then when it comes time to actually use the class, you realize that some of your assumptions were wrong, and you have to refactor the original code.

寫了一大堆才發現寫錯,這時候要重構就痛苦了。

沒有留言:

張貼留言