Best code review tools 2023

Automatic code review descriptions with "Whatthediff" code review tool

Whatthediff is a code review tool that analyses your code and generates a summary of the source code changes in plain English. This rather small but focused code review helper tool neatly enhances GitHub’s code review functionality.

whatthediff tool comments on PR with a description of changes

Precise Code Review Descriptions enable Good Code Reviews

Writing good code review descriptions, and explaining the changes to the code reviewers, is a great code review practice. In particular, it helps to overcome the expert blind spot. The expert bling spot describes the problem that the code author knows so much about what they worked on that their code change seems trivial to them. Yet, for a code reviewer who has not worked on this code before, building a mental model of the code changes takes a lot of cognitive effort. The code reviewer has to analyze the files, see what changed, and gradually build an understanding the code change. A code review description can help to reduce this effort and enables the reviewer to give better feedback.

Code review descriptions are often sparse

While working with many engineering teams, I saw that many developers and teams do not provide good enough code review descriptions. Instead, the description of the code change is often a one-liner followed by a bullet-point list of all the commit messages. Here, this little tool can help to ehnance the pull request with a summary of the changes. This summary then can not only help the code reviewer understand the change, but also the code author to remember what they did. Based on this memory aid, the code author can then fill in the blanks that the tool can not know, like why they chose a certain approach, or what the reviewer should focus on and enhance the code review description with this information.

Refactoring feature of the whatthediff code review tool

Whatthediff is like ChatGPT, or GitHub Co-pilot, but focuses on improving the reviewability of your pull requests. The tool developers also work on other cool features, like the automatic refactoring of code. Whenever you see code that you think should be refactored, you comment with “/wtd” and describe the change you want to see, and let the tool take care of the rest.

Tool Verdict

My take on the whatthediff code review tool is that it’s indeed a nice little code review helper if you are not worried about IP issues (you have to grant the tool full excess to your source code). I added it to my toolbox for my open-source projects, and I’m always curious to see how well it describes my changes. Often, I’m surprised that it neatly describes all the changes and even a bit of the intention of the code. Other times, it generates rather unhelpful change descriptions like “File changed”. Yet, overall I’ve had many good and helpful change summaries that make for a great tool experience.

Change summaries are not enough

The most important critique is that change summaries are only one part of a good code review description. Other important aspects of code review description, like an explanation of why this change is needed, or guidance for the code reviewer on what they should focus on cannot be generated by the tool. Yet, as described before, the automatic summary can also serve as a memory aid for the code authors and help them fill in the blanks.

Right now, it only works with GitHub, but I’m pretty sure that we will see integrations with other code review tools soon. If you want to check it out, you can find the whatthediff code review tool here.

This article first appeared on https://awesomecodereviews.com. Last updated: February 18, 2023

Profile picture of Michaela Greiler

Written by Dr. Michaela Greiler who is obsessed with making code reviews your superpower. Learn more about her workshops.