# US 11,119,895 B2 · Risk-focused testing

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 11,119,895 B2
- Document ID: US11119895B2
- Status: Granted
- Kind: B2
- Application number: 16/543,635
- Filed: 2019-08-19
- Published: 2021-02-25
- Granted: 2021-09-14
- Earliest claimed: 2019-08-19
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Raviv Gal; Gil Shurek; Giora Simchoni; Avi Ziv
- Web page: https://patentgrep.com/patent/US11119895B2

## CPC

- G06F 8/71: Version control (security arrangements therefor G06F21/57); Configuration management
- G06F 11/362: Debugging of software
- G06F 11/3676: {for coverage analysis}
- G06F 11/3688: {for test execution, e.g. scheduling of test suites}
- G06F 11/3698: Environments for analysis, debugging or testing of software
- G06F 18/2148: {characterised by the process organisation or structure, e.g. boosting cascade}
- G06N 3/0442: characterised by memory or gating, e.g. long short-term memory [LSTM] or gated recurrent units [GRU]
- G06N 3/09: Supervised learning
- G06N 20/00: Machine learning
- G06F 11/3684: {for test design, e.g. generating new test cases}
- G06N 3/044: Recurrent networks, e.g. Hopfield networks
- G06N 5/01: Dynamic search techniques; Heuristics; Dynamic trees; Branch-and-bound
- G06N 20/20: Ensemble learning
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

A method, apparatus and product for testing a system under development. The method comprises obtaining information including a current version of a code, and predicting that a subset of code elements from the current version of the code are bug-prone elements. The method comprises determining one or more coverage events corresponding to the bug-prone elements. The method further comprises determining a testing policy based on the one or more coverage events that correspond to the bug-prone elements, wherein the testing policy is determined based on a statistical analysis of coverage likelihood of tests generated based on a test template for each coverage event of the one or more coverage events. The method further comprises implementing the testing policy.

## Claims

### Claim 1

A method comprising:
iteratively performing:
obtaining information comprising a current version of a code, the information comprising fault-related information indicating at least previously detected faults in a previous version of the code, the information comprising test-related information indicating at least previously performed tests of the previous version of the code;
based on a machine learning algorithm, predicting that a subset of code elements from the current version of the code are bug-prone elements;
determining one or more coverage events corresponding to the bug-prone elements;
determining a testing policy based on the one or more coverage events that correspond to the bug-prone elements, wherein said testing policy is determined based on a statistical analysis of coverage likelihood of tests generated based on a test template for each coverage event of the one or more coverage events, wherein the testing policy comprises a plurality of test templates and execution parameters thereof, wherein the testing policy is configured to statistically cover the one or more coverage events; and
implementing the testing policy, wherein said implementing comprises generating one or more tests based on the plurality of test templates, thereby covering the one or more coverage events,
wherein a first testing policy for a first set of bug-prone elements determined during a first iteration comprises different test templates than a second testing policy for a second set of bug-prone elements determined during a second iteration.

### Claim 2 (depends on 1)

The method of claim 1, wherein the information is obtained from at least one of a version control system, a bug tracking tool, and a test submission tool.

### Claim 3 (depends on 1)

The method of claim 1, wherein a new iteration is invoked every time a new coding element is committed.

### Claim 4 (depends on 1)

The method of claim 1, wherein a version control system is used to track versions of the code, wherein said iteratively performing comprises performing a new iteration in response to a commit event in the version control system, whereby each iteration is configured to test a committed version of the code.

### Claim 5 (depends on 1)

The method of claim 1, wherein a new iteration is invoked periodically, whereby performing adaptive regression testing.

### Claim 6 (depends on 1)

The method of claim 1, wherein the machine learning algorithm is configured to be trained on a training dataset comprising coding information, fault-related information, and test-related information obtained during a predefined period of time.

### Claim 7 (depends on 5)

The method of claim 5, wherein each element in the training dataset is labeled based on having at least one fault in a past period or not.

