Overview

In today’s class, we’ll do another code review. As a reminder, code reviews are an important part of the software development process. Learning how to give, and receive, constructive feedback on your work is a vital skill for all computer scientists, and one you’ll use over and over again in your career.

Basic Learning Objectives

Before class, you should be able to:

  • Explain the goals and process of a code review
  • Give an overview of your team’s current codebase
  • Identify areas of strength and places for improvement in another team’s codebase

Advanced Learning Objectives

After class, you should be able to:

  • Engage productively in a code review
  • Improve your team’s codebase based on feedback from a code review

Readings

To achieve the basic learning objectives, you should read the following before class:

  • Review Code review guidelines from CodeProject
  • Read and make notes about the code sent to you (information forthcoming on Wednesday on Moodle). Pay special attention to the comments, naming, and ‘code smell’ ideas that we have been discussing as well as the style principles that you have learned about in previous classes.

Checks

Write answers to the following and bring them to class:

  • For your own team’s project, write a brief overview of your team’s design approach and the main classes/functions/decisions that you’ve made. You will use this to introduce your project code to the people reviewing it, so it should give them a high-level idea of your project codebase
  • For the repository you are assigned to review:
    • 2 or 3 things you like about their code, that you think they should keep doing.
    • 2 or 3 things you think could be improved. Ideally, you should include suggestions on how to make those improvements, but sometimes, you won’t be sure how to fix a particular thing.
    • [optional] If there are things about the code that you don’t understand, or about which you have questions, you may include a couple of those items at the end of your writeup.

Keep your comments concise. These writeups should be short (typically less than one page) and as simple as you can make them. Also, consider these notes on providing constructive feedback as you complete your write-up. You will be sharing your notes with the authors of the code.