02 October 2012

Importance of Code Review


Being a developer, all know the pain of silly or mistakes  for which we are not aware on ourselves. For ex., A wrong attribute here, a misspelled property there, an accidentally duplicated line of code which we missed or even a simple $ before the opening PHP tag which you accidentally put there because IDE was not started and you spend an hours to find this issue and fix it.
Code review can be very difficult to implement/follow, especially in a team those who aren’t used to it. But once done, it will not only decrease the number of defects in your code, it will also increase collaboration and help team building, improve team spirit amongst developers and will help best practices and improvement of skill in entire  department. Any type of code review is better than none.

Wikipedia says that Code review is systematic examination (often known as peer review) of computer source code. It is intended to find and fix mistakes overlooked in the initial development phase, improving both the overall quality of software and the developers’ skills. Reviews are done in various forms such as pair programming, informal walkthroughs, and formal inspections.
The Types of Code Review
  1. Personally assisting developer line by line about their code and getting it fixed. It is best for small team size and small size projects.
  2. Tools - there are some tools available but these are paid but we can try their free versions. For ex.,PHPUnit
  3. Interchanging code files for code review and getting their review observed.
Best Practices for Code Review
  1. Try to identify common mistakes and start reviewing from those points/areas.
  2. Keep code reviewed at the end of each milestone.
  3. Be good while finding bugs. It is for improvement of application only and not blame anything.


    Based on agile method, we can utilize a day once in a week or bi-week for SVN/backup, Code review.

No comments: