13 Code reviews and AI

 

This chapter covers

  • Benefits of AI in code reviews
  • Limitations of AI in code reviews
  • AI-powered code review tools
  • The future of code reviews: Human-AI collaboration

AI is having its moment right now. We have AI-powered coding tools like GitHub Copilot (https://github.com/features/copilot) and Amazon CodeWhisperer (https://aws.amazon.com/codewhisperer/), which promise faster code writing and better code quality. We have Codium AI (https://www.codium.ai/) that “analyzes everything in and about your code and then suggests tests as you code.” We even have tools like DocuWriter.ai (https://www.docuwriter.ai/) to generate documentation for your code. AI is everywhere.

A 2023 GitHub survey asked 500 US-based developers at companies with more than 1,000 employees about how managers should consider developer productivity, collaboration, and artificial intelligence (AI) coding tools [1]. Some key findings are quite interesting: 92% of US-based developers are already using AI coding tools both in and outside of work [1]. Four out of five developers expect AI coding tools will make their team more collaborative. And 70% say AI coding tools will offer them an advantage at work. Naturally, the next thing developers wondered: What about AI code reviews?

13.1 Benefits of AI in code reviews

13.1.1 Expedited reviews

13.1.2 Code quality improvement

13.1.3 Review consistency

13.1.4 Review scalability for large teams and codebases

13.2 Limitations of AI in code reviews

13.2.1 Difficulty understanding context and domain knowledge

13.2.2 Capabilities are highly dependent on training data

13.2.3 Over-reliance on AI can hinder human reviewer expertise

13.3 What can an AI-powered code review do?

13.4 Integrating AI into your code reviews

13.5 The future of code reviews: Human-AI collaboration

Summary

References