- Mastering React Test:Driven Development
- Daniel Irvine
- 153字
- 2021-06-24 14:45:04
Red, green, refactor
We’ve covered a lot of ground, and we have gone into excruciating detail for a very simple test. All of the ground work is now done for us to speed up.
Let's look at the red, green, refactor cycle:

The steps of the TDD cycle are as follows:
- Write a failing test: Write a short test that describes some functionality you want. Execute your test and watch it fail. If it doesn’t fail, then it's not a good test; go back and try again.
- Make it pass: Make the test green. Do the simplest thing that will work. Feel free to make a mess; you can clean it up later.
- Refactor your code: Stop, slow down, and resist the urge to move on to the next feature. Work hard to make your code—both production and test code—as clean as it can be.
推薦閱讀
- LabVIEW 2018 虛擬儀器程序設計
- Software Defined Networking with OpenFlow
- What's New in TensorFlow 2.0
- Linux C/C++服務器開發實踐
- Practical Internet of Things Security
- Building Mobile Applications Using Kendo UI Mobile and ASP.NET Web API
- 差分進化算法及其高維多目標優化應用
- JavaCAPS基礎、應用與案例
- Create React App 2 Quick Start Guide
- Learning Apache Cassandra
- Practical GIS
- Akka入門與實踐
- Mastering Leap Motion
- Mastering ASP.NET Core 2.0
- HTML5+CSS3+jQuery Mobile+Bootstrap開發APP從入門到精通(視頻教學版)