### Claim 8 (depends on 1)

The method of claim 1, wherein the bug-prone elements comprises at least one of a bug-prone file and a bug-prone function.

### Claim 9 (depends on 1)

The method of claim 1, wherein the one or more coverage events comprise one or more functional coverage events.

### Claim 10 (depends on 1)

The method of claim 1, wherein the fault-related information comprises a file having a previously detected fault and a timestamp of detecting the fault.

### Claim 11 (depends on 1)

The method of claim 1, wherein the test-related information comprises a count of performed tests and a count of failed tests.

### Claim 12

A computer program product comprising a non-transitory computer readable storage medium retaining program instructions, which program instructions when read by a processor, cause the processor to iteratively perform:
obtaining information comprising a current version of a code, the information comprising fault-related information indicating at least previously detected faults in a previous version of the code, the information comprising test-related information indicating at least previously performed tests of the previous version of the code;
based on a machine learning algorithm, predicting that a subset of code elements from the current version of the code are bug-prone elements;
determining one or more coverage events corresponding to the bug-prone elements;
determining a testing policy based on the one or more coverage events that correspond to the bug-prone elements, wherein said testing policy is determined based on a statistical analysis of coverage likelihood of tests generated based on a test template for each coverage event of the one or more coverage events, wherein the testing policy comprises a plurality of test templates and execution parameters thereof, wherein the testing policy is configured to statistically cover the one or more coverage events; and
implementing the testing policy, wherein said implementing comprises generating one or more tests based on the plurality of test templates, thereby covering the one or more coverage events,
wherein a first testing policy for a first set of bug-prone elements determined during a first iteration comprises different test templates than a second testing policy for a second set of bug-prone elements determined during a second iteration.

### Claim 13 (depends on 12)

The computer program product of claim 12, wherein the information is obtained from at least one of a version control system, a bug tracking tool, and a test submission tool.

### Claim 14 (depends on 12)

The computer program product of claim 12, wherein a new iteration is invoked every time a new coding element is committed.

### Claim 15 (depends on 12)

The computer program product of claim 12, wherein a version control system is used to track versions of the code, wherein said iteratively performing comprises performing a new iteration in response to a commit event in the version control system, whereby each iteration is configured to test a committed version of the code.

### Claim 16 (depends on 12)

The computer program product of claim 12, wherein a new iteration is invoked periodically, whereby performing adaptive regression testing.

### Claim 17 (depends on 12)

The computer program product of claim 12, wherein the machine learning algorithm is configured to be trained on a training dataset comprising coding information, fault-related information, and test-related information obtained during a predefined period of time.

### Claim 18 (depends on 12)

The computer program product of claim 12, wherein the bug-prone elements comprises at least one of a bug-prone file and a bug-prone function.

### Claim 19 (depends on 12)

The computer program product of claim 12, wherein the one or more coverage events comprise one or more functional coverage events.

### Claim 20

A computerized apparatus having a processor, the processor being adapted to iteratively perform:
obtaining information comprising a current version of a code, the information comprising fault-related information indicating at least previously detected faults in a previous version of the code, the information comprising test-related information indicating at least previously performed tests of the previous version of the code;
based on a machine learning algorithm, predicting that a subset of code elements from the current version of the code are bug-prone elements;
determining one or more coverage events corresponding to the bug-prone elements;
determining a testing policy based on the one or more coverage events that correspond to the bug-prone elements, wherein said testing policy is determined based on a statistical analysis of coverage likelihood of tests generated based on a test template for each coverage event of the one or more coverage events, wherein the testing policy comprises a plurality of test templates and execution parameters thereof, wherein the testing policy is configured to statistically cover the one or more coverage events; and
implementing the testing policy, wherein said implementing comprises generating one or more tests based on the plurality of test templates, thereby covering the one or more coverage events,
wherein a first testing policy for a first set of bug-prone elements determined during a first iteration comprises different test templates than a second testing policy for a second set of bug-prone elements determined during a second iteration.
