IP Library Granted Patent US 7,886,272
Granted Patent B1
US 7,886,272 · App. 11/477,020 · Granted Feb 8, 2011

Prioritize code for testing to improve code coverage of complex software

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,886,272
App. No.
11/477,020
Granted
Feb 8, 2011
Kind
B1
Abstract

The present invention is directed to automatically analyzing software systems for identifying faults or bugs and/or detection of malicious code. In various embodiments, the present invention measures code coverage for high priority invocable program elements, uses a relaxed coverage estimation technique that, instead of guaranteeing which code units will be executed, guarantees that at least a certain number of code units will be executed, determines and solves constraints in code to identify infeasible paths containing one or more selected nodes, determines, for a composite data type, a range of values for each of at least two non-composite data fields, and/or translates, prior to code analysis complex code into simpler code having fewer operators.

Claims (76)

1. A method for determining a series (S) of one or more code units within program code, comprising:

first determining, by a processor, a plurality of series of code units, wherein for each series of code units, if any one of the code units of the series is executed, then each code unit of the series is executed;

identifying, by the processor, at least one series (So) of the plurality of series of code units, wherein So includes an invocable program block, the invocable program block comprising a set of one or more invocable program elements, wherein the invocable program block has at least one statement that invokes at least one invocable program element, wherein the invocable program element includes one or more members of a group consisting of a function call, a method call, a program call, another invocable program element, and combinations thereof;

second determining, by the processor, a grouping of one or more code units for each of the invocable program elements in the set, wherein the grouping includes at least some of the code units for at least one execution path from a starting code unit for the respective invocable program element to an ending code unit for the respective invocable program element;

executing, by the processor, a relaxed priority estimation, wherein the relaxed priority estimation determines a priority value as a number of code lines that at least will be executed without determining which specific code line will be executed;

based on the relaxed priority estimation, third determining, by the processor, a value for at least one of: the invocable program block and each of the invocation program blocks in the set; and

determining, by the processor, the series S as one of the plurality of series, wherein S is related to the value.

2. The method of claim 1 , wherein the value of an invocable program element is related to a number of members in the corresponding grouping and wherein determining the series S as one of the plurality of series, wherein S is related to the value comprises:

obtaining a priority for each series of the plurality of series, wherein the priority for So is dependent upon the value for at least one member of the set; and wherein S is determined from the priorities.

3. The method of claim 1 , wherein the value for the invocable program element is related to a number of code units executed in a path through the invocable program element.

4. The method of claim 1 , wherein the grouping includes substantially all code units for at least one execution path from a starting code unit for the invocable program element to an ending code unit for the invocable program.

5. The method of claim 1 , wherein the value is dependent upon one or more additional invocable program elements invoked when the code units of the path are executed.

6. The method of claim 2 , wherein the plurality of series comprises a plurality of invocation blocks and wherein third determining a value for at least one of: the invocable program block and each of the invocation program blocks in the comprises the following set of steps performed for each of the invocation blocks and for each of the invocation program elements in the corresponding set:

determine an entry value for an entry code unit; and

add to the entry value a node value corresponding to a super block node identifying the entry code unit, wherein the priority is the sum of the entry and node values.

7. The method of claim 1 , wherein the value is derived from at least one of: (i) a number of lines of source code associated with a corresponding node in a super dominator graph, (ii) the number of object code statements associated with the identified node, and (iii) a number of basic data type fields whose value can change during execution of the code identified by the node.

8. The method of claim 1 , wherein second determining a grouping of one or more code units for each of the invocable program elements in the set comprises the substeps of:

obtaining a representation of a graph, wherein the graph corresponds to a flow graph for the program code, and each node of the graph corresponds to a series of code units of the program code, wherein at least some of the nodes correspond to at least one of an invocation program block and element, and wherein if any one of the code units of the series is executed, then each code unit of the series is executed; and

determining one or more acyclic executable paths through the graph from a predetermined starting node of the graph to a predetermined ending node of the graph; and wherein based on the relaxed priority estimation, third determining a value for eat one of: the invocable program block and each of the invocation program blocks in the set comprises the substeps:

