Code Review Assistance for Dynamically Typed Languages

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Traditional code review methods for dynamically typed languages are time-consuming and inefficient, as errors are discovered and fixed serially during runtime, requiring significant time investment and manual effort.

Innovation Solution

A code review system utilizing a neural network, specifically an encoder-decoder LSTM model, analyzes source code to generate review suggestions by predicting data structures for function calls and comparing them to actual structures, identifying errors and providing recommendations for simultaneous review of multiple code segments.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If traditional manual code review methods are used for dynamically typed languages, then code quality can be ensured through thorough review, but the time and effort required for code review increases significantly

Engineering Contradiction:
Improvecode qualityVSAvoidcode review time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent replaces manual mechanical code review processes with an automated machine learning system. The neural network model automatically analyzes code segments, identifies errors, and generates review suggestions, substituting human reviewers with an automated system that operates faster and consistently.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Solution Approach 2:

The patent introduces a machine learning model as an intermediary between code submission and human review. This intermediary automatically pre-analyzes code, identifies potential errors, and prepares review suggestions, reducing the burden on human reviewers and accelerating the overall review process.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Adaptability or versatility

If errors in dynamically typed languages are discovered during runtime, then the language flexibility is maintained, but errors are discovered serially requiring significant time investment

Engineering Contradiction:
Improvelanguage flexibilityVSAvoiderror discovery efficiency
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

The patent performs preliminary error detection by analyzing code before runtime execution. The machine learning model statically analyzes code segments to identify potential errors in advance, allowing multiple errors to be detected simultaneously rather than serially during runtime, thus improving productivity while maintaining language flexibility.

Inventive Principle:
Principle #10Preliminary action

3Measurement precision

If reviewers manually check source code uploaded to repositories, then thorough error detection is possible, but the process requires significant manual effort

Engineering Contradiction:
Improveerror detection accuracyVSAvoidreview process simplicity
Core Design Contradiction:
Measurement precisionVSEase of operation

Solution Approach 1:

The patent enables the code review system to serve itself by automatically analyzing code and generating review suggestions without requiring manual reviewer intervention for each code segment. The machine learning model autonomously performs error detection and prepares comprehensive review feedback, reducing manual effort while maintaining detection accuracy.

Inventive Principle:
Principle #25Self-service

Data Source

PatentUS11157384B2Methods, systems, articles of manufacture and apparatus for code review assistance for dynamically typed languages
Publication Date: 2021.10.26 INTEL CORP
  • US11157384B2 patent drawing
  • US11157384B2 patent drawing
  • US11157384B2 patent drawing

AI summary

Methods, apparatus, systems and articles of manufacture are disclosed for code review assistance for dynamically typed languages. An example apparatus to analyze a segment of code includes a function identifier to identify a first input of a first function call included in the segment of the code, a parameter type vector (PTV) estimator model to estimate a first data structure based on the first input, the PTV estimator model generated via a set of reviewed code, a PTV determiner to generate a second data structure based on a data parameter type of the first input, an error comparator to determine a first reconstruction error based on the first data structure, and the second data structure and a recommendation generator to, if the first reconstruction error does not satisfy a recommendation threshold, generate a first recommendation to review the first function call.