Click here to Skip to main content
13,298,965 members (41,295 online)
Click here to Skip to main content
Add your own
alternative version

Stats

65.7K views
619 downloads
142 bookmarked
Posted 16 Nov 2016

Code Review Checklist

, 24 Feb 2017
Rate this:
Please Sign up or sign in to vote.
An Ideal Code Review Checklist that applies for most programming languages

Introduction

The purpose of this article is to propose an ideal and simple checklist that can be used for code review for most languages. Even though there are a lot of code review techniques available everywhere along with how to write good code and how to handle bias while reviewing, etc., they always miss the vital points while looking for the extras. The main idea of this article is to give straightforward and crystal clear review points for code reviewers to review efficiently with least time possible.

Purpose of Code Review

The ultimate purpose of code review is to investigate the code to find weak spots, faults, strengths and ways to optimize the code for better performance. It is mainly to deliver a bug-free (at least near perfect) application that meets the purpose (requirements) while meeting the industry standards.

The code review checklists are illustrated in two parts:

  • Code Review Checklist - Fundamental
  • Code Review Checklist - Comprehensive

Code Review Checklist - Fundamental

Fundamental code review

  1. Objective based [Purposeful]

    The code achieves its purpose. In simple terms, it does what it is supposed to.

  2. Unbreakable [Validated]

    Validations are used wherever necessary. The code never breaks under any circumstances. Especially under invalid inputs that come from the user end. Regardless of it being a negative, over-sized, invalid format, etc., every input passed should be processed, sanitized before taking it further. Every object is checked for its actual data existence before accessing its properties.

  3. Responses are handled [Error handling and Data formatting]

    Not just the error messages, every response that is returned by the server must be properly handled. It should have necessary headers, response messages, error codes and any other necessary details attached with it in required format. All possible scenarios are tested to avoid deadlocks, timeouts, etc.

  4. Follows architecture [No design deviation]

    Verify that the approved architecture/design is followed throughout the application (If there is none, consider putting it in place). If there are any design changes required, ensure that these are documented, baselined and approved before implementing them in the existing code.

  5. Unit tested [Reliable]

    Every core method has a unit test which passes.

  6. Reusable [No repetition]

    All methods serve a limited and clear purpose (follows DRY principle). Functions are reused wherever applicable and written in such a way that they can be re-used in the future implementations. There is no duplication of code. Logics make use of general functions without ambiguity.

  7. Performance oriented [Speedy response & Scalability]

    The landing of the application is swift. There are no long delays between the requests and responses. Raw string concatenations are avoided and proper methods such as StringBuilder are used. The code is scalable and able to handle a large amount of data and upcoming features.

  8. Secure [Safe code]

    The code is secure in terms of authentications (with encryption), injections, roles, unauthorized access, directory browsing, SQL injection, cross-side scripting, etc. It follows the OWASP 10 security principles.

Code Review Checklist - Comprehensive

Advanced code review

  1. Manageable [Crisp and Formatted]

    The code is readable, commented and easy to manage. It is friendly formatted and easy to read/understand. Methods are not too big to manage and they don't exceed readable size.

  2. Meets coding conventions and standards [Standardized approach]

    The code follows the coding conventions, standards and is consistent with the existing application code. There are no commented code and hard coded values.

  3. Detach connections after usage [Memory handling]

    Resources that are not automatically released after usage are freed. Connections, ports are closed properly.

  4. Has configurable logging[Traceability]

    Log every transaction or the ones that require logging. They are stored in a repository (as a file) as well as in the database (as text). Logging in different stages for different purposes can be enabled/disabled in the configuration file (like web.config)

  5. Code coverage is more than 95% [Efficiency]

    Code coverage is as important as the unit test cases passing. 95% of the code is covered (which means 95% code is actually tested via unit test cases).

  6. On-demand resource delivery[Fast]

    Resources are fetched and delivered only on demand. Necessary options are available for dealing with huge data such as paginations, etc.

  7. No warnings / console logs [Data safety]

    No compiler warnings arise while running the application. Logs that are used while developing are cleared and none of the application information (especially the sensitive ones) are written in the browser console.

  8. Legal usage of third-party tools/libraries[Licencing]

    External libraries are used only if proven necessary for the application. If there are third-party tools or libraries used, then the licenses and legal usages are verified and complaint.

References

Conclusion

The above checklist is vital to have a high-quality code that meets the requirements and performs at its best while being secure, scalable and swift. There will always be more points to add to this list. It is recommended to go for every good to have points while reviewing after making sure the primary checklists are checked.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Ebenezar John Paul
Software Developer Gislen Software
India India
Ebenezar John Paul is a Software Engineer | Writer | Mentor | Life coach | Blogger | Programmer | CSR Executive. He loves to code and rethinks the conventional way of everything that the world is used to.

