System and method for automatic program repair using fast-result test cases

US2022206930A1 · US · A1

Patent metadata
FieldValue
Publication numberUS-2022206930-A1
Application numberUS-202017135668-A
CountryUS
Kind codeA1
Filing dateDec 28, 2020
Priority dateDec 28, 2020
Publication dateJun 30, 2022
Grant date

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.

One embodiment provides a system for automatic program repair (APR). The system identifies a first set of components under repair in a software system and determines, while executing an original test, second and third sets of components that are executed before and after, respectively, the first set of components. The system generates a first block of mock code that runs faster and simulates runtime behaviors of the second set of components, identifies a code region within the third set of components that affects a test result of the software system, and generates a second block of mock code that runs faster and affects the test result similarly. The system generates a fast-result test by replacing the second set of components with the first block of mock code and replacing the third set of components with the second block of mock code and performs APR by executing the fast-result test.

First claim

Opening claim text (preview).

What is claimed is: 1 . A computer-implemented method for automatically repairing faults in a software system, the method comprising: identifying, by a computer, a first set of components under repair in the software system; determining, while executing an original test of the software system, a second set of components which are executed before the first set of components and a third set of components which are executed after the first set of components; generating a first block of mock code simulating runtime behaviors of the second set of components, wherein the first block of mock code runs faster than the second set of components; identifying a code region within the third set of components that affects a test result of the software system; generating a second block of mock code that affects the test result in a way similar to the identified code region, wherein the second block of mock code runs faster than the third set of components; generating a fast-result test corresponding to the original test by replacing the second set of components with the first block of mock code and replacing the third set of components with the second block of mock code; and performing automatic program repair (APR) on the software system by executing the fast-result test. 2 . The computer-implemented method of claim 1 , wherein performing the APR comprises: mutating the first set of components under repair for each execution of the fast-result test; in response to a mutation resulting in a successful execution of the fast-result test, re-running the original test; and in response to the mutation resulting in a successful execution of the original test, recommending the mutation as a correct repair. 3 . The computer-implemented method of claim 2 , wherein mutating the first set of components comprises one or more of: adding a line of code; deleting a line of code; and modifying a line of code. 4 . The computer-implemented method of claim 1 , wherein identifying the first set of components under repair comprises performing a spectrum-based fault-localization operation. 5 . The computer-implemented method of claim 1 , further comprising: determining, while executing the original test, a fourth set of components, wherein execution of the fourth set of components interleaves with execution of the first set of components; identifying code regions within the fourth set of components that can be simulated using a third block of mock code; and replacing the identified code regions within the fourth set of components with the third block of mock code. 6 . The computer-implemented method of claim 1 , wherein generating a respective block of mock code comprises: detecting invariants; and generating the respective block of mock code by setting values of the invariants. 7 . The computer-implemented method of claim 1 , wherein identifying the code region within the third set of components that affects the test result further comprises: identifying one or more variables whose values provide a prediction of the test result. 8 . The computer-implemented method of claim 7 , wherein the second block of mock code comprises code that tests the values of the identified one or more variables. 9 . The computer-implemented method of claim 7 , wherein generating the second block of mock code further comprises: performing a backward slicing analysis to identify code regions within the third set of components that are not related to the identified one or more variables; and removing the identified code regions. 10 . The computer-implemented method of claim 7 , further comprising: in response to determining that multiple identified variables are computed independently, partitioning the fast-result test into multiple smaller tests, wherein each smaller test is configured to test a subset of identified variables, and wherein partitioning the fast-result test comprises performing a backward slicing analysis for each identified variable. 11 . A non-transitory computer-readable storage medium storing instructions that when executed by a computer cause the computer to perform a method for automatically repairing faults in a software system, the method comprising: identifying a first set of components under repair in the software system; determining, while executing an original test of the software system, a second set of components which are executed before the first set of components and a third set of components which are executed after the first set of components; generating a first block of mock code simulating runtime behaviors of the second set of components, wherein the first block of mock code runs faster than the second set of components; identifying a code region within the third set of components that affects a test result of the software system; generating a second block of mock code that affects the test result in a way similar to the identified code region, wherein the second block of mock code runs faster than the third set of components; generating a fast-result test corresponding to the original test by replacing the second set of components with the first block of mock code and replacing the third set of components with the second block of mock code; and performing automatic program repair (APR) on the software system by executing the fast-result test. 12 . The non-transitory computer-readable storage medium of claim 10 , wherein performing the APR comprises: mutating the first set of components under repair for each execution of the fast-result test; in response to a mutation resulting in a successful execution of the fast-result test, re-running the original test; and in response to the mutation resulting in a successful execution of the original test, recommending the mutation as a correct repair. 13 . The non-transitory computer-readable storage medium of claim 11 , wherein identifying the first set of components under repair comprises performing a spectrum-based fault-localization operation. 14 . The non-transitory computer-readable storage medium of claim 11 , wherein the method further comprises: determining, while executing the original test, a fourth set of components, wherein execution of the fourth set of components interleaves with execution of the first set of components; identifying code regions within the fourth set of components that can be simulated using a third block of mock code; and replacing the identified code regions within the fourth set of components with the third block of mock code. 15 . The non-transitory computer-readable storage medium of claim 11 , wherein generating a respective block of mock code comprises: detecting invariants; and generating the respective block of mock code by setting values of the invariants. 16 . The non-transitory computer-readable storage medium of claim 11 , wherein identifying the code region within the third set of components that affects the test result further comprises: identifying one or more variables whose values provide a prediction of the test result. 17 . The non-transitory computer-readable storage medium of claim 16 , wherein generating the second block of mock code further comprises: generating code that tests the values of the identified one or more variables; performing a backward slicing analysis to identify code regions within the third set of components that are not related to the identified one or more variables; and removing the identified code regions. 18 . The non-transitory computer-readable storage medi

Assignees

Inventors

Classifications

  • for test execution, e.g. scheduling of test suites · CPC title

  • Environments for analysis, debugging or testing of software · CPC title

  • Physics · mapped topic

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 US2022206930A1 cover?
One embodiment provides a system for automatic program repair (APR). The system identifies a first set of components under repair in a software system and determines, while executing an original test, second and third sets of components that are executed before and after, respectively, the first set of components. The system generates a first block of mock code that runs faster and simulates ru…
Who is the assignee on this patent?
Palo Alto Res Ct Inc
What technology area does this patent fall under?
Primary CPC classification G06F11/3688. Mapped technology areas include Physics.
When was this patent published?
Publication date Thu Jun 30 2022 00:00:00 GMT+0000 (Coordinated Universal Time) (A1). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 4 related publications on this page (citations in our corpus or others sharing the same primary CPC).