- 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.
推薦閱讀
- Mastering ServiceStack
- NLTK基礎教程:用NLTK和Python庫構建機器學習應用
- Monitoring Elasticsearch
- 深入RabbitMQ
- JavaScript應用開發實踐指南
- Apache Camel Developer's Cookbook
- Mastering Elasticsearch(Second Edition)
- Kotlin Programming By Example
- 從程序員角度學習數據庫技術(藍橋杯軟件大賽培訓教材-Java方向)
- 官方 Scratch 3.0 編程趣味卡:讓孩子們愛上編程(全彩)
- Android技術內幕(系統卷)
- Learning Google Apps Script
- Python編程基礎與數據分析
- Python GUI設計tkinter菜鳥編程(增強版)
- Flask Web開發實戰:入門、進階與原理解析