Code Review Should Be Completely Taken Over by AI
Writing code was not enough, now the AI world has decided to create tools that can monitor, edit, and even review code. Well it turns out that AI is actually better at reviewing code than humans, and computers are all you need. A brilliant example for this are tools like CodeAnt, CodeRabbit, or SonarQube, which take the task of reviewing code onto their own hands. “Code reviews are dumb, and I can’t wait for AI to take over completely,” said Santiago Valdarrama, who believes that we are not far when the reviewing process might be completely automated. But it isn’t a take that doesn’t come with a lot of contention. Unpopular opinion: Code reviews are dumb, and I can't wait for AI to take over completely.​And we are not far!​You can review any pull request today in any of the most popular languages 10x faster and with 10x more impactful results.​Shocking idea: Computers are much better… pic.twitter.com/8dUSwMLOYw— Santiago (@svpino) September 24, 2024 “My colleagues approve my PRs without even looking at it,” he noted, highlighting a common issue in code reviews. For him, an automated solution would be welcome. “When you review code, most of the time, you have no idea what you are even reading.” While speaking with AIM, Amartya Jha, the co-founder and CEO of CodeAnt AI said that developers spend 20 to 30% of their time just reviewing someone else’s code. “Most of the time, they simply say, ‘It looks good, just merge it,’ without delving deeper,” Jha explained. This leads to bugs and security vulnerabilities making their way into production. Still he said that the quality of code generated by AI is still far from what humans do. But when it comes to reviewing the code, maybe AI could take over. Saurabh Kumar, another developer, argues, “I will let AI review my code when it can write better code than me—boilerplating doesn’t count.” For better or worse, code reviews are part of the job One of the key advantages of AI in code review is its ability to process vast amounts of data quickly, freeing up human developers to focus on higher-level tasks. As Mathieu Trachino pointed out, many code reviewers don’t actually dive deep into the code they’re supposed to evaluate. The debate ultimately boils down to whether AI can reach a level of understanding and context that is currently unique to human developers. Santiago Valdarrama pointed out that reviewing code is actually easier than writing it, implying that AI might be better suited to code review than code generation. However, some remain skeptical. Many developers like Trachino envision a future where AI can conduct code reviews more effectively than their human counterparts. Petri Kuittinen echoes this sentiment, noting that traditional line-by-line reviews are no longer cost-effective. While there’s optimism about AI taking over code reviews, many developers argue that a complete handover could overlook key human elements. Sebastian Castillo said, “Code review also serves to share knowledge between team members and as a way for more people to be familiar with the wider context of the product implementation,” highlighting that it is important for a human touch while reviewing code. AI can’t replace the collaborative learning and communication that occur during human-led code reviews. Which seems true. Recognising the benefits of AI but cautioning against eliminating human interaction entirely. Can AI Fully Replace Human Code Reviews? Drawing a parallel between AI decision making and the Boeing 737 Max incidents, a user argued that AI enhancement of this is helpful, but it should not replace code reviews. “Boeing 737 Max programmers thought the same as well.” In essence, AI lacks the capacity to understand the long-term strategic goals of a project. “For anything even remotely critical, my opinion is that AI code reviews are a terrible idea,” said a developer on a Reddit discussion. But this is also something that modern platforms like CodeAnt have addressed. One of CodeAnt AI’s standout features is its ability to allow enterprises to input their own data and create custom policies. In complex systems where safety and security are critical, human oversight remains essential, but this is something that companies are focusing on improving. While AI can flag bugs right now, enforce style guides, or detect inefficiencies, the final call on whether code aligns with the larger system architecture and product vision should likely remain with humans—at least for the time being.
AI is just simply better at reviewing code than humans. Or is it?
Writing code was not enough, now the AI world has decided to create tools that can monitor, edit, and even review code.
["Generative AI"]
["Go", "programming_languages:R", "AI", "RPA", "ML", "programming_languages:Go", "Aim", "Generative AI", "R"]
["AI", "ML", "Aim", "R", "Go", "RPA", "programming_languages:R", "programming_languages:Go"]
Mohit writes about AI in simple, explainable, and often funny words. He's especially passionate about chatting with those building AI for Bharat, with the occasional detour into AGI.