- 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.
推薦閱讀
- MATLAB圖像處理超級學習手冊
- SQL Server 2012數據庫技術及應用(微課版·第5版)
- 實用防銹油配方與制備200例
- 自制編程語言
- SQL Server從入門到精通(第3版)
- OpenCV 4計算機視覺項目實戰(原書第2版)
- Mastering Apache Camel
- SFML Game Development
- Java程序設計教程
- Python Penetration Testing Essentials
- Manage Your SAP Projects with SAP Activate
- Android開發進階實戰:拓展與提升
- Managing Windows Servers with Chef
- The Python Apprentice
- C語言程序設計教程