16 Aug 2012

How to do efficient and good code reviews ?

8/16/2012

Code review is an integral and mandatory task that each one of the developer has to complete to ensure quality and architectural alignment of the code written.

Mostly code reviews create unnecessary rework and adds on overhead to the overall delivery model if not done with the right context and right focus.

Things to be be taken into account before you do a code review
  • Get complete context of the functional behavior that is targeted to be achieved via the code
  • Make sure that you are versed with the technology stack and frameworks being used for implementation
  • Refer to project specific code standard guidelines and/or development guide if present in the project. In case there is no project specific standard, do refer to Technology standard guidelines.
To make justice and bring in value add with the code review you do, its very important that these prerequisites are met even before you give a single line of review comment.

Do's and Dont's while doing code review

Do's
  • Always mention the severity of the defect
  • Code review comments should be very clear and pointed to the exact problem
  • Mention package ,class & method name always while giving specific code review comments
  • Try to include pseudo code snippets in your remarks when ever suggesting bigger changes
  • Club similar issues and remarks 
Dont's
  • Avoid giving generic or bigger comments without going through the whole code.
  • Don't do code reviews on notepad or word pad, do it on a IDE
  • Do not assume anything and skip files, review every thing

Best practices to ensure better code quality while development
There are some standard measures and practices which if used would drastically improve the quality of code at the developers end. 
  • Use code quality control plugin's in your IDE such as PMD, Check-style, Fortify etc.
  • In case there some project specific coding guidelines, mention it in the rule set of the code quality plugins
  • Have a developer guide for the project which highlights and baselines basic coding structure and standards for the project.

Written by

We are Creative Blogger Theme Wavers which provides user friendly, effective and easy to use themes. Each support has free and providing HD support screen casting.

0 comments:

Post a Comment

 

© 2013 NimbleGeek. All rights resevered. Designed by Templateism

Back To Top