How to perform code review in Visual Studio 2019

December 24th, 2019

Summary: This article will demonstrate how code review workflow in Visual Studio 2019 can be more efficient with Review Assistant. We will introduce you to some great capabilities of our code review tool.

Reviewing code can be a good practice for developing high-quality software. It helps control code quality, detect bugs and share knowledge.

Review Assistant plug-in brings more useful features into Visual Studio code review process and provides a possibility to use a broader range of VCSs.

To clearly show the benefits of using Review Assistant in Visual Studio 2019, we will use a code review example.

How to review code in Visual Studio 2019 with Review Assistant

Before we get to how to do a code review, let’s take a quick look at our product itself.

Review Assistant is a  lightweight and powerful Visual Studio code review tool. It extends code review user experience of viewing, reading and checking parts of source code.

The tool allows you to add multi-line comments, create ad hoc reviews directly from the code, make links to a specific review or comment and generate different types of reports.

Moreover, Review Asssistant supports the mode for different monitors (per-monitor DPI awareness) using the technology of flexible UI scaling.

In the code review tutorial below, we will walk you through the whole process of reviewing code in Visual Studio 2019 and familiarize you with the Review Assistant features mentioned above.

Creating a code review

The quality of code can be significantly improved by making code reviews. We will use a simple WPF application in Visual Studio 2019 as an example of how to conduct an effective team code review with Review Assistant.

So, let’s create a regular code review:

1. In Visual Studio, click the Code Review Board button on the Review Assistant toolbar.

Code Review Board

2. Click the Create Regular Review button.

Regular Review

3. In the opened window, click Add Revisions to select a revision. Enter a review title, select a reviewer and add comments.

Regular Code Review

4. Click Create.

Adding a comment to code

A reviewer can see a newly-created review on the Code Review Board. He opens a review, checks a file or code, and if there is a defect, he can add a comment. Review Assistant allows you to add different types of comments. The color of comment balloons changes in order for users to visually track comment statuses.

For instance, the reviewer sees that the author of the code made a mistake in the word ‘Click’. He selects the word and adds a comment to fix the bug.

Perform Review

When the reviewer adds a comment, the author sees it, fixes a defect and changes the comment status to Fixed.

Defect Fix

After the author adds a new revision with the fix to the review, the reviewer sees the splitter on the Code Review Board, which contains one more iteration. By clicking the file name link in the comment, the reviewer can see the fix in a code comparison window. We recommend using Code Compare diff tool, because it deeply integrates with Review Assistant. 

Code Compare

Adding a question

The reviewer sees the fix, but he cannot finish the review due to a question that he still has and which the author of the code should answer. The author makes necessary changes, replies to the question and mark the question as resolved.

Question Comment

Adding a multi-line comment

In Review Assistant, there is also a possibility to add multi-line comments. For example, the reviewer writes a multi-line comment that the code is not properly formatted, explains the reason and proposes a solution.

Multi-line Comment

Completing a code review

Once the reviewer has added the comment, the author should react to it: fix the bug, reply to the reviewer’s comment and commit the modified resources to the repository. If the reviewer accepts all the changes, he can finish the code review process by clicking the Complete Review button.

Complete Review

Exporting a code review

When a review is completed, you can easily export and analyze necessary data in a report. Review Assistant provides a wide range of code review reports, which can be exported to different formats: PDF, HTML, MHT, RTF, XLS, XLSX, CSV, Text, Image, XPS. In the Export window, you can easily print a review or send it via email.

Conclusion

We have shown how to improve code review workflow in Visual Studio 2019 with Review Assistant – one of the best code review tools on the market. In the provided code review example, we’ve demonstrated main capabilities of the extension and benefits that you get when performing review with your team.

Purchase and download Review Assistant to conduct effective code reviews in Visual Studio 2019.

Leave a Comment