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

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).
主站蜘蛛池模板: 金阳县| 九寨沟县| 柘荣县| 威信县| 桐城市| 凌海市| 德格县| 邓州市| 伊宁县| 浠水县| 平原县| 开鲁县| 江门市| 开原市| 祁东县| 河北区| 沾化县| 乌兰县| 大港区| 东兰县| 台东县| 永清县| 永嘉县| 汶川县| 镇雄县| 千阳县| 抚松县| 海林市| 赤壁市| 新沂市| 高要市| 福建省| 武城县| 宕昌县| 万宁市| 铜梁县| 汉寿县| 荔浦县| 聊城市| 桦甸市| 深水埗区|