About Vlad Mihalcea

Vlad Mihalcea is a software architect passionate about software integration, high scalability and concurrency challenges.

Code review best practices

Code review is a great software instrument and you should definitely use it to improve the quality of your code. But like any other tool, it may be misused sometimes. That’s why I came up with a list of best practices to guide you when reviewing your peers’ code.
 
 
 
 
 
 
 

  1. Code review is not testing: Code review is a developer-to-developer business and it doesn’t involve any testing. Code review should check if the task requirements are met in the cleanest possible way.
  2. You don’t tell what to code review: The same way you don’t tell a tester what to test, you should never tell your peer what to review. The magic of peer review comes from your peer own perspective on the current task design and implementation. Two minds are always better than one.
  3. You should always check all changes: Bugs may be hidden anywhere and you should search for them diligently. To have the whole picture you need to go through all changes.
  4. Requirements first: Requirements are the most important driving force. After all that’s what the customer is paying for. If the current changes are suboptimal you need to reopen the issue. If you happen to spot other code sections that need to be refactored you should create new issues instead of reopening the current one. The “single responsibility principle” applies to tasks as well as to coding.
  5. One-to-many activity: If you can’t make sure you grasp the code change intention it’s safer to ask somebody else to review it further.
  6. A way of learning: Code review is a great learning technique especially on large projects. Ideally you should become familiar with every aspect of your project, but if the project is too large you can at least specialize in multiple modules.

Happy code reviewing!
 

Reference: Code review best practices from our JCG partner Vlad Mihalcea at the Vlad Mihalcea’s Blog blog.
Related Whitepaper:

Software Architecture

This guide will introduce you to the world of Software Architecture!

This 162 page guide will cover topics within the field of software architecture including: software architecture as a solution balancing the concerns of different stakeholders, quality assurance, methods to describe and evaluate architectures, the influence of architecture on reuse, and the life cycle of a system and its architecture. This guide concludes with a comparison between the professions of software architect and software engineer.

Get it Now!  

Leave a Reply


+ eight = 13



Java Code Geeks and all content copyright © 2010-2014, Exelixis Media Ltd | Terms of Use
All trademarks and registered trademarks appearing on Java Code Geeks are the property of their respective owners.
Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries.
Java Code Geeks is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.

Sign up for our Newsletter

15,153 insiders are already enjoying weekly updates and complimentary whitepapers! Join them now to gain exclusive access to the latest news in the Java world, as well as insights about Android, Scala, Groovy and other related technologies.

As an extra bonus, by joining you will get our brand new e-books, published by Java Code Geeks and their JCG partners for your reading pleasure! Enter your info and stay on top of things,

  • Fresh trends
  • Cases and examples
  • Research and insights
  • Two complimentary e-books