code review
/ˈkəʊd rɪˌvjuː/noun
A code review is an assessment of a code change by another developer. They check its behaviour, readability, and maintainability, among other things, before the change is merged.
During the code review, a colleague noticed that the new access check skipped one user role.
In a code review, a developer reads a colleague's proposed change. The aim is to find errors and unclear decisions before the code becomes part of the shared Glossary · In briefcodebaseA codebase is the collection of source code used to build and maintain a software product or component.Read more. The review also helps the team apply conventions on style, architecture, and security consistently.
How does the review work?
The author usually submits a focused change in a Glossary · In briefpull requestA pull request proposes that changes from one branch be reviewed and merged into another. Team members can discuss and check the code before it is incorporated.Read more. The reviewer examines the differences from the existing code and reads enough surrounding code to understand the effects. They look at logic, edge cases, tests, naming, and how the change fits with existing components.
Questions and comments are added to the relevant lines. The author can explain a decision, change the code, or give reasons for declining a suggestion. After any revisions, the reviewer approves the change or requests further adjustments. Small changes are generally easier to review because their purpose and effects are easier to follow.
Human assessment alongside automated tests
Automated tests, Glossary · In brieflintingLinting automatically checks source code for potential errors and violations of agreed coding rules, without running the application. The tool that performs these checks is called a linter.Read more, and security scans can check fixed rules and flag known problems. A code review adds human judgement. A reviewer might notice, for example, that a solution works technically but fits the domain poorly or is unnecessarily complicated.
Approval does not mean the reviewer takes over all responsibility or that the code is free of errors. The author remains responsible for the change. The review adds another check and shares knowledge of the decisions within the team.