IP Library › Granted Patent US 8,732,676
Granted Patent B1
US 8,732,676 · App. 12/202,009 · Granted May 20, 2014

System and method for generating unit test based on recorded execution paths

Inventors: Adam K. Kolawa (Bradbury, CA); Marek Kucharski (Cracow, PL)
Assignee: Parasoft Corporation
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 8,732,676
App. No.
12/202,009
Granted
May 20, 2014
Kind
B1
Abstract

A method and system for testing a computer software system based on execution paths including: executing the computer program to obtain an execution path in the computer software; recording the execution path; modifying variables in the recorded execution path to create one or more perturbed paths; analyzing the one or more perturbed paths to detect potential errors; and generating unit tests for the one or more perturbed paths having the detected potential errors. The created test units may then be executed to test the computer software.

Claims (22)

1. A method for testing a computer software system based on execution paths, the method comprising:

executing a computer program to obtain an original execution paths of the computer program;

recording the original execution paths;

selecting a first decision point on an executed path from the recorded original execution paths;

analyzing conditions that govern the selected first decision point and subsequent decision points along a first path to detect mutually exclusive conditions along the first path;

modifying one or more variables in the selected first decision point, taking into account the detected mutually exclusive conditions, to generate a new first perturbed logical path, the new perturbed first logical path not being part of the original execution path and having a high execution probability according to the modification of the one or more variables;

analyzing the first perturbed logical path starting from said first decision point to detect potential errors in said first perturbed logical path;

selecting a second decision point on said executed path;

analyzing conditions that govern the selected second decision point and subsequent decision points along a second path to detect mutually exclusive conditions along the second path;

modifying one or more variables in the selected second decision point, taking into account the detected mutually exclusive conditions, to generate a new second perturbed logical path, the second perturbed new logical path having a high execution probability according to the modification of the one or more variables in the selected second decision point;

analyzing the second perturbed logical paths starting from said second decision point to detect potential errors in said second perturbed logical path; and

automatically generating unit tests for the first and second perturbed logical paths having the detected potential errors by using variables and their values in the first and second perturbed logical paths and taking into account the detected mutually exclusive conditions at the first and second decision points, wherein modifying one or more variables in the selected first decision point comprises solving the following equation:

f(x 1 , x 2 , . . . , x N )−Y=0, where x 1 to x N are starting variables that are set to generate said new perturbed logical paths and Y is a desired value of a variable governing the decision point.

2. The method of claim 1 , wherein recorded execution path information include information about which lines in the computer software were executed and information about variable values at a given path stage.

3. The method of claim 1 , further comprising executing the generated test units to test the computer software.

4. The method of claim 1 , further comprising applying a pattern recognition analysis to the first and second perturbed paths using a set of pattern recognition rules.

5. The method of claim 1 , further comprising expanding graphs along function invocations of the recorded first execution path to obtain an elementary path from the recorded first execution path.

6. The method of claim 1 , wherein analyzing the first and second perturbed paths further comprises starting at any point in a perturbed path and traversing in a forward or backwards direction through a corresponding execution path.

7. The method of claim 1 , further comprising expanding a flow graph traversed along function calls for more detailed analysis.

8. The method of claim 6 , further comprising detecting rule violations along the corresponding execution path in the forward or backwards direction.

9. The method of claim 6 , further comprising validating whether a given path can be actually executed utilizing a user input.

10. The method of claim 6 , further comprising validating whether a given path can be actually executed utilizing symbolic execution and recorded paths from execution of the computer program.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 6, 2008
From: KOLAWA, ADAM K.; KUCHARSKI, MAREK
To: PARASOFT CORPORATION
Reel/Frame 021639/0468 →
Continuity (1)
Provisional Application 60968838 · Aug 29, 2007