View on GitHub

engineering-notes

Notes for engineering

Why we need code review?

Code reiview is playing an important role in the engieering process. It is the safeguard for the quality of code.

Usually, there are a bunch of benefits for doing code review:

What should code review focus?

There are several perspectives:

How to do code reivew?

Code review could basically have two categories:

The auto code review mostly depends on the tools to automatically to detect. There are two kinds of checking:

The manual code review is the generally code review. To improve the code review quality and efficiency, we usually leverage both technologies. The auto code review will focus on resolving the coding style, common basic errors while experts focus on more domain specific feedbacks.

In terms of the manual code review, We should follow several principles:

How to perform code review? There are some suggestions as following:

This article from Palantir provides a lot of great suggestion about how to perform the code review. How to perform code review

How to handle comments? If you decide to resolve the issue for that comment later, please explictly explain (and why not resolve it now) and mark it as not resolve (some tools provide the feature) in the current PR.

Always fix those comments that make sense.

How to prepare a pull request (PR) for code review?

There are several principles for creating code review:

Before sending out the code review, what should we do? There are some practice suggestions:

Code review tools

There are several reviewing tools: like github online code review, VSTS online code review etc. The characteristics for code review tools:

Further Readings/References