Probabilistic Model for Source Code Generation and Correction

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing systems for automatically generating, completing, checking, and correcting source code are limited in quality and require significant human effort, with available debugging tools being difficult to use, especially for novices, and lacking in error correction capabilities.

Innovation Solution

A probabilistic model trained using a corpus of natural source code examples is employed to predict sequences of source code elements, incorporating source code analysis from compilers or analyzers, enabling automated generation, completion, checking, and correction of source code.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If automated source code generation systems are used, then productivity is improved, but the quality of generated code deteriorates

Engineering Contradiction:
Improvesource code generation speedVSAvoidcode quality
Core Design Contradiction:
ProductivityVSManufacturing precision

Solution Approach 1:

The system incorporates feedback mechanisms where generated code is verified through probabilistic models trained on natural code corpora, and results are iteratively refined based on compiler analysis and statistical evaluations to improve code quality while maintaining automation

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The system changes parameters by using probabilistic models with adjustable confidence thresholds and temperature settings to control the balance between generation speed and code quality, allowing optimization based on specific task requirements

Inventive Principle:
Principle #35Parameter changes

2Reliability

If debugging tools are used to detect and correct errors, then code reliability is improved, but ease of operation deteriorates

Engineering Contradiction:
Improveerror detection capabilityVSAvoidtool usability for novices
Core Design Contradiction:
ReliabilityVSEase of operation

Solution Approach 1:

The system provides self-service by automatically detecting and correcting code errors through probabilistic modeling and compiler analysis without requiring user intervention, making the debugging process as easy as pasting code into the web interface

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The system acts as an intermediary between the developer and complex debugging tools, translating technical debugging requirements into simple web interface interactions and providing automated responses that eliminate the need for users to navigate complex tool configurations

Inventive Principle:
Principle #24Intermediary (Mediator)

3Productivity

If existing automated code verification methods are used, then productivity is improved, but error correction capability deteriorates

Engineering Contradiction:
Improvecode verification speedVSAvoiderror correction capability
Core Design Contradiction:
ProductivityVSEase of repair

Solution Approach 1:

The verification system provides feedback not only on whether code is correct but also suggests specific corrections based on probabilistic model predictions, enabling automated both verification and correction of code errors

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The system merges verification and correction capabilities into a single integrated platform, combining the functions of code checking and error fixing that were previously separate tools into one unified solution

Inventive Principle:
Principle #5Merging (Combining)

Data Source

PatentUS9928040B2Source code generation, completion, checking, correction
Publication Date: 2018.03.27 MICROSOFT TECHNOLOGY LICENSING LLC
  • US9928040B2 patent drawing
  • US9928040B2 patent drawing
  • US9928040B2 patent drawing

AI summary

Automated generation, or completion, or checking of source code is described whereby a probabilistic model having been trained using a corpus of natural source code examples is used. In various examples the probabilistic model comprises probability distributions describing belief about structure of natural source code and takes into account source code analysis from a compiler or other source code analyzer. In various examples, source code analysis may comprise syntactic structure, type information and other data about source code. In various examples, the trained probabilistic model is used to predict sequences of source code elements. For example, to generate source code, to auto-complete source code, to error check source code, to error correct source code or for other purposes.