determining, for each of at least some nodes of the graph, a corresponding value, wherein for each node having a corresponding value, the corresponding value is indicative of a number of code units executed when the corresponding series for the node is executed;

determining, for each of the acyclic executable paths, a corresponding path weight, wherein for each executable path (P) having a path weight (Wtp), the path weight Wtp is related to a combination of the values of the nodes of the executable path P; and

sorting the executable paths according to their corresponding path weights; and wherein determining the series S as one of the plurality of series, wherein S is related to the value comprises the substeps:

determining, for each node (N) of the graph, a corresponding priority using the path weight for each of the executable paths containing N; and

determining the series S of code units from the corresponding priorities of the nodes.

9. The method of claim 1 , wherein second determining a grouping of one or more code units for each of the invocable program elements in the set comprises the substeps:

identifying a path through the program code, the path corresponding to a plurality of sets of code units;

determining constraints in the sets of code units that, if satisfied, cause the path to be executed; and

solving the constraints for determining input data to the program code.

10. The method of claim 1 , further comprising:

determining constraints in the code units that, if satisfied, cause the program code to be executed;

determining, for at least one composite data type having an instantiation accessed by the constraints, a range of values for each of at least two non-composite data fields of the instantiation; and

solving the constraints for determining input data to the program code, wherein the range for at least one of the non-composite data fields is used for solving the constraints.

11. The method of claim 1 , further comprising:

compiling the program code into a corresponding second program code having a reduced number data operator types than is used in the original program code, and once compiled, the following steps are performed:

determining constraints in the code units of the second program code that, if satisfied, cause the program code to be executed; and

solving the constraints for determining input data to the program code.

12. A non-transitory computer readable medium, stored on a tangible medium, comprising processor executable instructions to perform the steps of claim 1 .

13. A system that determines a series (S) of one or more code units within program code, comprising:

a processor operable to execute;

a priority estimation component operable to:

determine a plurality of series of code units, wherein for each series of code units, if any one of the code units of the series is executed, then each code unit of the series is executed;

identify at least one series (So) of the plurality of series, wherein So includes an invocable program block, the invocable program block comprising a set of at least one invocable program elements;

determine a grouping of one or more code units for each of the invocable program elements in the set, wherein the grouping includes at least some of the code units for at least one execution path from a starting code unit for the respective invocable program element to an ending code unit for the respective invocable program element, wherein the invocable program element proceeds from a predetermined entry code unit to at least one predetermined exit code unit, and wherein the invocable program element is at least one of a group consisting of a software package, a collection of one or more of class hierarchies, class methods, functions, subprograms, macros, other executable structures that are invoked, and combinations thereof;

executing a relaxed priority estimation, wherein the relaxed priority estimation determines a priority value as a number of code lines that at least will be executed without determining which specific code line will be executed;

based on the relaxed priority estimation, determine a value for at least one of: the invocable program block and the at least one invocation program elements; and

determine the series S as one of the plurality of series, wherein S is related to the value.

14. The system of claim 13 , wherein the value of an invocable program element is related to a number of members in the corresponding grouping and wherein the priority estimation component obtains a priority for each series of the plurality of series, wherein the priority for So is dependent upon the value for at least one member of the set and wherein S is determined from the priorities.

15. The system of claim 13 , wherein the value for the invocable program element is related to a number of code units executed in a path through the invocable program element.

16. The system of claim 13 , wherein the grouping includes substantially all code units for at least one execution path from a starting code unit for the invocable program element to an ending code unit for the invocable program.

17. The system of claim 13 , wherein the value is dependent upon one or more additional invocable program elements invoked when the code units of the path are executed.

18. The system of claim 14 , wherein the plurality of series comprises a plurality of invocation blocks and wherein determine a value for at least one of: the invocable program block and the at least one invocation program elements comprises the following set of sub-operations performed for each of the invocation blocks and for each of the invocation program elements in the corresponding set:

determine an entry value for an entry code unit; and

add to the entry value a node value corresponding to a super block node identifying the entry code unit, wherein the priority is the sum of the entry and node values.

