Why Code Review Should Be a Part of Training and Mentorship

SmartBear’s 6th Annual State of Code Review survey found that code review not only improves software quality, it can help your team learn and facilitate mentorship of new employees.

In research for its 6th annual State of Code Review report, SmartBear found — not surprisingly — that most software developers consider improved software quality as the most significant benefit that code review provides. But a new trend is emerging. The number of software developers who recognize that benefits of code review also include sharing knowledge across their teams and mentoring less-experienced developers is also growing. In fact, those benefits rank number 2 and number 3 in this year’s survey, outranking compliance, reducing project costs, and strengthening their competitive advantage.

The study also found that 31 percent strongly agree and 50 percent agree with the statement that they often learn from others during code review. During a webinar that presented survey findings, Patrick Londa, Digital Marketing Manager for SmartBear, pointed out that this question had the most definitive response of “strongly agree” of any question in the survey.

The State of Code Review survey also found that three out of five respondents use code review as a way to train new developers. “It’s a learning vehicle,” Londa said.

To draw recommendations from the survey’s findings, SmartBear divided responses into two cohorts — those who said they are satisfied with code review at their companies and those who are not. Among those who are satisfied with code review, 77 percent use it as an onboarding tool, suggesting it’s a beneficial practice.

Different Code Review Processes

Developers typically use three types of code review processes:

  • Ad hoc: This type of code review is an informal, “over-the-shoulder” review that a colleague may request when they’d like another set of eyes on their work. This type of review is typically not documented, and there’s no way to ensure that changes are made. SmartBear found that about 20 percent of developers engage in ad hoc reviews on a daily basis and 30 percent on a weekly basis.
  • Tool-based: Collaborative code review applications automate the review process. They’re also a more flexible method, allowing people working remotely or on different schedules to participate in code review. Tool-based review is popular among developers, with about 30 percent of developers now using it daily.
  • Meetings: Many developers hold formal code review meetings, usually on a biweekly or monthly basis. SmartBear found when formal code reviews occur, teams are more likely to be satisfied with the overall code review process.

SmartBear concluded that using all code review methods is probably the best strategy: Ad hoc when a colleague needs advice, tool-based for documentation and to enable distributed teams to participate, and formal meetings where you can leverage the data from tool-based reviews.

Recommendations based on these findings include conducting code review daily if possible, building it into workflows, and leveraging tool-based code reviews. Reporting on the code review process is also essential to team satisfaction with the process; teams that include reporting as part of the process are four times more likely to be satisfied with their code review than those who do not.

SmartBear also found that most developers have guidelines that teams use for code reviews, and 86 percent also review artifacts including requirements, test cases, user stories, documentation, design documents and schematics. “If requirements weren’t reviewed properly, then it plays a role in the overall success of the development workflow,” Londa says.

For more findings and insights, read The State of Code Review in 2019 report from SmartBear.

SHARE
Mike Monocello
The former owner of a software development company and having more than a decade of experience writing for B2B IT solution providers, Mike is co-founder of DevPro Journal.