Automated Code Review via Intent-Prompted LLM
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Manual code review is time-consuming and prone to human errors, as it requires peers to thoroughly understand and inspect source code for errors, best practices, and vulnerabilities.
Innovation Solution
A system that uses a large language model to predict code review comments by analyzing code changes, intent classification, and context, thereby automating the code review process.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If manual code review is performed by peers, then code quality and error detection improve, but time consumption and human errors increase
Solution Approach 1:
The patent replaces the manual mechanical review process with an automated system using large language models and code analysis algorithms. The system automatically analyzes code changes, generates review comments, and identifies issues without human intervention, thereby reducing time consumption while maintaining review quality through consistent algorithmic application.
Solution Approach 2:
The code review system performs self-analysis by automatically examining code changes, identifying potential errors, and generating review comments. The system serves itself by using pre-trained models and analysis algorithms to conduct reviews without requiring human reviewers to manually examine each code change, thus eliminating time loss while preserving detection accuracy.
2Measurement precision
If manual code review is performed, then comprehensive code inspection is achieved, but human errors and inconsistency increase
Solution Approach 1:
The patent replaces human reviewers with automated analysis systems that apply consistent algorithms and criteria to all code reviews. This substitution eliminates human variability and inconsistency while maintaining high detection precision through sophisticated code analysis models that systematically evaluate code against established standards and patterns.
Solution Approach 2:
The system changes the parameters of code review from human judgment to algorithmic analysis with defined thresholds and criteria. By transforming subjective human evaluation into objective parameter-based assessment, the system achieves both high precision in error detection and consistent application across all reviews, eliminating the inconsistency inherent in manual processes.
3Productivity
If automated code review is implemented, then time efficiency improves, but understanding of complex code logic may deteriorate
Solution Approach 1:
The system performs preliminary analysis by pre-processing code changes and extracting relevant context before generating review comments. This preliminary action includes identifying code patterns, understanding data flow, and contextualizing changes within the broader codebase, enabling the automated system to maintain deep code understanding while operating at high speed.
Solution Approach 2:
The patent introduces an intermediary layer of code analysis models that bridge the gap between raw code changes and review comments. This intermediary systematically processes code through multiple analysis stages, preserving contextual understanding while enabling high-throughput automated review, thus maintaining code comprehension without sacrificing productivity.
Data Source
AI summary
A code review is automatically generated by a large language model given a prompt that includes code changes made to a source code program, an associated intent, and an extended context. The intent represents an issue with the code changes from a code reviewer's perspective and is predicted from a neural classifier given the code changes in a code diff format. The neural classifier is a neural encoder transformer model pre-trained on various code review datasets and fine-tuned on code diff hunks of code changes labeled with an intent.


