How to lead a code review

23.12.2008

Some people feel that code reviews are inherently , so the proper participants are a senior developer or team lead and the (usually junior) developer who reports to him. Most, however, expect that the code review involves bringing several people into a room. The key is balance-whatever it takes to get it.

For distinguished engineer , an ideally balanced code review team consists of a hands-on software developer (typically a peer of the contributor), an (who is aware of the software' future direction) and someone in the middle (typically a project lead) who constantly has to between time-to-market and the future needs of the software.

"I have seen some very good decisions result when this balance is present," Todd says. "For example, programmers have used static, hard-coded data structures (e.g. arrays) to efficiently store small amounts of information. The software contained no bugs and was well written. There were no issues from the project leader or the peer software developers. However, the architect pointed out that the future product would need to be much more scalable, and suggested abstractions layers to 'hide' that a static array was being used. This resulted in much more extensible software, even though the code review found no defects. Balance is a key aspect of code reviews."

That balance can come from outside the core team, too. It can also help to include reviewers from different development teams, according to Manoranjan (Mano) Paul, the software assurance advisor for (ISC)2, "so that a different perspective and ease of understanding of the code (for maintainability) is determined in addition to determining coding issues."

That viewpoint has quite a bit of support. Says Jeffrey Henning of PRC Vovici, "The best reviews have been when we have cross-functional representation, so that we have a UI person, a DBA, the programmers, and everyone has come prepared, everyone has looked at the code." Henning points out that might have an insight the coder didn't have; the in mind. "As a result, we get the benefit of all these different perspectives."