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

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).
主站蜘蛛池模板: 浦城县| 商洛市| 海伦市| 靖边县| 拜泉县| 临江市| 宜君县| 宁陕县| 北流市| 介休市| 元谋县| 梓潼县| 宝丰县| 新竹市| 林甸县| 武清区| 龙山县| 永新县| 东光县| 六枝特区| 炎陵县| 阿巴嘎旗| 汤原县| 若羌县| 四会市| 南溪县| 宿松县| 祁阳县| 自治县| 山西省| 平和县| 深圳市| 万山特区| 彰化市| 高平市| 金寨县| 九江县| 乐至县| 平昌县| 华池县| 邹城市|