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

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).
主站蜘蛛池模板: 宜城市| 宁远县| 娄底市| 平凉市| 三明市| 桐梓县| 嘉禾县| 南华县| 平安县| 云浮市| 石首市| 盐城市| 定边县| 桦南县| 晋州市| 施甸县| 碌曲县| 沽源县| 福贡县| 开封市| 航空| 安阳市| 武强县| 鄂托克前旗| 西安市| 海口市| 小金县| 蕉岭县| 封丘县| 潢川县| 清流县| 山西省| 江达县| 河曲县| 栾川县| 固镇县| 庄河市| 南宁市| 汾西县| 抚远县| 弥渡县|