Predicting defects using metadata
US-2020319992-A1 · Oct 8, 2020 · US
US2022206930A1 · US · A1
| Field | Value |
|---|---|
| Publication number | US-2022206930-A1 |
| Application number | US-202017135668-A |
| Country | US |
| Kind code | A1 |
| Filing date | Dec 28, 2020 |
| Priority date | Dec 28, 2020 |
| Publication date | Jun 30, 2022 |
| Grant date | — |
A practical reading order for non-experts. Skip the full description unless you need deep technical detail.
What the patent document calls the invention.
A short plain-language summary of the technical disclosure.
Who owns or filed the patent and who is credited as inventor.
Filing, priority, publication, and grant dates set the timeline.
The legal scope of protection — read this for what is actually claimed.
Technology tags used to group this patent with similar filings.
Prior art links and similar publications in this corpus.
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.
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
for test execution, e.g. scheduling of test suites · CPC title
Environments for analysis, debugging or testing of software · CPC title
Physics · mapped topic
Related publications grouped by family.
Answers are generated from the same data shown on this page.