Code review is necessary

Source: Internet
Author: User

I remember when I first started my project at the company, mentor wanted to check some of the code I just implemented with me. At that time, I was puzzled. Didn't I trust the code I wrote? It turns out that my code has many defects, some of which are still very serious. Later, I learned that this process is called code review. It is a means to ensure the quality of software and an important means. There are multiple types of code review. The most formal one is to gather some 'scales' from the company or department to sit in the conference room and review your code one by one; the simple form is like what mentor and I did. A person who writes code and a person who has a special understanding of the system will review it together, and the effect will not be as good as a formal review, at least I think so.

So when will the code review be conducted? How can we determine the granularity of code review? This is generally the time before your code has taken shape and has passed the unit test and is not submitted for the integration test. The granularity of the review depends on the size of the Code. Of course, the larger the coverage of the review code, the higher the quality of the Code. For modules that involve complicated business processes, you must review the Code together with those familiar with the business, and pay attention to such modules, because business process logic errors are often more than language errors. Another time is suggested for code review. After the first version of the system is released, if you need to add new features, remember that the Code review may be better than a simple test, of course, both of them must be available to ensure higher code quality.

After a rough thought, the code review has the following benefits:
1. The Code review will try to kill bugs in the early stage.
Practice has proved that the cost of discovering bugs in the project in advance is much lower than that of discovering bugs in the later stage. The earlier the project discovers problems in the Code, the more favorable the control and grasp of the entire system.

2. The Code review process is a process of inheriting knowledge and skills, which is conducive to the growth of new people.
Code review is similar to a master's hands-on apprentice. It is a direct teaching of knowledge, skills, and experience. Therefore, such an opportunity is rare. Especially for newcomers, it is important to cherish the opportunity of code review, the efficiency and achievements of newcomers in this process prove to be the highest.

3. Code review will help you better understand the system.
The Code review process is actually a new process of thinking, especially for those modules with complicated business processes, code reviews with business-savvy people can help you better understand your business and system.

In short, code review is necessary, and you will receive unexpected results if you increase the code review granularity.

 

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.