7 Code Review Best Practices and Dynamics You Can Identify and Act On: Part 2
In the previous post, we delved into four process dynamics of code reviews that you can identify and act on immediately. Now let’s turn to the other side of the management coin, which is stamped with the engineers you’re leading. In these three dynamics, we’ll speak to how you can leverage the code review process to more effectively engage with your team members as human beings.
5: Disengaged engineers
Just about all of us have encountered disengaged engineers. They tend to stick to their own work, and getting them to engage with the rest of the team requires quite a bit of campaigning.
The thing is, most engineers truly want to be productive, contributing members of their teams. The issue here is that curiosity is the driver of growth for engineers. When we’re not learning, we’re not excited about our work. And if that sentiment lingers, it can lead us to drift away from our team and our responsibilities. We may even begin looking for other opportunities.
Fortunately, engineer disengagement isn’t typically a chronic condition. One of the easiest ways to spot that engineers feel disengaged is when they aren’t engaging in the code review process.
Not only is this lack of participation problematic for the disengaged engineers, it’s also a detriment to the rest of the team. First of all, engineers can feel it when their teammates aren’t actively participating in the work at hand. Also, reviews are work that simply needs to be handled, so when an engineer is falling short, other members of the team have to pick up the slack.
Fortunately, code reviews are a fantastic way to keep engineers engaged, especially during those stretches when their own projects may be a bit of a grind for them. PRs can help get them excited about the work going on in the team. A leader’s role here is to get those engineers participating in the process, and the first step is to recognize when engineers are acting disengaged so you can intervene to encourage their involvement.
Here, you can see the review dynamics for this team over the past 30 days. Two engineers at the bottom have hardly engaged in the PR process this month, with only one review each. Context matters, of course, and this data provides you an opening to talk to these engineers to understand what’s going on to minimize their participation.
Perhaps they’re slammed with their own work and they just need a bit of a reminder to jump back into code review. Or, you might discover something deeper going on: a lack of confidence in contributing with their peers, or discomfort with asking questions of senior members of the team. Maybe they feel like no one listens to them anyway, or they need a mentor to help teach them the code review culture in your organization.
Whatever the root cause is, your job is to lift up these engineers and encourage them to engage more actively. Start with the engineers at the bottom of that list who are the least engaged, and work your way up. We find it helps their participation if you cherry-pick reviews for them at the start—find easier PRs for them to complete, or ones that align with their expertise. Even aside from approving PRs, ask them just to start commenting on more of them.
Remember, always, that the simple act of practicing and participating with straightforward code reviews goes a long way toward building up the habit and comfort of engaging.
6: Too happy to help
On the absolute opposite side of the scale are the over-engaged engineers. Frankly, this may be the toughest dynamic to manage, because these engineers exude all the appearance (and usually the belief) that their work is incredibly helpful.
These engineers are always active in PRs. In group emails, they always contribute their comments. They’re often the loudest or the most vocal in group conversations. They have input on just about any topic, and they’re always willing to share it.
Gregarious teammates are often a fantastic part of a team. They can be the spark that ignites interesting and actual conversations. However, in the PR process, they often lose the balance between constructive comments and comment spam. Their comments make them feel busy, but the data tells a different story.
It seems counterintuitive that over-communicating in code review be a detriment. But over-commenting comes at the expense of their own deliverables, and it can affect team morale because they’re not actually achieving what it’s their responsibility to accomplish. As a manager, you may miss that this is happening, because most of what you see appears to be sound engagement. But the teammates know it’s going on. They’re on the receiving end of that over-engagement, and they’re acutely aware of it—they just might be unable to talk to you about it.
Which is why it’s important for you to spot this dynamic in the data early and manage it proactively.
Let’s look at the top of this comment activity summary, at the balance of Romain’s comments to PRs submitted. In a two-week period, he made 182 comments on other people’s work and submitted just three PRs of his own. Most other people have a 2:1 or 3:1 ratio. Romain’s, at 60:1, is clearly an outlier on this team.
There could be reasons for Romain’s chattiness. For instance, on our team at GitPrime, an architect or a team lead might sport that ratio. But Romain is neither. Absent such a good reason, it’s time for a leader to take a look and step in, because this behavior, left unchecked, can drown out the other voices on the team.
It helps to remain aware that over-engaged engineers may have come to believe through learned behavior that commenting in this way allows them to contribute most helpfully to the team. Helping others is helpful, right? So as a leader, you need to ensure that you’re setting proper expectations and guiding these engineers to correct course.
It’s challenging to tell these engineers not to comment so much. It demoralizes them. A more constructive approach is to simply start adding projects to their bucket of work over the next couple sprints. As they naturally feel the pressure of hitting their deliverables, they’ll tend to scale back a bit on their commenting activity.
That’s when you give them an out.
At that moment, you can let them know, “You clearly have a lot of work on your plate. If that needs to come at the expense of some of the code review you’ve been doing, that’s totally okay.”
Just giving them that little out is usually all you need to restore balance on the team. That engineer is hitting objectives for the sprint, and the team feels overall happier and more harmonious.
7: Better onboarding
We cannot understate how helpful the PR process can be in ensuring your team is consistently learning from each other. Code review is always a chance for cross-pollinating information and expertise between team members. So we’d like to wrap up these seven dynamics by addressing how to use PRs to assist with your onboarding program.
After all, a key component of successful engineer onboarding is ensuring both that engineers new to your team are learning the code, as well as learning how to engage meaningfully with their new teammates.
So use the onboarding process to build connections between engineers who will be working together. Below, recently hired Jeffrey will be working closely alongside Alina and Maksim, so his manager asked him to focus on reviewing more of their PRs. Over his first few weeks, Jeffrey reviewed two of each of their PRs, yet Alina submitted a total of 44—and Maksim submitted even more.
If you ask your engineers—and particularly recent hires—how things are going, you’re bound to get the initial “Great” answer. Things may be great, and they often are. But sometimes they may be going off track like Han Solo in a botched princess rescue, bluffing their way by saying “Everything’s fine, we’re all fine here now, thank you. How are you?”
So you can rely on the data to show you how things are going. Perhaps Jeffrey’s two PR reviews truly went great, but he needs to be doing more. So in the next sprint, his manager can ask him to try participating in at least half of Alina’s and Maksim’s work, as well as congratulating him for jumping in on some other engineers’ work as well. After all, commenting on multiple people’s work will build his rapport with the team over time.
Use the data to understand the positives of an engineer’s collaboration patterns, as well. You can better understand the quality of their comments in the review process. In Jeffrey’s case, we can see below that he’s getting a ton of traction with Alina. She’s very responsive. However, Maksim is less engaged. His response time is poor, and his review coverage is minuscule. Jeffrey may be doing his part to engage, but if Maksim is dragging his feet or failing to give Jeffrey’s comments the attention and respect they warrant, you can use this opportunity to remind him about the importance of bringing the newest team member into the fold.
This is where we really come back to the idea that PRs are about so much more than finding bugs. In onboarding, as well as throughout engineers’ time with the team, code review is a fantastic way to reinforce cultural values.
By encouraging Jeffrey to participate more in the PR process, not only are you encouraging best practices, you’re also empowering him to speak his mind and use his voice. “You were brought onto the team for good reasons,” you’re saying. “Your team wants to hear what you have to contribute.”
His participation as a newcomer also reinforces the notion for the established engineers that they need to be open to receiving and accepting feedback. “This is an important part of who you are,” you’re saying. “And this is an important value for this organization.”
In short, PRs are one of the best ways not to just talk about your values but to actually live them, every day.
And that’s true not just in the onboarding process, but in your day-to-day, too. Developing software is no longer about individual engineers cranking out code (if it ever was). It’s a team effort. By focusing on these seven dynamics of the code review process and utilizing the data available to you through GitPrime, you can improve the value your team gleans from the code review process—and start guiding better engineers and better products as a result.
Jen is a Senior Product Manager at GitPrime.
Get Engineering Impact: the weekly newsletter for managers of software teams
Keep current with trends in engineering leadership, productivity, culture, and scaling development teams.