According to most sources, the average suggested time to spend on a code review is between 30 to 60 minutes. If you combine performing one or two reviews per day with all the other peripheral tasks you need to accomplish in a day, you’re quickly going to run out of time to accomplish your own “real” work. It’s a tricky situation that can quickly snowball out of control, making it important to have strategies in place to cope with a large influx of code reviews.
Some of these strategies will have to do directly with your review process. There’s also a series of steps you can take that won’t have to do with the review process at all but instead with time management. It’s an important skill for all developers to master, and is worth investing in regardless of whether or not you’re trying to find time for reviews.
Refine your review process
There are a few key elements of the code review process that, when fine-tuned, will more than compensate for the effort required to get them right.
Hone the process of preparing the review so that it doesn’t get to participants until they’re ready. Ideally, you’ll have a checklist in place that developers can follow to ensure their request is ready. A review created before it’s ready should be closed. Have a look at this article for more details on what the requester should provide as part of the code review.
Keeping a review small makes it quicker and easier to understand. We’ve all at one time struggled trying to understand what another developer did. The task gets harder if you’re trying to assess two entirely separate issues in the same review.
Use a static code analyzer to ensure your team standards are met. This allows the reviewer to concentrate only on the problem being solved and not on the details of the variable names, placement of squiggly brackets, tabs vs spaces, etc.
Invest in a quality review tool to improve your productivity. Not all review tools are created equally and some may be more tuned to your team’s needs. Just like in the construction industry, make sure you choose the right tool for the right job. Generally, tools that are specialized for code review will have more features and better usability compared to Pull Request-based review tools.
Use checklists to know what you’re looking for. It’s a lot easier to quickly go through a code review if you’ve got a checklist of both broad and precise things to be on the lookout for.
Improve your time management skills
Finding the time to do code reviews also has a lot to do with your time management skills. Often underestimated, this is one of the most important skills to have in your skillset as a developer and will help with much more than just finding time to for code reviews. There are hundreds of books and articles written on time management – I’ll only review the techniques that have benefited me in the past.
It’s best to plan time for reviews in your schedule and have a time limit that you must respect. Planning the time will help to ensure you always have a block allocated for it, even if there aren’t any to review. Having a time limit will help keep you focused and moving forward within the review itself. Furthermore, you should track the average time you spend per review. This will help you re-adjust how much time you need to allocate in your daily block for reviews.
The next way to find time in your busy work schedule for reviews is eliminating distractions. This one isn’t easy in a world that is more and more connected. Email, instant messaging, and social networks all want to distract us from getting on with our work. If you manage to shut out those time wasters that produce little to no value, you’ll end up finding a lot of time in your day that you didn’t even know existed.
Another strategy that I’ve used in the past is the Pomodoro technique. It suggests working for 25 minute undistracted intervals, followed by a few minutes rest, and then another 25 minute interval. What I’ve found most beneficial is the focus that it brings to what you’re working on, without feeling like you’ll be stuck into a problem for hours. Also, 25 minute intervals are manageable in terms of being disconnected from email and instant messaging. No one will wonder why you haven’t answered a message over such a short period of time so there’s no reason to not simply close them and give yourself fully to the task at hand.
There’s no reason to not be able to find time for code reviews if you follow the above recommendations. I hope some of them will help you too!