- Test-Driven Java Development(Second Edition)
- Alex Garcia Viktor Farcic
- 149字
- 2021-06-24 18:31:43
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).
推薦閱讀
- Learning Scala Programming
- C語言程序設計實踐教程(第2版)
- DBA攻堅指南:左手Oracle,右手MySQL
- Java應用與實戰
- Java Web基礎與實例教程(第2版·微課版)
- CentOS 7 Linux Server Cookbook(Second Edition)
- VMware虛擬化技術
- Java Web程序設計任務教程
- Linux C編程:一站式學習
- HTML5+CSS3 Web前端開發技術(第2版)
- C++反匯編與逆向分析技術揭秘(第2版)
- Python預測之美:數據分析與算法實戰(雙色)
- 例說FPGA:可直接用于工程項目的第一手經驗
- 從零開始學Unity游戲開發:場景+角色+腳本+交互+體驗+效果+發布
- 程序員的英語