How peer review leads to quality code

22.06.2015
If you could deploy existing resources to improve the quality and timeliness of your software development projects, you'd probably jump at the chance.

So what is this magic elixir

The peer review.

Peer reviews, or, as they're sometimes called, peer code reviews, or just code reviews, are an excellent way of making the most use of your development talent while minimizing the time spent on finding and fixing bugs.

What do they involve Essentially, a developer teams up with a peer, and each developer reviews the other's code to look out for quality, better ways to do things, and to eliminate duplication and redundant coding efforts. The developer walks through his code, explains his logic, shows how he has developed the concept or the story that he has been working on. The peer developer suggests where errors might lie, helps to solve thorny issues and in general works to improve the quality of the code.

Make peer review the new normal

While peer review is an essential part of both the scientific and academic publishing world, it seems to have only recently gained some momentum in software development, where even modest applications can have thousands of lines of code -- and thus tens of thousands of opportunities for error.

Successful peer reviews are a significant indicator of quality and, if implemented regularly, peer reviews can save a lot of time and money. If errors are identified and corrected before they're integrated into further builds, there will be fewer defects and projects will get delivered more quickly. Indeed, the book "Code Complete" indicates that after instituting peer review, "[t]he Aetna Insurance Company found 82 percent of the errors in a program by using inspections and was able to decrease its development resources by 20 percent." Reducing your coding expenses by a fifth is a real savings, and it's done entirely by utilizing the human resources you already have.

If you're game, you could quietly implement a peer review program by tapping a couple of programmers who respect each other and the process, and watch how other developers or teams react when they see the quality of the code improving. (Of course, this could already be happening in your organization on an informal basis.) Or you could take a top-down approach and simply implement a culture and process of peer review as part of the new normal.

5 common objections to peer review and how to overcome them

However you get there, you're bound to hear some grumblings as you begin a peer review program. Here are some common complaints:

Like any cultural change, it takes time. But with your executive sponsorship and buy-in, it can succeed. Your best developers will appreciate the fact that good quality code is the point of the exercise. Your junior coders may hone and improve their skills by virtue of seeing first-hand how more experienced programmers write. And you may save time and money by wasting fewer resources debugging errors, and getting more done in the process with the same headcount.

What's not to like

(www.cio.com)

Jonathan Hassell