IP Library Granted Patent US 7,530,057
Granted Patent B2
US 7,530,057 · App. 10/971,267 · Granted May 5, 2009

Program code coverage

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,530,057
App. No.
10/971,267
Granted
May 5, 2009
Kind
B2
Abstract

Determining code coverage of a computer program is disclosed. In an embodiment, the program is divided into a plurality of code sections, and the program including the plurality of code sections is run with a plurality of test data sets. In the first test run, all code sections of the plurality of code sections are instrumented, and in each of a current test run other than the first test run, only those code sections that were not executed in any one of the test runs prior to the current test run are instrumented. A code section being executed in any of one of the test runs of the plurality of test runs is considered covered by the test runs. Additionally, within the current test run, the code coverage measurement is only done on the first execution of a code section.

Claims (31)

1. A method for determining code coverage of a computer program, comprising:

providing a plurality of code sections in the program;

applying a plurality of test runs to the program including the plurality of code sections;

wherein

in a first test run of the plurality of test runs, instrumenting all code sections of the plurality of code sections by inserting a first test instruction in each of the code sections;

in the first test run, after executing any particular one of the instrumented code sections, replacing the first test instruction in the particular instrumented code section with a second test instruction, wherein the second test instruction comprises an instruction selected from a group consisting of a no operation instruction and a no operation equivalent instruction, and wherein the first test instruction comprises an instruction to replace the first test instruction with the instruction selected from the group consisting of a no operation instruction and a no operation equivalent instruction;

in a current test run after the first test run, instrumenting only those code sections that were not executed in any one of the test runs prior to the current test run;

a code section being executed in any of one of the test runs of the plurality of test runs is considered covered by the plurality of test runs.

2. The method of claim 1 wherein data indicating whether a code section is executed in a test run is saved for use in a subsequent test run.

3. The method of claim 1 wherein a code section is associated with a piece of data indicating whether that code section is executed in a test run, and this piece of data is saved for use in a subsequent test run.

4. The method of claim 1 wherein:

reaching the first test instruction in the particular one of the code sections indicates that the particular code section is executed in a particular test run.

5. The method of claim 1 wherein:

the plurality of code sections correspond to a plurality of pieces of data, each piece of data is associated with a code section and indicates whether that code section is executed in a test run, and

saving the plurality of pieces of data after the first test run indicates the first test run is performed.

6. The method of claim 1 wherein:

within the current test run, executing the first test instruction in any instrumented code section only one time.

7. The method of claim 1 , further comprising:

determining that the particular one of the code sections has been executed by finding the second test instruction instead of the first test instruction in the particular code section.

8. The method of claim 7 , further comprising:

determining that a given one of the code sections was not executed by finding the first test instruction in the given code section.

9. The method of claim 1 , further comprising:

in the current test run, for those code sections that were run in any one of the test runs prior to the current test run, executing the code sections containing the second test instruction rather than code sections containing the first test instruction.

10. A computer-readable storage medium embodying program instructions that when executed by a computer performs a method for determining code coverage of a program, the method comprising:

corresponding a flag of a plurality of first flags to a code section of a plurality of code sections of the program;

instrumenting the code sections based on the values of the plurality of first flags, wherein instrumenting the code sections comprises inserting a first test instruction in each of the instrumented code sections;

in a test run of the program, upon executing the first test instruction in any particular one of the instrumented code sections, replacing the first test instruction with a second test instruction in the particular instrumented code section, wherein the second test instruction comprises an instruction selected from a group consisting of a no operation instruction and a no operation equivalent instruction, and wherein the first test instruction comprises an instruction to replace the first test instruction with the instruction selected from the group consisting of a no operation instruction and a no operation equivalent instruction.

11. The computer-readable storage medium of claim 10 , wherein the method further comprises:

determining that a given one of the code sections has been executed by finding the second test instruction instead of the first test instruction in the given code section.

12. The computer-readable storage medium of claim 11 , wherein the method further comprises:

determining that the given one of the code sections was not executed by finding the first test instruction in the given code section.

Assignments (4)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 26, 2021
From: OT PATENT ESCROW, LLC
To: VALTRUS INNOVATIONS LIMITED
Reel/Frame 057650/0537 →
PATENT ASSIGNMENT, SECURITY INTEREST, AND LIEN AGREEMENT Recorded Jan 26, 2021
From: HEWLETT PACKARD ENTERPRISE DEVELOPMENT LP; HEWLETT PACKARD ENTERPRISE COMPANY
To: OT PATENT ESCROW, LLC
Reel/Frame 055269/0001 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 9, 2015
From: HEWLETT-PACKARD DEVELOPMENT COMPANY, L.P.
To: HEWLETT PACKARD ENTERPRISE DEVELOPMENT LP
Reel/Frame 037079/0001 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 21, 2004
From: BABCOCK, DAVID J.
To: HEWLETT-PACKARD DEVELOPMENT COMPANY, L.P.
Reel/Frame 015952/0523 →