IP Library › Granted Patent US 10,725,894
Granted Patent B2
US 10,725,894 · App. 15/724,449 · Granted Jul 28, 2020

Measuring and improving test coverage

Inventors: Dominic DeMarco (Hyde Park, NY); Christopher Loers (Poughkeepsie, NY); Alexander Smith (East Haddam, CT); Brad D. Stilwell (Poughkeepsie, NY)
Assignee: INTERNATIONAL BUSINESS MACHINES CORPORATION
G06F11/3684G06F11/3612G06F11/3636G06F11/3664G06F11/3676G06F11/3688G06F11/3692
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 10,725,894
App. No.
15/724,449
Granted
Jul 28, 2020
Kind
B2
Abstract

Embodiments of the invention include methods and systems for improving test case coverage. Aspects of the invention include executing, by a processor, a first test case, where the first test case includes a plurality of system calls to an operating system. Prior to execution of each system call in the plurality of system calls in the first test case, executing, by the processor, a pre-exit instruction. Responsive to execution of the pre-exit instruction, collecting pre-exit system call data regarding each system call in the plurality of system calls for the first test case. The processor executes a post-exit instruction after completion of each system call in the plurality of system calls and responsive to execution of the post-exit instruction, collects post-exit system call data regarding each system call in the plurality of system calls for the first test case.

Claims (39)

1. A system for improving test coverage comprising:

a processor communicatively coupled to a memory, the processor configured to:

execute a first test case, where the first test case includes a plurality of system calls to an operating system;

prior to execution of each system call in the plurality of system calls in the first test case, execute a pre-exit instruction, wherein the pre-exit instruction is inserted before each system call in the plurality of system calls in the first test case;

responsive to execution of the pre-exit instruction, collect pre-exit system call data regarding each system call in the plurality of system calls for the first test case, wherein the pre-exit system call data comprises a plurality of pre-exit parameters associated with each system call in the plurality of system calls, and

wherein collecting pre-exit system call data comprises:

initializing a common buffer comprising a set of bit locations;

storing a first bit in a first bit location in the set of bit location based at least in part a determination that the pre-exit instruction gains control of the first test case prior to on an execution of each system call;

storing a second bit in a second bit location in the set of bit locations based at least in part on comparing a first pre-exit parameter from the plurality of pre-exit parameters associated with one or more expected results for the pre-exit parameter;

execute a post-exit instruction after completion of each system call in the plurality of system calls;

responsive to execution of the post-exit instruction, collect post-exit system call data regarding each system call in the plurality of system calls for the first test case wherein the post-exit system call data comprises a plurality of post-exit parameters associated with each system call in the plurality of system calls, and wherein at least one post-exit parameter comprises environment information associated with the operating system;

storing a third bit in a third bit location in the set of bit locations based at least in part on comparing a post-exit parameter from the plurality of post-exit parameters associated with one or more expected results for the post-exit parameter;

determining a set of combinations of parameters and calling environments associated with the plurality of system calls that were not driven; and

generating one or more new test cases based at least in part on the set of combinations.

2. The system of claim 1 , where the pre-exit system call data includes a number of system call types executed in the first test case.

3. The system of claim 1 , where the pre-exit system call data includes at least one of:

parameters passed to the system call, a type of task that made the system call, an address mode for the system call, and a time at which the system call was made.

4. The system of claim 1 , where the processor is further configured to:

generate one or more reports regarding the pre-exit system call data and the post-exit system call data.

5. The system of claim 4 , where the processor is further configured to:

generate one or more new test cases based at least in part on the one or more reports.

6. The system of claim 1 , where the pre-exit instruction includes an exit to a monitoring test case; and

where the post-exit instruction includes an exit to the monitoring test case.

7. A computer program product for improving test coverage, the computer program product comprising a computer readable storage medium having program instructions embodied therewith, where the program instructions are executable by a processor to cause the processor to perform a method comprising:

executing, by the processor, a first test case, where the first test case includes a plurality of system calls to an operating system;

prior to execution of each system call in the plurality of system calls in the first test case, executing, by the processor, a pre-exit instruction, wherein the pre-exit instruction is inserted before each system call in the plurality of system calls in the first test case;

responsive to execution of the pre-exit instruction, collecting pre-exit system call data regarding each system call in the plurality of system calls for the first test case, wherein the pre-exit system call data comprises a plurality of pre-exit parameters associated with each system call in the plurality of system calls, and

wherein collecting pre-exit system call data comprises:

initializing a common buffer comprising a set of bit locations;

storing a first bit in a first bit location in the set of bit location based at least in part on a determination that the pre-exit instruction gains control of the first test case prior to an execution of each system call;

storing a second bit in a second bit location in the set of bit locations based at least in part on comparing a first pre-exit parameter from the plurality of pre-exit parameters associated with one or more expected results for the pre-exit parameter;

executing, by the processor, a post-exit instruction after completion of each system call in the plurality of system calls;

responsive to execution of the post-exit instruction, collecting post-exit system call data regarding each system call in the plurality of system calls for the first test case, wherein the post-exit system call data comprises a plurality of post-exit parameters associated with each system call in the plurality of system calls, and wherein at least one post-exit parameter comprises environment information associated with the operating system;

storing a third bit in a third bit location in the set of bit locations based at least in part on comparing a post-exit parameter from the plurality of post-exit parameters associated with one or more expected results for the post-exit parameter;

determining a set of combinations of parameters and calling environments associated with the plurality of system calls that were not driven; and

generating one or more new test cases based at least in part on the set of combinations.

8. The computer program product of claim 7 , where the pre-exit system call data includes a number of system call types executed in the first test case.

9. The computer program product of claim 7 , where the pre-exit system call data includes at least one of:

parameters passed to the system call, a type of task that made the system call, an address mode for the system call, and a time at which the system call was made.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 4, 2017
From: DEMARCO, DOMINIC; LOERS, CHRISTOPHER; SMITH, ALEXANDER; STILWELL, BRAD D.
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 043780/0001 →
Continuity (1)
Related Publication 20190102281A1 · Apr 4, 2019