Transformation templates to automate aspects of computer programming

US11481202B2 · US · B2

Patent metadata
FieldValue
Publication numberUS-11481202-B2
Application numberUS-202117176730-A
CountryUS
Kind codeB2
Filing dateFeb 16, 2021
Priority dateFeb 16, 2021
Publication dateOct 25, 2022
Grant dateOct 25, 2022

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

Implementations are described herein for building and/or applying a library of transformation templates to automate migration of source code. In various implementations, pre-migration and post-migration versions of source code that exist prior to and after migration of the source code may be analyzed. Based on the analysis, one or more transformations made to the pre-migration version of the source code to yield the post-migration version of the source code may be identified. A library of transformation templates that are applicable subsequently to automate migration of new source code may be built. In some implementations, for one or more of the transformations, a plurality of candidate transformation templates may be generated with different permutations of tokens being replaced with placeholders. One of the plurality of candidate transformation templates may be selected for inclusion in the library based on one or more criteria.

First claim

Opening claim text (preview).

What is claimed is: 1. A method implemented using one or more processors, comprising: analyzing pre-migration and post-migration versions of source code that exist prior to and after migration of the source code; based on the analyzing, identifying one or more transformations made to the pre-migration version of the source code to yield the post-migration version of the source code; and building a library of transformation templates that are applicable subsequently to automate migration of new source code, wherein the building includes, for one or more of the transformations: generating a plurality of candidate transformation templates, wherein for each candidate transformation template, different permutations of tokens of the transformation are replaced with placeholders, and selecting one of the plurality of candidate transformation templates for inclusion in the library of transformation templates, wherein the selecting is based on one or more criteria. 2. The method of claim 1 , wherein the library comprises a lattice of transformation templates. 3. The method of claim 1 , wherein the one or more criteria include successful application of the candidate transformation template to a pre-migration version training source code snippet to accurately generate a post-migration version of the training source code snippet. 4. The method of claim 1 , wherein the one or more criteria include preservation of a programming language keyword in the candidate transformation template. 5. The method of claim 1 , wherein the one or more criteria include a count of the transformations being implementable using the candidate transformation template. 6. The method of claim 1 , wherein the one or more transformations comprise a plurality of transformations, and the method further includes: grouping the plurality of transformations into a plurality of clusters; generating a plurality of candidate transformation templates for a given cluster of the plurality of clusters, and selecting, based on one or more of the criteria, one of the plurality of candidate transformation templates generated for the given cluster for inclusion in the library of transformation templates. 7. The method of claim 6 , wherein the grouping includes encoding each transformation of the plurality of transformations into an embedding. 8. The method of claim 7 , wherein the encoding is based on a transformer network and a graph neural network (GNN). 9. The method of claim 1 , wherein one or more of the transformations includes contextual code surrounding the transformation. 10. The method of claim 1 , further comprising: analyzing a pre-migration version of the new source code to match one or more transformation templates from the library to one or more snippets of the new source code; and applying the matched one or more transformation templates to the one or more snippets of the new source code to generate a post-migration version of the new source code. 11. 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: analyze pre-migration and post-migration versions of source code that exist prior to and after migration of the source code; based on the analysis, identify one or more transformations made to the pre-migration version of the source code to yield the post-migration version of the source code; and build a library of transformation templates that are applicable subsequently to automate migration of new source code, wherein the instructions to build include, for one or more of the transformations, instructions to: generate a plurality of candidate transformation templates, wherein for each candidate transformation template, different permutations of tokens of the transformation are replaced with placeholders, and select one of the plurality of candidate transformation templates for inclusion in the library of transformation templates, wherein the selecting is based on one or more criteria. 12. The system of claim 11 , wherein the library comprises a lattice of transformation templates. 13. The system of claim 11 , wherein the one or more criteria include successful application of the candidate transformation template to a pre-migration version training source code snippet to accurately generate a post-migration version of the training source code snippet. 14. The system of claim 11 , wherein the one or more criteria include preservation of a programming language keyword in the candidate transformation template. 15. The system of claim 11 , wherein the one or more criteria include a count of the transformations being implementable using the candidate transformation template. 16. The system of claim 11 , wherein the one or more transformations comprise a plurality of transformations, and the instructions include instructions to: group the plurality of transformations into a plurality of clusters; generate a plurality of candidate transformation templates for a given cluster of the plurality of clusters, and select, based on one or more of the criteria, one of the plurality of candidate transformation templates generated for the given cluster for inclusion in the library of transformation templates. 17. The system of claim 16 , further comprising instructions to encode each transformation of the plurality of transformations into an embedding. 18. The system of claim 17 , wherein the encoding is based on a transformer network and a graph neural network (GNN). 19. The system of claim 11 , wherein one or more of the transformations includes contextual code surrounding the transformation. 20. A non-transitory computer-readable medium comprising instructions that, in response to execution of the instructions by a processor, cause the processor to: analyze pre-migration and post-migration versions of source code that exist prior to and after migration of the source code; based on the analysis, identify one or more transformations made to the pre-migration version of the source code to yield the post-migration version of the source code; and build a library of transformation templates that are applicable subsequently to automate migration of new source code, wherein the instructions to build include, for one or more of the transformations, instructions to: generate a plurality of candidate transformation templates, wherein for each candidate transformation template, different permutations of tokens of the transformation are replaced with placeholders, and select one of the plurality of candidate transformation templates for inclusion in the library of transformation templates, wherein the selecting is based on one or more criteria.

Assignees

Inventors

Classifications

  • Combinations of networks · CPC title

  • Machine learning · CPC title

  • G06F8/51Primary

    Source to source · CPC title

  • Adapting program code to run in a different environment; Porting · CPC title

  • Learning methods · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US11481202B2 cover?
Implementations are described herein for building and/or applying a library of transformation templates to automate migration of source code. In various implementations, pre-migration and post-migration versions of source code that exist prior to and after migration of the source code may be analyzed. Based on the analysis, one or more transformations made to the pre-migration version of the so…
Who is the assignee on this patent?
X Dev Llc
What technology area does this patent fall under?
Primary CPC classification G06F8/51. Mapped technology areas include Physics.
When was this patent published?
Publication date Tue Oct 25 2022 00:00:00 GMT+0000 (Coordinated Universal Time) (B2). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 8 related publications on this page (citations in our corpus or others sharing the same primary CPC).