DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workkloads.

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Open Source: A Pathway To Personal and Professional Growth
  • Enhancing Software Quality with Checkstyle and PMD: A Practical Guide
  • Linting Excellence: How Black, isort, and Ruff Elevate Python Code Quality
  • Mastering GitHub Copilot: Top 25 Metrics Redefining Developer Productivity

Trending

  • Zero Trust for AWS NLBs: Why It Matters and How to Do It
  • Hybrid Cloud vs Multi-Cloud: Choosing the Right Strategy for AI Scalability and Security
  • Apache Doris vs Elasticsearch: An In-Depth Comparative Analysis
  • Chaos Engineering for Microservices

Sample Code Review Checklist

An explanation of why code review is important, and an example of how to properly review code.

By 
Oguzhan Dogan user avatar
Oguzhan Dogan
·
Jul. 17, 19 · Tutorial
Likes (18)
Comment
Save
Tweet
Share
26.6K Views

Join the DZone community and get the full member experience.

Join For Free

Code review is one of the most important steps in nowadays' SDLC. In some companies, the unreviewed code wouldn't merge. The purpose of code review is not only about finding the missing parts or checking the other developer's code, but also about learning the logic behind the implementation, learning more about business logic and improving the software quality of the team.

There aren't any strict rules for code reviews. For your team, you may say that one reviewer is enough, whereas, for a different team, all of the developers are required for review. It's up to your team and your team's dynamics. The team should communicate with each other and agree on a code review checklist. This checklist can contain a set of rules including checking business logic implementations, doing performance checks, checking code format and best practices, etc.

Below is a sample code review checklist, which can be helpful when thinking about the parts of the code that need the most focus. Feel free to add or take away steps that you feel will be beneficial to your company!

  • Be careful about code format. The team needs to agree on a format and everyone in the team should use that format.*
  • Ensure that proper naming conventions (Pascal, CamelCase, etc.) have been followed. If you code Java, then you need to follow Java naming conventions. (E.g. Class names should start with capital letters, method names start with lowercase letters, etc.)
  • Remove comments if they give no information! Comments should explain why the code is written. Comments may also be used if there are complicated business rules or workaround solutions. Other comments should be removed.
  • Attention should be paid to the architectural approach of the written code. The code should split into multiple layers. The MVC design pattern must be maintained and any parts that do not fit the layered architecture should be corrected.
  • The code should not disrupt the existing architectural structure. Code that does not preserve the existing structure must be corrected.
  • If there is a hard-coded variable in the code, it must be assigned to a constant or a configuration variable.
  • Check that similar variables can be grouped under an enum.
  • Verify that existing libraries/classes are used instead of writing code from scratch.
    • Anything should be removed if another library is used that does the same work as the existing libraries in the application.
  • The purpose of the written code should be understood from the related issue** or the code itself. If no code belonging to the requested business rule has been written, it must be corrected.
  • The code blocks should be concise. Make sure that the code is separated into blocks and each block has its own and only one responsibility. (Single Responsibility Principle)
  • It's better to check whether SOLID principles are applied or not.***
  • Code duplication should be checked, if there is a code written for the same purpose in the project, that code should be used or changed so that it can be used. (Don't Repeat Yourself)
  • Edit any unreadable and not properly named code. The method or class name should describe its work correctly.
  • Be sure that exceptions and errors are handled and logged properly. If the method returns an error code, check that if it describes the error properly.
  • The code should be checked for security as possible as you can. Be aware of SQL Injection, XSS, Man in the middle, etc. Specifically, check the implementation behind the HTTP 3xx redirects.
  • Performance controls should be done. Possible null pointer exceptions, cache errors, possible lazy initialization exceptions, String + String usages instead of StringBuilder should be fixed.

The above checklist is optional and you're free to change, remove, and add the elements. This checklist is here for you to be inspired and get a code review approach. The main purpose of code reviews is to improve your codebase, improve your team's development skills, share knowledge, communicate, and —finally— write good code.

It will take some time for a reviewer to review code effectively, but after some experience, the reviewers will review code quickly and efficiently!

Happy code reviews!

*: As Uncle Bob said in Clean Code, Code formatting is important. It is too important to ignore and it is too important to treat religiously.

**: Issues should be tracked by an issue tracking system. And it's better not to code anything without an issue.

***: SOLID principles is a highly deep object to discuss. Here you can start https://en.wikipedia.org/wiki/SOLID

code style

Opinions expressed by DZone contributors are their own.

Related

  • Open Source: A Pathway To Personal and Professional Growth
  • Enhancing Software Quality with Checkstyle and PMD: A Practical Guide
  • Linting Excellence: How Black, isort, and Ruff Elevate Python Code Quality
  • Mastering GitHub Copilot: Top 25 Metrics Redefining Developer Productivity

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!