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

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).
主站蜘蛛池模板: 兴化市| 鄂托克前旗| 广西| 长垣县| 湘阴县| 禹城市| 乌兰浩特市| 邯郸县| 高清| 湘潭县| 常山县| 沁水县| 宝应县| 华亭县| 朔州市| 罗田县| 太仓市| 大足县| 山东省| 新河县| 雅江县| 启东市| 兴仁县| 密山市| 北安市| 衡东县| 贵州省| 湟源县| 辽阳县| 繁峙县| 崇义县| 禹城市| 商城县| 湄潭县| 特克斯县| 浮梁县| 青田县| 乌拉特后旗| 阿拉善左旗| 嵩明县| 通许县|