22 Point Code Review Checklist & Process Guidelines
22 Point Code Review Checklist & Process Guidelines
Code review is a very important process in software development life-cycle. It is unfortunate to realize that its
also frequently ignored. A proper code review plays really significant role in quality of a software.
There are many tools available to check for common coding mistakes, however a peer code review can not
be avoided by use of any tool.
A well defined code review process is essential to make developers life painless. Below is a checklist that
you can use to establish a code review process in your organization.
Automate
Automation of mundane tasks is absolutely necessary to eliminate undesired efforts from developers.
Automation play key role in driving effectiveness of code review process. There are multiple opportunity for
automation in a development process.
Build automation - This may sound obvious, however it is the most important step before starting
to review code.
Use Static Code Analyzers - Static code analyzers are programs that can identify common
mistakes. Sometimes, they can reduce the burden of manual code reviews. It also promote
standard coding practices.
Use Code review tools for review comments and more. - These are the tools that you can use for
peer code review. There are many code review tools available for free. These tools can help you
keep track of code review feedback and changes.
Continuous Integration tools - Continuos integration is important step in ensuring code quality for
a large team. Use of static code analyzers & code coverage tools along with Continuous
integration can help control code quality. There are tools that can fail the build if a specific code
quality threshold is not achieved during build.
Code Compiles
Compilation of a source code is absolutely mandatory. A developer does not need to review the source code
that does not compile.
The first pre-requisite before you even think about starting code review.
Making sure all major compiler warnings are removed.
Unit Tests
A developer must have unit tests for all code changes. Its a peer code review best practice to also review unit
tests and ensure all scenarios are covered.
Must have pre-requisite for starting code review.
Continuous Integration
Use of continuos integration tools is key in early identification of code quality issues. Any poor quality code
should be immediately visible and be resolved. This avoids backlog of minor issues that never gets attention
in future.
Code Is Functional
A peer code reviewer need to ensure the code is functional and performs the expected job. This may
involve sitting with the developer and doing a test run and observing results.
There needs to be enough logging in the code. Code needs provide enough logging to work in
debugging mode for application.
There needs to be enough comments in the code.
There needs to be enough monitoring related code.
Code Documentation
Writing code comments is helpful however not always necessary. Sometimes the code is not self
explanatory, or does something un-usual. It needs to be well documented.
Exception Handling
Exception handling code is often ignored in critical timelines. A code reviewer must ensure that sufficient
exception handling is done in code. Unit test cases should also be addd to check for all exception scenarios.
Some common exception scenarios are
Null objects
Empty objects
Invalid format values
Boundary conditions
Code Performance
Performance of the code is important, however difficult to measure depending on type of software. Its
important that a code reviewer looks at the performance of a code in various aspects.
Time to do the task - How much time it take to finish the task. Is it acceptable?
Memory or Number of objects used to do the task. Is it acceptable?
Number of threads or processes to do the task. Is it acceptable?
Concurrency limits of the task. How many tasks can be performed by the program concurrently
.
Scalability
Scalability of the code may be a important concern, depending on your requirements. Its important that a
code reviewer looks at the scalability of a code in various aspects.
Releasing Resources
Releasing resources in a busy application is really important step that is often missed out by hasty
developers. Ensure all important and shared resources are being released by each code block. Following
scenario must be covered
Summary
Hope you will find these code review best practices useful. Try to implement it in your everyday development
process and observe a guaranteed improvement in the software quality.