×

Automatically generating test cases for binary code

  • US 7,873,945 B2
  • Filed: 06/29/2007
  • Issued: 01/18/2011
  • Est. Priority Date: 06/29/2007
  • Status: Active Grant
First Claim
Patent Images

1. At a computer system, a method for automatically generating test cases for testing binary code, the method comprising:

  • an act of accessing a portion of binary code that has a specified number of input variables;

    an act of analyzing the portion of binary code to identify the locations of conditional statements within the portion of binary code, each conditional statement including a branch predicate, the branch predicate used to determine the direction of the branch execution within the portion of binary code;

    an act of inserting instrumentation probes into the portion of binary code to probe input values supplied to the branch predicates of the identified conditional statements, each inserted instrumentation probe inserted into the portion of binary code at a location preceding the location of an identified conditional statement, each instrumentation probe including a probe predicate function configured to calculate a value for the branch predicate that is to be used in the conditional statement it precedes;

    for each identified conditional statement;

    an act of submitting a plurality of input test cases at least equal to the number of specified input variables to the portion of binary code plus one;

    for each input test case;

    an act of submitting a random input value for each different variable of the specified number of variables;

    an act of receiving an output value calculated by the probe predicate function preceding the conditional statement, the output value having been generated from processing one or more of the input values;

    an act of using the input values included in each of the plurality of input test cases and the corresponding output values calculated by the probe predicate function to infer an equation representing the variable portion of the branch predicate of the conditional statement; and

    an act of refining further input test cases to the portion of binary code to include input values that cause the conditional statement to take a path to further executable instructions, and not to exit the program, based on the inferred equation such that executable instructions after the conditional statement can be more efficiently tested using the further input cases.

View all claims
  • 2 Assignments
Timeline View
Assignment View
    ×
    ×