Chapter 4 build a Test System
Unit Test
1. Writing excellent test programs can greatly improve our programming speed. This may surprise many people and violate the intuition of many programmers.
2. Value of self-testing code: fixing errors is usually fast, but identifying errors is a nightmare. When you fix an error, there will always be another error, and it will take a long time to notice it. At that time, we had to spend a lot of time searching for it.
3. Of course, writing a test program requires a lot of additional code. At first, you may think this is just nonsense. You may even find that one person can finish the work in one day. Now, two people have to do the work for the last week. However, don't forget that "complete" and "complete" are two different things. In the long run, the test program has a permanent effect to some extent. Therefore, whenever you receive a bug report, write a unit test to expose the bug.
4. Do not write the test because the test cannot capture all bugs, because the test can indeed capture most bugs.
5. With a complete testing system, you do not even need to open the debugger when developing programs.
Chapter 1 refactoring list
This chapter describes how to describe the refactoring List in Chapter 6-12.
1. record format Reconstruction
Like gof's design patterns, the author uses a standard format to introduce every refactoring method.
2. Search for reference points
The current IDE is doing very well in this regard. I think this is no longer a problem.
3. How mature are these refactoring techniques?
The design pattern... provides a goal for refactoring behavior. There is an inherent relationship between pattern and refactoring. Pattern is what you want to achieve, and refactoring is the way to reach. It seems that the book reconstruction and mode is worth reading!