Transitioning from Manual to Automated Code Review
Editorial note: I originally wrote this post for the SubMain blog. You can check out the original here, at their site. While you’re there, have a look at CodeIt.Right.
I can almost sense the indignation from some of you. You read the title and then began to seethe a little. Then you clicked the link to see what kind sophistry awaited you. “There is no substitute for peer review.”
Relax. I agree with you. In fact, I think that any robust review process should include a healthy amount of human and automated review. And, of course, you also need your test pyramid, integration and deployment strategies, and the whole nine yards. Having a truly mature software shop takes a great deal of work and involves standing on the shoulders of giants. So, please, give me a little latitude with the premise of the post.
Today I want to talk about how one could replace manual code review with automated code review only, should the need arise.
Why Would The Need for This Arise?
You might struggle to imagine why this would ever prove necessary. Those of you with many years logged in the enterprise in particular probably find this puzzling. But you might find manual code inspection axed from your process for any number of reasons other than, “we’ve decided we don’t value the activity.”
First and most egregiously, a team’s manager might come along with an eye toward cost savings. “I need you to spend less time reading code and more time writing it!” In that case, you’ll need to move away from the practice, and going toward automation beats abandoning it altogether. Of course, if that happens, I also recommend dusting off your resume. In the first place, you have a penny-wise, pound-foolish manager. And, secondly, management shouldn’t micromanage you at this level. Figuring out how to deliver good software should be your responsibility.
But let’s consider less unfortunate situations. Perhaps you currently work on a team of 2, and number 2 just handed in her two week’s notice. Even if your organization back-fills your erstwhile teammate, you have some time before the newbie can meaningfully review your code. Or, perhaps you work for a larger team, but everyone gradually becomes so busy and fragmented in responsibility as not to have the time for much manual peer review.
In my travels, this last case actually happens pretty frequently. And then you have to chose: abandon the practice altogether, or move toward an automated version. Pretty easy choice, if you ask me.