# US 8,752,026 B2 · Efficient code instrumentation

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

- Number: US 8,752,026 B2
- Document ID: US8752026B2
- Status: Granted
- Kind: B2
- Application number: 12/475,739
- Filed: 2009-06-01
- Published: 2010-12-02
- Granted: 2014-06-10
- Earliest claimed: 2009-06-01
- Assignees: International Business Machines Corporation
- Applicants: Adi Sharabani; Omer Tripp
- Inventors: Adi Sharabani; Omer Tripp
- Web page: https://patentgrep.com/patent/US8752026B2

## CPC

- G06F 11/3624: {by performing operations on the source code, e.g. via a compiler}
- G06F 11/3636: {by tracing the execution of the program}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method for instrumenting a computer program, the method including identifying a program slice within a computer program, and instrumenting the program slice within the program.

## Claims

### Claim 1

A method for instrumenting a computer program, the method comprising:
identifying a program slice within a computer program wherein said program slice includes any statements in said computer program that meet at least one predefined slicing criterion, and wherein identifying the program slice comprises applying said at least one predefined slicing criterion to include within said program slice any statements in said computer program that directly or indirectly relate to a predefined input vector and entry point of said computer program;
instrumenting, by an instrumentation engine, said program slice within said computer program prior to executing said instrumented computer program, wherein said instrumenting does not instrument unreachable code; and
executing said instrumented computer program.

### Claim 2 (depends on 1)

A method according to claim 1 wherein said identifying step comprises identifying said program slice wherein said program slice includes fewer than all of the statements in said computer program.

### Claim 3 (depends on 1)

A method according to claim 1 wherein said identifying step comprises applying said at least one predefined slicing criterion to include within said program slice any statements in said computer program that directly or indirectly relate to an action performed with a selected variable before or after a specific point within said computer program.

### Claim 4 (depends on 1)

A method according to claim 1 wherein said instrumenting step comprises applying at least one predefined instrumentation criterion to said program slice, wherein said program slice comprises unexecuted program code, and wherein said at least one predefined instrumentation criterion determines what instrumentation is to be inserted into said program slice, and wherein said at least one predefined instrumentation criterion determines where said instrumentation is to be inserted into said program slice.

### Claim 5 (depends on 4)

A method according to claim 4 wherein said instrumenting step comprises instrumenting said program slice, wherein said program slice comprises unexecuted program code, within said computer program in a manner that does not change the underlying functionality of said program that is not related to said instrumentation.

### Claim 6

A system for instrumenting a computer program, the system comprising:
a processor; and
a computer readable memory device, having computer readable program code embodied therewith, said computer readable program code configured to:
identify, by a program slicer, a program slice within a computer program, wherein said program slice includes any statements in said computer program that meet at least one predefined slicing criterion, and wherein identifying the program slice comprises applying said at least one predefined slicing criterion to include within said program slice any statements in said computer program that directly or indirectly relate to a predefined input vector and entry point of said computer program;
instrument, by an instrumentation engine, said program slice within said computer program prior to executing said instrumented computer program, wherein said instrumenting does not instrument unreachable code; and
execute said instrumented computer program.

### Claim 7 (depends on 6)

The system of claim 6 wherein said program slicer is configured to include within said program slice fewer than all of the statements in said computer program.

### Claim 8 (depends on 6)

The system of claim 6 wherein said program slicer is configured to apply said at least one predefined slicing criterion to include within said program slice any statements in said computer program that directly or indirectly relate to an action performed with a selected variable before or after a specific point within said computer program.

### Claim 9 (depends on 6)

The system of claim 6 wherein said instrumentation engine is configured to apply at least one predefined instrumentation criterion to said program slice, wherein said program slice comprises unexecuted program code, and wherein said at least one predefined instrumentation criterion determines what instrumentation is to be inserted into said program slice, and wherein said at least one predefined instrumentation criterion determines where said instrumentation is to be inserted into said program slice.

### Claim 10 (depends on 9)

The system of claim 9 wherein said instrumentation engine is configured to instrument said program slice, wherein said program slice comprises unexecuted program code, within said computer program in a manner that does not change the underlying functionality of said program that is not related to said instrumentation.

### Claim 11

A computer program product for instrumenting a computer program, the computer program product comprising:
a computer readable memory device having computer readable program code embodied therewith, said computer readable program code configured to:
identify a program slice within a computer program, wherein said program slice includes any statements in said computer program that meet at least one predefined slicing criterion, and wherein identifying the program slice comprises applying said at least one predefined slicing criterion to include within said program slice any statements in said computer program that directly or indirectly relate to a predefined input vector and entry point of said computer program;
instrument, by an instrumentation engine, said program slice within said computer program prior to executing said instrumented computer program, wherein said instrumenting does not instrument unreachable code; and
execute said instrumented computer program.

### Claim 12 (depends on 11)

The computer program product of claim 11, wherein said computer readable program code is further configured to:
apply said at least one predefined slicing criterion to include within said program slice any statements in said computer program that directly or indirectly relate to an action performed with a selected variable before or after a specific point within said computer program.

### Claim 13 (depends on 11)

The computer program product of claim 11, wherein said computer readable program code is further configured to:
apply at least one predefined instrumentation criterion to said program slice, wherein said program slice comprises unexecuted program code, and wherein said at least one predefined instrumentation criterion determines what instrumentation is to be inserted into said program slice, and wherein said at least one predefined instrumentation criterion determines where said instrumentation is to be inserted into said program slice; and
instrument said program slice within said computer program in a manner that does not change the underlying functionality of said program that is not related to said instrumentation.
