- Test-Driven iOS Development with Swift 4(Third Edition)
- Dr. Dominik Hauser
- 141字
- 2021-07-02 15:39:39
Refactor
During the green step, you write just enough code to make all the tests pass again. As I just mentioned, it doesn't matter what the code looks like in the green step. In the refactor step, you should improve the code. You remove duplication, extract common values, and so on. Do what is needed to make the code as good as possible. The tests help you to not break already implemented features while refactoring.
Don't skip this step. Always try to think how you can improve the code after you have implemented a feature. Doing so helps to keep the code clean and maintainable. This ensures that it is always in good shape.
As you have written only a few lines of code since the last refactor step, the changes needed to make the code clean shouldn't take much time.
推薦閱讀
- Apache Oozie Essentials
- CMDB分步構建指南
- Linux C/C++服務器開發實踐
- 單片機C語言程序設計實訓100例:基于STC8051+Proteus仿真與實戰
- Responsive Web Design with HTML5 and CSS3
- 數據結構簡明教程(第2版)微課版
- Java程序設計與計算思維
- Python王者歸來
- Mastering Google App Engine
- 重學Java設計模式
- Mastering RStudio:Develop,Communicate,and Collaborate with R
- 零基礎學Python網絡爬蟲案例實戰全流程詳解(入門與提高篇)
- Visual Basic 6.0程序設計實驗教程
- Illustrator CC平面設計實戰從入門到精通(視頻自學全彩版)
- 3ds Max印象 電視欄目包裝動畫與特效制作