Swarm 2014.1: User Guide

Code reviews

A code review is a process in which other developers can see your code and provide feedback that can suggest ways to improve the code's structure, performance, maintainability, and interaction with other code.

Benefits

Some of the benefits of code review are:

  • Enforcing coding standards: code reviews can catch code that does not meet your team's coding standards. This improves the readability and consistency of your codebase.

  • Knowledge and experience sharing: your team can help you learn to code better. This is particularly useful for developers new to the team.

  • Early defect detection: small errors can be caught before they become problems later on.

  • Code sharing: code reviews spread knowledge of the current codebase, which helps both with maintaining a mental model of the overall project, as well as defending against developer absences.

  • Better personal review: knowing that someone might catch a simple coding error often increases the review developers perform of their own code.

Swarm attempts to provide these benefits without adding onerous overhead for developers.

Facilities

Swarm provides the following code review facilities. In the list, the term author refers to the person who creates a change to be reviewed, and reviewer refers to any authenticated Swarm user performing code review tasks.

  • Authors can request reviews.

  • Reviewers can start a code review on existing changes.

  • Reviewers can add themselves a review to indicate that they are participating in the review and sharing responsibility for the review.

  • Reviewers can provide comments to overall changes or specific lines of files.

  • Reviewers can vote on a review, to indicate their approval or disapproval.

  • Reviewers can mark changes as needing revision, approved, rejected, or to be archived for future consideration.

  • Reviewers can commit approved changes if necessary.

Advisory Nature

Currently, Swarm's code review workflow would best be described as advisory. Out of the box, Swarm uses no mechanisms to structure or restrict code review workflows, such as:

  • Enforcing code reviews prior to committing changes

  • Assigning code reviews to particular reviewers

  • Requiring approval from one or more reviewers

However, you can optionally enable triggers in the Perforce service that can enforce that submitted changes are associated with approved reviews, and can enable strict matching of the contents of a changelist to the contents of an associated, approved code review. See “Perforce configuration for Swarm” for details.

At this early stage in Swarm's life cycle, it is not clear which mechanisms might be most important to you and your team. If you have ideas and suggestions for improvement, please contact us.

Agile development teams should find sufficient capability within Swarm to make code reviews a regular part of their workflow. Swarm's development team has been using it regularly during development of Swarm.

0 matching pages