Identification of code changes using language syntax and changeset data
AssigneeInternational Business Machines Corporation
InventorDoina L. Klinger
Life of this patent
Estimating the term…
Abstract
A computer retrieves a first changeset that is associated with a program. The computer identifies a first set of changes included in the first changeset based on a time stamp of a change, textual matching, and syntactical matching. The computer identifies a first area of interest within a source code of the program based, at least in part, on the first set of changes. The computer searches for a second set of changes based, at least in part, on the first area of interest. The computer generates a result that includes, at least in part, the first set of changes.
Claims20
A method of identifying code changes, the method comprising:
- a computer retrieving a first changeset that is associated with a program based, at least in part, on a search parameter that includes a range of time and a first area of interest that indicates a first portion of a source code of the program;
- the computer identifying a first set of changes included in the first changeset based on a time stamp of a change, wherein a time of the time stamp is included within the range of time, and wherein first set of changes includes a change to a region of the source code that is included in the first area of interest,
- the computer determining whether the change included in the first set of changes is a textual change or a syntactical change to the region of the source code, based on textual matching and syntactical matching, wherein syntactical matching includes a comparison of a first valid syntax of the first set of changes to a second valid syntax of the region of the source code of the program that corresponds to the first set of changes, and wherein the comparison reveals that a syntax of the source code of the program was changed by the first set of changes from second valid syntax to the first valid syntax;
- the computer generating a second area of interest that includes a second portion of the source code of the program by updating the first area of interest based, at least in part, on i) the change being a textual change or a syntactical change and ii) an inverse of an operation included in the change, such that the second area of interest includes a third portion of source code that is not indicated by the first area of interest;
- the computer searching for a second set of changes based, at least in part, on the second area of interest;
- the computer identifying a possible source of an error based, at least in part, on a result of an analysis of a syntax of the second set of changes;
- and
- the computer generating a result that includes, at least in part, the second set of changes and an indication of the possible source of the error.
A computer program product for identifying code changes, the computer program product comprising:
- one or more computer-readable storage media and program instructions stored on the one or more computer-readable storage media, wherein the one or more computer-readable storage media are not transitory signals, the program instructions comprising:
- program instructions to retrieve a first changeset that is associated with a program based, at least in part, on a search parameter that includes a range of time and a first area of interest that indicates a first portion of a source code of the program;
- program instructions to identify a first set of changes included in the first changeset based on a time stamp of a change, wherein a time of the time stamp is included within the range of time, and wherein first set of changes includes a change to a region of the source code that is included in the first area of interest,
- the computer determining whether the change included in the first set of changes is a textual change or a syntactical change to the region of the source code, based on textual matching, and syntactical matching, wherein syntactical matching includes a comparison of a first valid syntax of the first set of changes to a second valid syntax of the region of the source code of the program that corresponds to the first set of changes, and wherein the comparison reveals that a syntax of the source code of the program was changed by the first set of changes from second valid syntax to the first valid syntax;
- program instructions to generate a second area of interest that includes a second portion of the source code of the program by updating the first area of interest based, at least in part, on i) the change being a textual change or a syntactical change and ii) an inverse of an operation included in the change, such that the second area of interest includes a third portion of source code that is not indicated by the first area of interest;
- program instructions to search for a second set of changes based, at least in part, on the second area of interest;
- program instructions to identify a possible source of an error based, at least in part, on a result of an analysis of a syntax of the second set of changes;
- and
- program instructions to generate a result that includes, at least in part, the second set of changes and an indication of the possible source of the error.
A computer system for identifying code changes, the computer system comprising:
- one or more computer processors;
- one or more computer-readable storage medium, wherein the one or more computer-readable storage medium are not transitory signals;
- program instructions stored on the computer readable storage medium for execution by at least one of the one or more processors, the program instructions comprising:
- program instructions to retrieve a first changeset that is associated with a program based, at least in part, on a search parameter that includes a range of time and a first area of interest that indicates a first portion of a source code of the program;
- program instructions to identify a first set of changes included in the first changeset based on a time stamp of a change, wherein a time of the time stamp is included within the range of time, and wherein first set of changes includes a change to a region of the source code that is included in the first area of interest,
- the computer determining whether the change included in the first set of changes is a textual change or a syntactical change to the region of the source code, based on textual matching, and syntactical matching, wherein syntactical matching includes a comparison of a first valid syntax of the first set of changes to a second valid syntax of the region of the source code of the program that corresponds to the first set of changes, and wherein the comparison reveals that a syntax of the source code of the program was changed by the first set of changes from second valid syntax to the first valid syntax;
- program instructions to generate a second area of interest that includes a second portion of the source code of the program by updating the first area of interest based, at least in part, on i) the change being a textual change or a syntactical change and ii) an inverse of an operation included in the change, such that the second area of interest includes a third portion of source code that is not indicated by the first area of interest;
- program instructions to search for a second set of changes based, at least in part, on the second area of interest;
- program instructions to identify a possible source of an error based, at least in part, on a result of an analysis of a syntax of the second set of changes;
- and
- program instructions to generate a result that includes, at least in part, the second set of changes and an indication of the possible source of the error.
Dependencies are inferred from the claim text.