Code remediation
AssigneeInfosys Limited
InventorSudhir Hulikunte Sundararam
Life of this patent
Estimating the term…
Abstract
Various technologies related to code remediation are presented. Code to be remediated can be annotated with language-independent annotations. From the annotations, remediated code in a particular language can be generated. A wide variety of change types can be supported. Automatic or custom remediation can be achieved. Custom remediation can provide a user with control over the remediation process via helpful user interfaces. Considerable efficiency improvements can be realized without surrendering control of the remediation process.
Claims18
A method implemented at least in part by a computing device, the method comprising:
- (a) receiving source code to be remediated in light of a regulation set affecting logic of the source code, wherein the source code is of a programming language;
- (b) generating a plurality of language-independent annotations for the source code to be remediated, wherein the language-independent annotations are of a format having a grammar that forms an executable language and wherein the executable language comprises at least one change function and one or more parameters for the change function, wherein the annotations comprise:
- an indication of a token representing a constant or a variable name appearing in the source code;
- parameters comprising an indication of a change type associated with the token, an indication of a statement type associated with the token, and an indication of an impact location associated with the token;
- and
- an indication of a new value associated with the token;
- (c) based on the language-independent annotations, outputting a language-independent analysis tree comprising breaking down the annotations into a set of patterns and sequentially arranging the patterns for translation, wherein the analysis tree comprises nodes specifying the indication of the token and the parameters;
- and
- (d) generating a remediated version of the source code, wherein generating the remediated version comprises translating the annotations, wherein the translating comprises consuming the parameters of the analysis tree, and applying the parameters from the annotations to the change function indicated in the annotations, wherein the change function generates source code comprising the new value associated with the token complying with the regulation set in the programming language of the source code and outputting lines of remediated source code in the programming language of the source code according to the plurality of language-independent annotations, wherein the remediated version complies with the regulation set.
One or more non-transitory computer-readable storage devices comprising computer-executable instructions that when executed cause a computer to perform a method comprising:
- (a) receiving source code to be remediated in light of a regulation set affecting logic of the source code, wherein the source code is of a programming language;
- (b) generating a plurality of language-independent annotations for the source code to be remediated, wherein the language-independent annotations are of a format having a grammar that forms an executable language and wherein the executable language comprises at least one change function and one or more parameters for the change function, wherein the annotations comprise:
- an indication of a token representing a constant or a variable name appearing in the source code;
- parameters comprising an indication of a change type associated with the token, an indication of a statement type associated with the token, and an indication of an impact location associated with the token;
- and
- an indication of a new value associated with the token;
- (c) based on the language-independent annotations, outputting a language-independent analysis tree comprising breaking down the annotations into a set of patterns and sequentially arranging the patterns for translation, wherein the analysis tree comprises nodes specifying the indication of the token and the parameters;
- and
- (d) generating a remediated version of the source code, wherein generating the remediated version comprises translating the annotations wherein the translating comprises consuming the parameters of the analysis tree, for applying the parameters from the annotations to the change function indicated in the annotations, wherein the change function generates source code comprising the new value associated with the token complying with the regulation set in the programming language of the source code and outputting lines of remediated source code in the programming language of the source code according to the plurality of language-independent annotations, wherein the remediated version complies with the regulation set.
A system comprising:
- one or more processors coupled to memory;
- an annotation engine configured to generate programming-language-independent annotations based on source code to be remediated of a programming language, wherein the programming-language-independent annotations are of a format having a grammar that forms an executable language and wherein the executable language comprises at least one change function and one or more parameters for the change function, wherein the annotations comprise:
- an indication of a token representing a constant or a variable name appearing in the source code;
- parameters comprising an indication of a change type associated with the token, an indication of a statement type associated with the token, and an indication of an impact location associated with the token;
- and
- an indication of a new value associated with the token;
- a language-independent analysis engine configured to generate a language-independent pre-translation analysis tree data structure based on the programming-language-independent annotations, wherein the language-independent analysis tree comprises breaking down the annotations into a set of patterns and sequentially arranging the patterns for translation, and wherein the analysis tree comprises nodes specifying the indication of the token and the parameters;
- and
- a translation engine configured to generate remediated code in the programming language according to the programming-language-independent annotations as represented by the pre-translation analysis tree data structure, comprising consuming the parameters of the analysis tree data structure and applying the one or more parameters from the annotations to the change function indicated in the annotations, wherein the change function generates source code comprising the new value associated with the token complying with the regulation set in the programming language of the source code.
One or more non-transitory computer-readable storage media comprising computer-executable instructions causing a computer to perform a method comprising:
- (a) receiving source code implementing electronic claim processing logic according to an old version of healthcare regulations, wherein the source code is to be remediated to comply with claim processing in light of a new version of healthcare regulations, and the source code is of a programming language out of a plurality of possible programming languages;
- (b) searching the source code for one or more instances of a token search pattern indicative of a variable name or constant name affected by claim processing migration to the new version of healthcare regulations;
- (c) responsive to finding the one or more instances of the token search pattern, generating an impact point record, wherein the impact point record indicates the variable name or constant name affected by claim processing migration to the new version of healthcare regulations and a location in the source code at which the variable name or constant name occurs;
- (d) generating a language-independent annotation for the source code, wherein the language-independent annotation is of a format having a grammar that forms an executable language, wherein the annotation comprises:
- a token that indicates the variable name or constant name affected by claim processing migration to the new version of healthcare regulations, the location in the source code at which the variable name or constant name occurs, a change function, and one or more parameters associated with the change function, wherein the parameters associated with the change function comprise an indication of a change type associated with the token, an indication of a statement type associated with the token, and an indication of an impact location associated with the token;
- (e) based on the language-independent annotation, outputting a language-independent analysis tree comprising breaking down the annotations into a set of patterns and sequentially arranging the patterns for translation, wherein the analysis tree comprises nodes specifying the indication of the token and the parameters;
- and
- (f) generating a remediated version of the source code, wherein generating the remediated version comprises translating the annotation, wherein the translating comprises consuming the parameters of the analysis tree and applying the one or more parameters to the change function, wherein the change function generates source code in the programming language based on the source code to be remediated comprising the new value associated with the token and complying with claim processing in light of the new version of healthcare regulations according to the language-independent annotation.
Dependencies are inferred from the claim text.