19. The system of claim 13 , wherein the value is derived from at least one of:

(i) a number of lines of source code associated with a corresponding node in a super dominator graph, (ii) the number of object code statements associated with the identified node, and (iii) a number of basic data type fields whose value can change during execution of the code identified by the node.

20. The system of claim 13 , wherein determine a grouping of one or more code units for each of the invocable program elements in the set comprises the sub-operations of:

obtaining a representation of a graph, wherein the graph corresponds to a flow graph for the program code, and each node of the graph corresponds to a series of code units of the program code, wherein at least some of the nodes correspond to at least one of an invocation program block and element, and wherein if any one of the code units of the series is executed, then each code unit of the series is executed; and

determining one or more acyclic executable paths through the graph from a predetermined starting node of the graph to a predetermined ending node of the graph; and wherein based on the relaxed priority estimation, third determining a value for eat one of: the invocable program block and each of the invocation program blocks in the set comprises the substeps:

determining, for each of at least some nodes of the graph, a corresponding value, wherein for each node having a corresponding value, the corresponding value is indicative of a number of code units executed when the corresponding series for the node is executed;

determining, for each of the acyclic executable paths, a corresponding path weight, wherein for each executable path (P) having a path weight (Wtp), the path weight Wtp is related to a combination of the values of the nodes of the executable path P; and

sorting the executable paths according to their corresponding path weights; and wherein determining the series S as one of the plurality of series, wherein S is related to the value comprises the substeps:

determining, for each node (N) of the graph, a corresponding priority using the path weight for each of the executable paths containing N; and

determining the series S of code units from the corresponding priorities of the nodes.

21. The system of claim 13 , further comprising:

a constraint analysis subsystem operable to:

identify a path through the program code, the path comprising a number of sets of code units;

determine constraints in the sets of code units that, if satisfied, cause the path to be executed; and

solve the constraints for determining input data to the program code.

22. The system of claim 13 , further comprising:

a constraint analysis subsystem operable to:

determine constraints in the code units that, if satisfied, cause the program code to be executed;

determine, for at least one composite data type having an instantiation accessed by the constraints, a range of values for each of at least two non-composite data fields of the instantiation; and

solve the constraints for determining input data to the program code, wherein the range for at least one of the non-composite data fields is used for solving the constraints.

23. The system of claim 13 , further comprising: a code translator operable to translate the program code into a corresponding second program code having a reduced number data operator types than is used in the original program code, and a constraint analysis subsystem operable, once the program code is translated, to:

determine constraints in the code units of the second program code that, if satisfied, cause the program code to be executed; and

solve the constraints for determining input data to the program code.

