1, do not write any product code until the failed unit test is written.
If you do not write the test first, then the functions will be coupled together and eventually become unable to test
If you write a test, you may be able to test large chunks of code, but you cannot test each function
First write the test is offensive, after write test is defense
2, as long as a unit test failed, do not write the test code, compile failure is also a failure
a place leaks to repair, do not wait for a number of places leaking to repair, then you may not repair
3, the product code just can let the failed test cases pass, do not write more than one line
The Reliance inversion principle tells us that the lower layer is a high-level service, and the test driver tells us that the product code serves the test case
In contrast, test cases are located at the top, close to demand, representing demand
Understanding of the TDD principle