With increasing number of features to support, growing code bases, and large teams to work with, developers naturally look to automation as a path to ensuring code quality. Indeed, unit testing, static analysis, and continuous integration frameworks have contributed greatly to automating code quality assurance.
According to Matt Quail, a partner with Cenqua, however, some things about code quality are hard, and even impossible, to automate. Human eyeballs going over the code are still the best tools for those hard-to-automate aspects of ensuring code quality, according to Quail, who recently architected and built Cenqua's new code review product, Crucible.
At JavaOne 2007, we asked Quail what role code reviews play in environments that favor the automation of repetitive, error-prone tasks, such as finding bugs and identifying defects in code. One question in this brief interview focused on the relationship between unit testing and code reviews:
Both unit testing and code reviews are about reducing defects in your code... Not only is the point of code review finding bugs, but it also gives visibility to the rest of the team into the code. Everyone in your team gets to see the code...
There are somethings you can't unit test. You can't unit test design or architecture. And sometimes you can get unit tests wrong—you might assert the wrong things. There is always a place for human eye-balling of code.
At the end of the day, code review should be about reading code and ... deciding whether there are any problems with it... [Code reviews] are often heavy-weight, and you end up with a lot of impediments to getting it done... You should spend as much time reading code as possible, and you should spend time on anything else associated with the review as little as possible...
|Matt Quail, a partner at Cenqua, talks about the role code reviews play in the development process. (4 minutes 28 seconds)|
What's the biggest benefit you've gotten out of code reviews? What code review process has worked for you?Post your opinion in the discussion forum.
Bill Venners is president of Artima, Inc. He is author of the book, Inside the Java Virtual Machine, a programmer-oriented survey of the Java platform's architecture and internals. His popular columns in JavaWorld magazine covered Java internals, object-oriented design, and Jini. Bill has been active in the Jini Community since its inception. He led the Jini Community's ServiceUI project, whose ServiceUI API became the de facto standard way to associate user interfaces to Jini services. Bill also serves as an elected member of the Jini Community's initial Technical Oversight Committee (TOC), and in this role helped to define the governance process for the community.
Frank Sommers is Editor-in-Chief of Artima Developer. He also serves as chief editor of the IEEE Technical Committee on Scalable Computing's newsletter, and is an elected member of the Jini Community's Technical Advisory Committee. Prior to joining Artima, Frank wrote the Jiniology and Web services columns for JavaWorld.