All Articles

Beyond LGTM: Master Code Reviews with AI

A streamlined approach to code review—focused on clarity, precision, and outcomes—transforms the process into a faster, more effective workflow that drives stable releases.

Blog
12.12.2024
Nimrod Kor, CTO & Co-Founder
3 min

Code review practices have been engrained into the routines of millions of developers. Yet, they often have room for growth and refinement. As a decades-long developer at both startups and corporations, I’ve reviewed tens of thousands of lines of code. I have experienced both the challenges and the immense potential of this critical process. With the right processes and tools, we can transform code reviews into an even more effective and empowering practice.

In this guide, we’ll explore what a top-tier code review process looks like today, particularly for our team at Baz. From setting up a PR to optimizing team collaboration, this post is your roadmap to mastering complex code reviews.

Grounding in developer intent

Understanding the intent for the change is the most important first framing for a reviewer, so it’s critical for the pull request (PR) to have a clear title, description, breakdown, and linked resources. A best in class PR should include:

  • A concise title that includes the clearly defined intent
  • Technical description with resources such as links to issues, images etc

The breakdown of the change into small logical steps organized by rational topics

View by Topics automatically organized in Baz

Where does it fit in the architecture

Second to intent, the next core area I need to ground myself in is where this fits in the architecture. Sometimes this is easy to understand, such as what triggers a function or extends its output, but more often it takes some digging to identify. I aim to craft a mental visualization and understand the modified application flow by sorting files and modules. Having a grasp on which APIs are potentially impacted like in Baz’s usage analysis sets the stage for better reviewing downstream changes. 

Usage to identify APIs touched in Baz

Now, as a reviewer, I have really grounded context from the intent to the architectural impact—allowing me to see the bigger picture and finer details seamlessly. Since some of the AI tooling accelerates my context understanding, I can spend more time focusing on where human review is most critical. For example, I can thoughtfully evaluate questions like: Is this what we wanted to implement? Does it align with the original requirements and design intent? Has it considered possible edge cases, potential errors, and how it might evolve in future iterations? By concentrating on these nuanced aspects, I ensure that the review not only improves code quality but also upholds our broader development goals.

Optimizing to review the implementation

This is where the review process truly starts. The goal here is to evaluate the implementation, as this is where your feedback can have the greatest impact on the author. To streamline and enhance this process, we’re building AI tooling that assists in identifying and highlighting areas that need attention, providing automated insights that help you focus your expertise where it matters most.

I focus on four key areas, with AI tooling supporting each step:

  1. Conventions and standards – Ensuring the code adheres to our organization's conventions and project-specific standards, covering everything from syntax to database connection management. Our AI tools can flag deviations from established patterns, reducing manual effort.
  2. Code quality – Assessing whether the code is readable, reusable, and maintainable, and if it follows the principles of encapsulation. AI tooling aids by scanning for potential anti-patterns or structural inconsistencies.
  3. Error handling – Evaluating how errors are managed throughout the code. AI can identify unhandled edge cases or suggest improvements to error-handling logic.
  4. Security and performance – Analyzing potential security risks and assessing performance optimizations. AI tools can surface vulnerabilities or highlight performance bottlenecks for a deeper human evaluation.

These core areas are where AI is truly transforming code reviews by going beyond simple automation to address complex and out-of-the-ordinary scenarios. With a baseline understanding of your codebase, AI in Baz doesn’t just automate repetitive tasks like spotting syntax errors or formatting inconsistencies—it provides tracing-driven insights that span repositories, languages, and architectural layers.

In this code review experience with Baz, reviewers gain unprecedented visibility into the impact of changes. For instance, Baz automatically detects breaking API modifications, such as removed or renamed endpoints, HTTP methods, parameters, response fields, or enum values. It also links API endpoints to code entry points, tracing parameter and return types even in complex scenarios involving destructured types or generics.

While our goal is to eventually replace the entire review process with AI, we’re starting by augmenting and enhancing the reviewer’s capabilities, ensuring they can focus on the high-impact aspects of the review. Baz enables a holistic understanding of the changes, showing their ripple effects across repositories and languages, empowering teams to deliver robust, scalable, and error-resilient code.

Breaking Changes automatically detected in Baz

Team collaboration

Rarely code reviews in complex code bases are just one cycle, which is why it’s critical to have a team workflow that keeps the author and all reviewers informed. Even in my single reviewer flow, I need to track my own progress. Diligence in working through reviews and marketing the key topics and chunks as viewed is a small operational step with major collaboration impact. 

For the team, envision having a comprehensive breakdown of review status—not just across changed files, but within the diff and across all topics. Imagine a top-down view that empowers reviewers to collaborate seamlessly, aligning efforts and focusing on what matters most. This level of clarity transforms the review process, making it more intuitive, efficient, and impactful for every contributor

Aside from tracking review changes in the PR, keeping both the author and reviewers notified on when to jump back in is another operational step with major productivity impact. Our team leverages Slack with assigned actions to ensure the right people are notified when the time is right. Sifting through GitHub notifications or inbox messages have become overwhelming for teams. 

Baz Slack integration for code review notifications

The future

There’s a lot of mixed feelings around the current state of AI code generation but one thing I do know is that the code review process is ripe for an overhaul. At Baz, we’ve distilled decades of engineering experience into a platform that transforms code reviews from a chore into a streamlined, impactful process. By blending thoughtful design with contextual AI, Baz empowers developers to focus on what matters most.

Ready to take your code reviews to the next level? Sign up for early access to Baz and join the movement to modernize your workflow. Get early access.

Discover the power of Baz.

Join our early access program and be part of shaping the future of code review.