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

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).
主站蜘蛛池模板: 新化县| 洛阳市| 福贡县| 南京市| 安福县| 韶山市| 靖边县| 巴东县| 牡丹江市| 浙江省| 科技| 临夏市| 张家界市| 寿阳县| 龙门县| 句容市| 灵石县| 庆云县| 玛沁县| 江源县| 龙岩市| 团风县| 东源县| 兴义市| 化隆| 庆安县| 武义县| 乡城县| 麻栗坡县| 云和县| 汤阴县| 临颍县| 仙游县| 宁德市| 彩票| 华亭县| 内江市| 普定县| 深水埗区| 探索| 鲁山县|