Assignments (15)
RELEASE OF SECURITY INTEREST IN PATENTS (REEL/FRAME 045034/0001) Recorded May 18, 2023
From: GOLDMAN SACHS BANK USA., AS COLLATERAL AGENT
To: ZANG, INC. (FORMER NAME OF AVAYA CLOUD INC.); AVAYA INC.; INTELLISIST, INC.; AVAYA INTEGRATED CABINET SOLUTIONS LLC; OCTEL COMMUNICATIONS LLC; VPNET TECHNOLOGIES, INC.; HYPERQUALITY, INC.; HYPERQUALITY II, LLC; CAAS TECHNOLOGIES, LLC; AVAYA MANAGEMENT L.P.
Reel/Frame 063779/0622 →
RELEASE OF SECURITY INTEREST IN PATENTS AT REEL 45124/FRAME 0026 Recorded Apr 26, 2023
From: CITIBANK, N.A., AS COLLATERAL AGENT
To: AVAYA HOLDINGS CORP.; AVAYA INC.; AVAYA MANAGEMENT L.P.; AVAYA INTEGRATED CABINET SOLUTIONS LLC
Reel/Frame 063457/0001 →
SECURITY INTEREST Recorded Jan 23, 2018
From: AVAYA INC.; AVAYA INTEGRATED CABINET SOLUTIONS LLC; OCTEL COMMUNICATIONS LLC; VPNET TECHNOLOGIES, INC.; ZANG, INC.
To: CITIBANK, N.A., AS COLLATERAL AGENT
Reel/Frame 045124/0026 →
SECURITY INTEREST Recorded Jan 10, 2018
From: AVAYA INC.; AVAYA INTEGRATED CABINET SOLUTIONS LLC; OCTEL COMMUNICATIONS LLC; VPNET TECHNOLOGIES, INC.; ZANG, INC.
To: GOLDMAN SACHS BANK USA, AS COLLATERAL AGENT
Reel/Frame 045034/0001 →
RELEASE OF SECURITY INTEREST Recorded Jan 9, 2018
From: CITICORP USA, INC.
To: AVAYA, INC.; SIERRA HOLDINGS CORP.; AVAYA TECHNOLOGY, LLC; OCTEL COMMUNICATIONS LLC; VPNET TECHNOLOGIES, INC.
Reel/Frame 045032/0213 →
BANKRUPTCY COURT ORDER RELEASING ALL LIENS INCLUDING THE SECURITY INTEREST RECORDED AT REEL/FRAME 025863/0535 Recorded Dec 15, 2017
From: THE BANK OF NEW YORK MELLON TRUST, NA
To: AVAYA INC.
Reel/Frame 044892/0001 →
BANKRUPTCY COURT ORDER RELEASING ALL LIENS INCLUDING THE SECURITY INTEREST RECORDED AT REEL/FRAME 030083/0639 Recorded Dec 15, 2017
From: THE BANK OF NEW YORK MELLON TRUST COMPANY, N.A.
To: AVAYA INC.
Reel/Frame 045012/0666 →
BANKRUPTCY COURT ORDER RELEASING ALL LIENS INCLUDING THE SECURITY INTEREST RECORDED AT REEL/FRAME 041576/0001 Recorded Dec 15, 2017
From: CITIBANK, N.A.
To: AVAYA INC.; AVAYA INTEGRATED CABINET SOLUTIONS INC.; OCTEL COMMUNICATIONS LLC (FORMERLY KNOWN AS OCTEL COMMUNICATIONS CORPORATION); VPNET TECHNOLOGIES, INC.
Reel/Frame 044893/0531 →
SECURITY INTEREST Recorded Jan 27, 2017
From: AVAYA INC.; AVAYA INTEGRATED CABINET SOLUTIONS INC.; OCTEL COMMUNICATIONS CORPORATION; VPNET TECHNOLOGIES, INC.
To: CITIBANK, N.A., AS ADMINISTRATIVE AGENT
Reel/Frame 041576/0001 →
SECURITY AGREEMENT Recorded Mar 13, 2013
From: AVAYA, INC.
To: BANK OF NEW YORK MELLON TRUST COMPANY, N.A., THE
Reel/Frame 030083/0639 →
SECURITY AGREEMENT Recorded Feb 22, 2011
From: AVAYA INC., A DELAWARE CORPORATION
To: BANK OF NEW YORK MELLON TRUST, NA, AS NOTES COLLATERAL AGENT, THE
Reel/Frame 025863/0535 →
REASSIGNMENT Recorded Jun 26, 2008
From: AVAYA TECHNOLOGY LLC
To: AVAYA INC
Reel/Frame 021156/0689 →
SECURITY AGREEMENT Recorded Nov 28, 2007
From: AVAYA, INC.; AVAYA TECHNOLOGY LLC; OCTEL COMMUNICATIONS LLC; VPNET TECHNOLOGIES, INC.
To: CITICORP USA, INC., AS ADMINISTRATIVE AGENT
Reel/Frame 020166/0705 →
SECURITY AGREEMENT Recorded Nov 27, 2007
From: AVAYA, INC.; AVAYA TECHNOLOGY LLC; OCTEL COMMUNICATIONS LLC; VPNET TECHNOLOGIES, INC.
To: CITIBANK, N.A., AS ADMINISTRATIVE AGENT
Reel/Frame 020156/0149 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 17, 2006
From: EPISKOPOS, DENNIS C.; LI, J. JENNY; YEE, HOWELL S.; WEISS, DAVID M.
To: AVAYA TECHNOLOGY LLC
Reel/Frame 017945/0264 →