Code reviews are a system of peer reviews that involve developers looking over code that they didn’t write and providing feedback. At Clearbridge, code reviews are included in our cross-developer verification process that is part of every project we work on. This post is going to describe why we have code reviews ingrained in our process, the benefits it offers to both our team and to our clients, and how we perform code reviews.
Code reviews ensure that more than one developer is looking at the code, not just the developer who did the work. When you have a second pair of eyes reviewing the work, you can see mistakes that the original developer may not have caught. Code reviews function to minimize any defective, redundant, and poorly optimized code making its way into production, which leads to cleaner code and ultimately a better product.
The process of reviewing code allows developers to become more familiar with other parts of the code base, meaning they gain a more holistic understanding of the app, including how the specific features they are working on might affect other facets of the project. An ancillary benefit is exposing more team members to many different aspects of the project, allowing for the seamless transfer of knowledge and a better idea of what needs to be achieved.
Better knowledge transfer leads to more flexibility on the project team. If additional resources are needed, if a developer working on certain features is sick or on vacation, etc., the exposure to other areas of the project allows another member of the team to jump into things without having to start from scratch. As a result, you don’t lose velocity.
Every developer becomes inherently better and more knowledgeable as they gain more exposure to new technologies or different ways of thinking. Code reviews allow developers to learn from the ways other developers approached a problem or completed a task. They can apply these different approaches to future projects or tasks and acquire new skills as a result.
It might seem like code reviews add another step to the development process, but they can actually help streamline development. With the exposure that developers get to other aspects of the project, they can discover other assets that already exist which can be used in the areas they are working on. This helps to eliminate duplicate work, reduce development time, and decrease technical debt.
Along with unit testing, code reviews are part of our practice of cross-developer verification, which is always done before product verification. Here is how they are conducted:
There may be some variation in process from company to company, but the function of code reviews remains the same. Ultimately, having code reviews built into your process offers significant benefits to your team (and clients), and leads to a stronger end product.