IP Library Granted Patent US 12,265,804
Granted Patent B2
US 12,265,804 · App. 18/364,869 · Granted Apr 1, 2025

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 12,265,804
App. No.
18/364,869
Granted
Apr 1, 2025
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 (38)

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, 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,

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; 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 one or more of the graphs includes 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 one or more of the graphs includes 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 one or more of the graphs includes an abstract syntax tree generated based on the first and second source code snippets.

5. The method of claim 1 , wherein one or more of the graphs includes 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 semantic embeddings corresponding to the first and second source code snippets are further generated based on comments that accompany the first and second source code snippets.

9. A system comprising one or more processors and memory storing instructions that, in response to execution by the one or more processors, 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, 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,

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, and

identifying the second edit based on the comparison; and

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

10. The system of claim 9 , wherein one or more of the graphs includes 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.

11. The system of claim 9 , wherein one or more of the graphs includes 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.

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

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

14. The system of claim 9 , 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.

15. The system of claim 9 , wherein the instructions to compare include instructions to compare node sequences connected by the one or more edge sequences with a plurality of node sequences connected by the plurality of reference edge sequences.

16. The system of claim 9 , wherein the semantic embeddings corresponding to the first and second source code snippets are further generated based on comments that accompany the first and second source code snippets.

17. At least one non-transitory computer-readable medium comprising instructions that, in response to execution by one or more processors, 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, 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,

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, and

identifying the second edit based on the comparison; and

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

18. The at least one non-transitory computer-readable medium of claim 17 , wherein one or more of the graphs includes 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.

19. The at least one non-transitory computer-readable medium of claim 17 , wherein one or more of the graphs includes 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.

20. The at least one non-transitory computer-readable medium of claim 17 , wherein one or more of the graphs includes an abstract syntax tree generated based on the first and second source code snippets.

Assignments (3)
NUNC PRO TUNC ASSIGNMENT Recorded Mar 6, 2024
From: X DEVELOPMENT LLC
To: GOOGLE LLC
Reel/Frame 066669/0491 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 18, 2023
From: X DEVELOPMENT LLC
To: GOOGLE LLC
Reel/Frame 064637/0304 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 18, 2023
From: BRONEVETSKY, GRIGORY
To: X DEVELOPMENT LLC
Reel/Frame 064637/0313 →
Continuity (2)
Continuation 17544104 · Dec 7, 2021
Related Publication 20230376286A1 · Nov 23, 2023
References Cited (19)
US 10303448B2 · Steven · 2019 [cited by examiner]
US 11354587B2 · Bly · 2022 [cited by examiner]
US 11775267B2 · Bronevetsky · 2023 [cited by examiner]
US 11822910B2 · Zhang · 2023 [cited by examiner]
US 11875136B2 · Araujo Soares · 2024 [cited by examiner]
US 20200104102A1 · Brockschmidt et al. · 2020 [cited by applicant]
US 20200371778A1 · Ni et al. · 2020 [cited by applicant]
US 20220222047A1 · Todirel · 2022 [cited by applicant]
US 20220290989A1 · Bronevetsky · 2022 [cited by applicant]
US 20220300850A1 · Mendez · 2022 [cited by applicant]
US 20230176838A1 · Bronevetsky · 2023 [cited by applicant]
Ball et al.; “If Your Version Control System Could Talk . . . ”; 5 pages; dated 1997. [cited by applicant]
Zimmermann et al.; “Mining Version Histories to Guide Software Changes”; Saarland University; 10 pages; dated 2005. [cited by applicant]
Frein, Stephen; “Data science for developers: How to identify misses changes in source code” TechBeacon; Retreived from https://techbeacon.com/app-dev-testing/data-science-developers-how-identify-missed-changes-source-c… [cited by applicant]
Cubranic et al.; “Hipikat: Recommending Pertinent Software Development Artifacts”; Research Gate; Proceedings—International Conference on Software Engineering; 12 pages; dated Jan. 2003. [cited by applicant]
Gall et al.; “Detection of Logical Coupling Based on Product Release History”; International Conference on Software Maintenance; 10 pages; dated 1998. [cited by applicant]
Nguyen et al.; “Using Topic Model to Suggest Fine-grained Source Code Changes”; 2016 IEEE International Conference on Software Maintenance and Evolution; 11 pages; dated 2016. [cited by applicant]
Allamanis et al.; “Learning to Represent Programs with Graphs”; ICLR 2018; 17 pages; dated 2018. [cited by applicant]
Yin et al.; “Learning to Represent Edits”; arXiv:1810.13337v2 [cs.LG]; 22 pages; dated Feb. 22, 2019. [cited by applicant]