He takes privilege in getting inspired by great stories and wisdom of passionate peoples/entrepreneurs and returning the favor on the powerful blogging platform.

He believes that pushing limits is the only way to find out what we are really capable of, which is how the human race can redefine impossible and perfection.

And he prefers ideas over rules, results over excuses, people over things, satisfaction over completion and passion over any other.

You may also be interested in...

Pro

Comments and Discussions

 
QuestionMessage Closed Pin
23-Aug-17 2:04
memberMember 1337451923-Aug-17 2:04 
GeneralMy vote of 5 Pin
dpsol2-Dec-16 5:26
memberdpsol2-Dec-16 5:26 
GeneralRe: My vote of 5 Pin
Ebenezar John Paul8-Dec-16 20:00
professionalEbenezar John Paul8-Dec-16 20:00 
QuestionVote of 5 Pin
Nelson Costa Inácio2-Dec-16 4:54
memberNelson Costa Inácio2-Dec-16 4:54 
AnswerRe: Vote of 5 Pin
Ebenezar John Paul8-Dec-16 19:59
professionalEbenezar John Paul8-Dec-16 19:59 
QuestionFor manageable I would add well named objects. Pin
AdrianJ2K1-Dec-16 6:00
memberAdrianJ2K1-Dec-16 6:00 
AnswerRe: For manageable I would add well named objects. Pin
Ebenezar John Paul8-Dec-16 20:00
professionalEbenezar John Paul8-Dec-16 20:00 
PraiseI Love a Good Checklist Pin
Ed24329-Nov-16 6:18
memberEd24329-Nov-16 6:18 
GeneralRe: I Love a Good Checklist Pin
Ebenezar John Paul8-Dec-16 20:01
professionalEbenezar John Paul8-Dec-16 20:01 
GeneralGood list, and I'd like to add this one Pin
wmjordan29-Nov-16 3:02
professionalwmjordan29-Nov-16 3:02 
GeneralRe: Good list, and I'd like to add this one Pin
Ebenezar John Paul8-Dec-16 20:02
professionalEbenezar John Paul8-Dec-16 20:02 
GeneralMy vote of 5 Pin
DanielBrownAU28-Nov-16 12:24
professionalDanielBrownAU28-Nov-16 12:24 
QuestionGreat article; a couple of discussion points Pin
gogbatch28-Nov-16 5:11
membergogbatch28-Nov-16 5:11 
AnswerRe: Great article; a couple of discussion points Pin
wmjordan1-Dec-16 3:44
professionalwmjordan1-Dec-16 3:44 
GeneralRe: Great article; a couple of discussion points Pin
Ebenezar John Paul9-Dec-16 0:33
professionalEbenezar John Paul9-Dec-16 0:33 
GeneralRe: Great article; a couple of discussion points Pin
wmjordan9-Dec-16 2:45
professionalwmjordan9-Dec-16 2:45 
QuestionThanks for sharing Pin
Member 1285830828-Nov-16 2:48
memberMember 1285830828-Nov-16 2:48 
GeneralMy vote of 5 Pin
Dmitriy Gakh25-Nov-16 10:53
professionalDmitriy Gakh25-Nov-16 10:53 
AnswerRe: My vote of 5 Pin
Ebenezar John Paul25-Nov-16 15:36
professionalEbenezar John Paul25-Nov-16 15:36 
GeneralAwesome article Pin
Mohammed Hameed23-Nov-16 22:09
professionalMohammed Hameed23-Nov-16 22:09 
GeneralRe: Awesome article Pin
Ebenezar John Paul24-Nov-16 4:48
professionalEbenezar John Paul24-Nov-16 4:48 
QuestionVery good. Pin
Mike Diack23-Nov-16 6:53
memberMike Diack23-Nov-16 6:53 
AnswerRe: Very good. Pin
Ebenezar John Paul24-Nov-16 4:50
professionalEbenezar John Paul24-Nov-16 4:50 
GeneralMy vote of 5 Pin
Marc Clifton22-Nov-16 3:02
protectorMarc Clifton22-Nov-16 3:02 
AnswerRe: My vote of 5 Pin
Ebenezar John Paul22-Nov-16 7:26
professionalEbenezar John Paul22-Nov-16 7:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.171207.1 | Last Updated 24 Feb 2017
Article Copyright 2016 by Ebenezar John Paul
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid