Restructuring Reading Notes (V)-Chapter 4 & Chapter 5

Source: Internet
Author: User

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.