# US 10,872,033 B2 · System and method for determining test coverage

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

- Number: US 10,872,033 B2
- Document ID: US10872033B2
- Status: Granted
- Kind: B2
- Application number: 15/865,319
- Filed: 2018-01-09
- Published: 2018-05-10
- Granted: 2020-12-22
- Earliest claimed: 2013-12-09
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Philip S. P. Chan; Laurence A. Hey; William J. Izard; Matthew J. Ponsford
- Web page: https://patentgrep.com/patent/US10872033B2

## CPC

- G06F 11/3676: {for coverage analysis}
- G06F 8/49: {Partial evaluation}
- G06F 8/70: Software maintenance or management
- G06F 11/3688: {for test execution, e.g. scheduling of test suites}
- G06F 8/40: Transformation of program code
- G06F 8/433: {Dependency analysis; Data or control flow analysis}
- G06F 8/63: {Image based installation; Cloning; Build to order}
- G06F 9/44521: {Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A computer-implemented method, computer program product, and system is provided for determining test coverage. In an implementation, a method may include identifying at least one change in source code. The method may also include instrumenting object code of at least one class file associated with a source file of the source code associated with the identified at least one change. The method may further include testing the instrumented object code with at least one test case. The method may further include generating a coverage report associated with the instrumented object code, wherein the coverage report includes a proportion of the at least one change in the source code covered by the at least one test case.

## Claims

### Claim 1

A computer-implemented method comprising:
identifying, by a processor, at least one change in source code, wherein the at least one change in source code includes a new source file;
identifying, by the processor, at least one class file associated with the new source file of the source code associated with the at least one change;
instrumenting, by the processor, object code of the at least one class file associated with the source file of the source code associated with the identified at least one change, including instrumenting bytecode associated with each of the at least one class file associated with the new source file, wherein the instrumenting is applied partially to the at least one class file based on the at least one change;
testing, by the processor, the instrumented object code with at least one test case; and
generating, by the processor, a coverage report associated with the instrumented object code, wherein the coverage report includes a proportion of the at least one change in the source code covered by the at least one test case.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, wherein identifying the at least one change in the source code includes identifying the at least one change in the source code based upon, at least in part, a source code history change-set.

### Claim 3 (depends on 1)

The computer-implemented method of claim 1, wherein the at least one change in the source code includes at least one of a new source file and at least one change in an existing source file.

### Claim 4 (depends on 3)

The computer-implemented method of claim 3, further including: identifying the at least one class file associated with the source file of the source code associated with the at least one change based upon, at least in part, a source code attribute of the at least one class file.

### Claim 5 (depends on 4)

The computer-implemented method of claim 4, wherein instrumenting the object code of the at least one class file associated with the source file of the source code associated with the identified at least one change further includes:
instrumenting the object code associated with the at least one class file associated with the new source file.

### Claim 6 (depends on 4)

The computer-implemented method of claim 4, wherein instrumenting the object code of the at least one class file associated with the source file of the source code associated with the identified at least one change further includes:
instrumenting the object code associated with the at least one class file associated with the at least one change in the existing source file.

### Claim 7 (depends on 1)

The computer-implemented method of claim 1, wherein instrumenting the object code of the at least one class file associated with the source file of the source code associated with the identified at least one change includes inserting a counter into the object code of the at least one class file associated with the source file of the source code associated with the identified at least one change.

### Claim 8

A computer program product comprising a non-transitory computer readable medium having a plurality of instructions stored thereon, which, when executed by a processor, cause the processor to perform operations including:
identifying at least one change in source code, wherein the at least one change in source code includes a new source file;
identifying at least one class file associated with the new source file of the source code associated with the at least one change;
instrumenting object code of the at least one class file associated with the source file of the source code associated with the identified at least one change, including instrumenting bytecode associated with each of the at least one class file associated with the new source file, wherein the instrumenting is applied partially to the at least one class file based on the at least one change;
testing the instrumented object code with at least one test case; and generating a coverage report associated with the instrumented object code, wherein the coverage report includes a proportion of the at least one change in the source code covered by the at least one test case.

### Claim 9 (depends on 8)

The computer program product of claim 8, wherein identifying the at least one change in the source code includes identifying the at least one change in the source code based upon, at least in part, a source code history change-set.

### Claim 10 (depends on 8)

The computer program product of claim 8, wherein the at least one change in the source code includes at least one of a new source file and at least one change in an existing source file.

### Claim 11 (depends on 10)

The computer program product of claim 10, further including: identifying the at least one class file associated with the source file of the source code associated with the at least one change based upon, at least in part, a source code attribute of the at least one class file.

### Claim 12 (depends on 11)

The computer program product of claim 11, wherein instrumenting the object code of the at least one class file associated with the source file of the source code associated with the identified at least one change further includes:
instrumenting the object code associated with the at least one class file associated with the new source file.

### Claim 13 (depends on 11)

The computer program product of claim 11, wherein instrumenting the object code of the at least one class file associated with the source file of the source code associated with the identified at least one change further includes:
instrumenting the object code associated with the at least one class file associated with the at least one change in the existing source file.

### Claim 14 (depends on 8)

The computer program product of claim 8, wherein instrumenting the object code of the at least one class file associated with the source file of the source code associated with the identified at least one change includes inserting a counter into the object code of the at least one class file associated with the source file of the source code associated with the identified at least one change.

### Claim 15

A system comprising:
at least one processor device and at least one memory architecture coupled with the at least one processor device, the at least one processor device configured for:
identifying at least one change in source code, wherein the at least one change in source code includes a new source file;
identifying at least one class file associated with the new source file of the source code associated with the at least one change;
instrumenting object code of the at least one class file associated with the source file of the source code associated with the identified at least one change, including instrumenting bytecode associated with each of the at least one class file associated with the new source file, wherein the instrumenting is applied partially to the at least one class file based on the at least one change;
testing the instrumented object code with at least one test case; and
generating a coverage report associated with the instrumented object code, wherein the coverage report includes a proportion of the at least one change in the source code covered by the at least one test case.

### Claim 16 (depends on 15)

The system of claim 15, wherein identifying the at least one change in the source code includes identifying the at least one change in the source code based upon, at least in part, a source code history change-set.

### Claim 17 (depends on 15)

The system of claim 15, wherein the at least one change in the source code includes at least one of a new source file and at least one change in an existing source file.

### Claim 18 (depends on 17)

The system of claim 17, further including:
identifying the at least one class file associated with the source file of the source code associated with the at least one change based upon, at least in part, a source code attribute of the at least one class file.

### Claim 19 (depends on 18)

The system of claim 18, wherein instrumenting the object code of the at least one class file associated with the source file of the source code associated with the identified at least one change further includes:
instrumenting the object code associated with the at least one class file associated with the new source file.

### Claim 20 (depends on 18)

The system method of claim 18, wherein instrumenting the object code of the at least one class file associated with the source file of the source code associated with the identified at least one change further includes:
instrumenting the object code associated with the at least one class file associated with the at least one change in the existing source file.
