Implementing Code Review Templates as Part of Your Quality Strategy

04/18/20161 Min Read — In Testing, Development

Just started a new gig and was nonplussed at the way the team handled code reviews and pull requests. The culture seems to be putting a link manually into a Slack channel, mentioning the reviewer and then racing as fast as humanly possible to an approval with no more than an "LGTM!" message, with the submitter then handling the merge then manually moving the card in Jira.

I don't like that at all. Each step of that can be improved.

Why don't I like it? No context, no review of the code, no interacting with the system by executing the code, not using the integrations and tools to do some of the work for you, no traceability, no connectedness, no culture of sign off or quality.

Set your reviewer up for success. Take the responsibility seriously. Give them a link to the initiating request, Jira or whathaveyou. Give the reviewer some context about what the change contains. If the reviewer is executing the code or just reviewing the diff, both of those scenarios should have enough info to do their job. Are you trying to keep non-auto-generated documentation current, put that in a template and let people know. If the branch should survive the merge or be destroyed, the person merging that should know about it. Do not merge your own stuff. Have your branch and commits be traceable.

A serious and robust code review living harmoniously with your CI/CD system is a critical moment for assuring quality.