- 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).
推薦閱讀
- Reporting with Visual Studio and Crystal Reports
- Python數(shù)據(jù)分析入門與實戰(zhàn)
- 編寫高質(zhì)量代碼:改善C程序代碼的125個建議
- Python程序設(shè)計
- ASP.NET 3.5程序設(shè)計與項目實踐
- Oracle從入門到精通(第5版)
- 組態(tài)軟件技術(shù)與應用
- Python算法指南:程序員經(jīng)典算法分析與實現(xiàn)
- SSM開發(fā)實戰(zhàn)教程(Spring+Spring MVC+MyBatis)
- Mastering Docker
- Sails.js Essentials
- Apache Solr PHP Integration
- Deep Learning for Natural Language Processing
- Tableau Dashboard Cookbook
- SAS編程演義