IP Library Granted Patent US 11,604,628
Granted Patent B2
US 11,604,628 · App. 17/123,768 · Granted Mar 14, 2023

Generation and/or recommendation of tools for automating aspects of computer programming

Inventors: Bin Ni (Fremont, CA); Owen Lewis (Stanford, CA); Qianyu Zhang (Sunnyvale, CA)
Assignee: GOOGLE LLC
G06F8/40G06N20/00
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,604,628
App. No.
17/123,768
Granted
Mar 14, 2023
Kind
B2
Abstract

Implementations are described herein for leveraging prior source code transformations to facilitate automatic creation and/or recommendation of tools for automating aspects of source code transformations captured in real time. In various implementations, a transformation made by a programmer to a source code snipped may be captured in a source code editor application in real time. Based on the transformation and the intent, one or more candidate source code transformations may be identified from one or more repositories of prior source code transformations made by one or more other programmers. The source code editor application may be caused to provide output indicative of a tool that is operable to automate one or more edits associated with both the transformation made by the programmer to the source code snippet and with one or more of the candidate source code transformations.

Claims (40)

1. A method implemented using one or more processors, comprising:

capturing, in a source code editor application in real time, a transformation made by a programmer to a source code snippet;

determining an intent behind the transformation;

determining a context in which the transformation is being made, wherein the context is determined based on one or more other transformations the programmer made to other source code snippets prior to the programmer making the transformation to the source code snippet;

determining contexts of a plurality of transformation repositories of prior source code transformations made by one or more other programmers;

based on the transformation and the intent, selecting, from the plurality of transformation repositories, a plurality of candidate source code transformations;

ranking the plurality of candidate source code transformations based on respective similarities between the context in which the transformation is being made by the programmer and the contexts of the plurality of transformation repositories;

causing the source code editor application to provide output indicative of a tool that is operable to automate one or more edits associated with both the transformation made by the programmer to the source code snippet and with one or more of the ranked candidate source code transformations; and

automating one or more of the edits associated with both the transformation made by the programmer to the source code snippet and with one or more of the candidate source code transformations based on the output.

2. The method of claim 1 , wherein the selecting comprises applying data indicative of the transformation as input across a machine learning model to generate output, wherein the one or more candidate source code transformations are selected based on the output.

3. The method of claim 2 , wherein the output generated based on the machine learning model comprises an embedding, and selecting the one or more candidate source code transformations comprises identifying one or more nearest neighbors to the embedding in an embedding space indexed by embeddings of prior source code transformations.

4. The method of claim 1 , wherein determining the intent behind the transformation comprises semantically processing a natural language comment contained in a source code file that also includes the source code snippet.

5. The method of claim 1 , wherein determining the intent behind the transformation comprises semantically processing one or more tokens of the source code snippet.

6. The method of claim 1 , wherein the context in which the transformation is being made by the programmer includes a function of an executable application that results from compilation of the source code snippet.

7. A system comprising one or more processors and memory storing instructions that, in response to execution of the instructions by the one or more processors, cause the one or more processors to:

capture, in a source code editor application in real time, a transformation made by a programmer to a source code snippet;

determine an intent behind the transformation;

determine a context in which the transformation is being made, wherein the context is determined based on one or more other transformations the programmer made to other source code snippets prior to the programmer making the transformation to the source code snippet;

determine contexts of a plurality of transformation repositories of prior source code transformations made by one or more other programmers;

based on the transformation and the intent, select, from the plurality of transformation repositories, a plurality of candidate source code transformations;

rank the plurality of candidate source code transformations based on respective similarities between the context in which the transformation is being made by the programmer and the contexts of the plurality of transformation repositories;

cause the source code editor application to provide output indicative of a tool that is operable to automate one or more edits associated with both the transformation made by the programmer to the source code snippet and with one or more of the ranked candidate source code transformations; and

automate one or more of the edits associated with both the transformation made by the programmer to the source code snippet and with one or more of the candidate source code transformations based on the output.

8. The system of claim 7 , comprising instructions to apply data indicative of the transformation as input across a machine learning model to generate output, wherein the one or more candidate source code transformations are selected based on the output.

9. The system of claim 8 , wherein the output generated based on the machine learning model comprises an embedding, and selection of the one or more candidate source code transformations comprises identification of one or more nearest neighbors to the embedding in an embedding space indexed by embeddings of prior source code transformations.

10. The system of claim 7 , wherein determining the intent behind the transformation comprises semantically processing a natural language comment contained in a source code file that also includes the source code snippet.

11. The system of claim 7 , wherein determining the intent behind the transformation comprises semantically processing one or more tokens of the source code snippet.

12. The system of claim 7 , wherein the context in which the transformation is being made by the programmer includes a function of an executable application that results from compilation of the source code snippet.

13. A non-transitory computer-readable medium comprising instructions that, in response to execution of the instructions by a processor, cause the processor to:

capture, in a source code editor application in real time, a transformation made by a programmer to a source code snippet;

determine an intent behind the transformation;

determine a context in which the transformation is being made, wherein the context is determined based on one or more other transformations the programmer made to other source code snippets prior to the programmer making the transformation to the source code snippet;

determine contexts of a plurality of transformation repositories of prior source code transformations made by one or more other programmers;

based on the transformation and the intent, select, from the plurality of transformation repositories, a plurality of candidate source code transformations;

rank the plurality of candidate source code transformations based on respective similarities between the context in which the transformation is being made by the programmer and the contexts of the plurality of transformation repositories;

cause the source code editor application to provide output indicative of a tool that is operable to automate one or more edits associated with both the transformation made by the programmer to the source code snippet and with one or more of the ranked candidate source code transformations; and

automate one or more of the edits associated with both the transformation made by the programmer to the source code snippet and with one or more of the candidate source code transformations based on the output.

14. The non-transitory computer-readable medium of claim 13 , comprising instructions to apply data indicative of the transformation as input across a machine learning model to generate output, wherein the one or more candidate source code transformations are selected based on the output.

15. The non-transitory computer-readable medium of claim 14 , wherein the output generated based on the machine learning model comprises an embedding, and selection of the one or more candidate source code transformations comprises identification of one or more nearest neighbors to the embedding in an embedding space indexed by embeddings of prior source code transformations.

16. The non-transitory computer-readable medium of claim 13 , wherein determining the intent behind the transformation comprises semantically processing a natural language comment contained in a source code file that also includes the source code snippet.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 2, 2023
From: X DEVELOPMENT LLC
To: GOOGLE LLC
Reel/Frame 062572/0565 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 16, 2020
From: NI, BIN; LEWIS, OWEN; ZHANG, QIANYU
To: GOOGLE LLC
Reel/Frame 054668/0787 →
Continuity (1)
Related Publication 20220188081A1 · Jun 16, 2022
Cited By (2)
US 12,632,228 US 12,664,157