官术网_书友最值得收藏!

Speed is the key

Imagine a game of ping pong (or table tennis). The game is very fast; sometimes it is hard even to follow the ball when professionals play the game. TDD is very similar. TDD veterans tend not to spend more than a minute on either side of the table (test and implementation). Write a short test and run all tests (ping), write the implementation and run all tests (pong), write another test (ping), write the implementation of that test (pong), refactor and confirm that all tests are passing (score), and then repeat—ping, pong, ping, pong, ping, pong, score, serve again. Do not try to make the perfect code. Instead, try to keep the ball rolling until you think that the time is right to score (refactor).


Time between switching from tests to implementation (and vice versa) should be measured in minutes (if not seconds).
主站蜘蛛池模板: 贞丰县| 永清县| 万源市| 监利县| 温州市| 墨脱县| 孟津县| 渭源县| 获嘉县| 邻水| 临洮县| 静海县| 保康县| 四会市| 合江县| 镇远县| 双江| 娄烦县| 钟祥市| 商丘市| 赞皇县| 上高县| 五莲县| 平度市| 连平县| 广昌县| 阜南县| 高淳县| 长治县| 高尔夫| 晋城| 克拉玛依市| 山东| 无锡市| 读书| 平湖市| 新源县| 紫金县| 宁夏| 勃利县| 历史|