IP Library Granted Patent US 11,775,267
Granted Patent B2
US 11,775,267 · App. 17/544,104 · Granted Oct 3, 2023

Identification and application of related source code edits

Inventor: Grigory Bronevetsky (San Ramon, CA)
Assignee: GOOGLE LLC
G06F8/38G06F8/433
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,775,267
App. No.
17/544,104
Granted
Oct 3, 2023
Kind
B2
Abstract

Implementations are described herein for identifying related source code edits to perform, or to aid in the performance of, various programming tasks. In various implementations, a first edit made to a first source code snippet in a source code editor may be detected. Based on the first edit, a second source code edit to be made to a second source code snippet may be identified. The identifying may include: traversing one or more graphs to determine one or more edge sequences between nodes corresponding to the first and second source code snippets, comparing the one or more edge sequences to a plurality of reference edge sequences between nodes corresponding to historical co-occurrences of the first and second code edits, and identifying the second edit based on the comparing. The source code editor may provide output that includes a recommendation to implement the second edit.

Claims (39)

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

detecting a first edit made to a first source code snippet in a source code editor;

identifying a second edit to make to a second source code snippet, wherein the identifying includes:

traversing one or more graphs to determine one or more edge sequences between nodes corresponding to the first and second source code snippets,

comparing the one or more edge sequences to a plurality of reference edge sequences between nodes corresponding to historical co-occurrences of the first and second code edits,

determining the one or more edge sequences match the plurality of reference edge sequences of at least a threshold number or percentage of the historical co-occurrences of the first and second code edits, and

identifying the second edit based on the comparing and the determining; and

causing the source code editor to provide output, wherein the output comprises a recommendation to implement the second edit.

2. The method of claim 1 , wherein the one or more graphs include a source code dependency graph between a first source code file containing the first source code snippet and a second source code file containing the second source code snippet.

3. The method of claim 1 , wherein the one or more graphs include a file system tree that includes a first source code file containing the first source code snippet and a second source code file containing the second source code snippet.

4. The method of claim 1 , wherein the one or more graphs include an abstract syntax tree generated based on the first and second source code snippets.

5. The method of claim 1 , wherein the one or more graphs include a control flow graph or call graph generated based on the first and second source code snippets.

6. The method of claim 1 , wherein the comparing comprises comparing one or more counts of the one or more edge sequences with a plurality of counts of the plurality of reference edge sequences.

7. The method of claim 1 , wherein the comparing comprises comparing node sequences connected by the one or more edge sequences with a plurality of node sequences connected by the plurality of reference edge sequences.

8. The method of claim 1 , wherein the nodes corresponding to the first and second source code snippets comprise semantic embeddings generated based on the first and second source code snippets.

9. The method of claim 1 , wherein the nodes corresponding to the first and second source code snippets comprise semantic embeddings generated based on comments that accompany the first and second source code snippets.

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

detect a first edit made to a first source code snippet in a source code editor;

identify a second edit to make to a second source code snippet, wherein the instructions to identify include instructions to:

traverse one or more graphs to determine one or more edge sequences between nodes corresponding to the first and second source code snippets,

compare the one or more edge sequences to a plurality of reference edge sequences between nodes corresponding to historical co-occurrences of the first and second code edits,

determine the one or more edge sequences match the plurality of reference edge sequences of at least a threshold number or percentage of the historical co-occurrences of the first and second code edits, and

identify the second edit based on the comparing and the determine; and

cause the source code editor to provide output, wherein the output comprises a recommendation to implement the second edit.

11. The system of claim 10 , wherein the one or more graphs include a source code dependency graph between a first source code file containing the first source code snippet and a second source code file containing the second source code snippet.

12. The system of claim 10 , wherein the one or more graphs include a file system tree that includes a first source code file containing the first source code snippet and a second source code file containing the second source code snippet.

13. The system of claim 10 , wherein the one or more graphs include an abstract syntax tree generated based on the first and second source code snippets.

14. The system of claim 10 , wherein the one or more graphs include a control flow graph or call graph generated based on the first and second source code snippets.

15. The system of claim 10 , wherein the comparing comprises comparing one or more counts of the one or more edge sequences with a plurality of counts of the plurality of reference edge sequences.

16. The system of claim 10 , wherein the comparing comprises comparing node sequences connected by the one or more edge sequences with a plurality of node sequences connected by the plurality of reference edge sequences.

17. The system of claim 10 , wherein the nodes corresponding to the first and second source code snippets comprise semantic embeddings generated based on the first and second source code snippets.

18. At least one non-transitory computer-readable medium comprising instructions that, in response to execution of the instructions by one or more processors, cause the one or more processors to perform the following operations:

detect a first edit made to a first source code snippet in a source code editor;

identify a second edit to make to a second source code snippet, wherein the instructions to identify include instructions to:

traverse one or more graphs to determine one or more edge sequences between nodes corresponding to the first and second source code snippets,

compare the one or more edge sequences to a plurality of reference edge sequences between nodes corresponding to historical co-occurrences of the first and second code edits,

determine the one or more edge sequences match the plurality of reference edge sequences of at least a threshold number or percentage of the historical co-occurrences of the first and second code edits, and

identify the second edit based on the comparing and the determining; and

cause the source code editor to provide output, wherein the output comprises a recommendation to implement the second edit.

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 Jun 28, 2022
From: BRONEVETSKY, GRIGORY
To: X DEVELOPMENT LLC
Reel/Frame 060337/0538 →
Continuity (1)
Related Publication 20230176838A1 · Jun 8, 2023
Cited By (1)
US 12,265,804