# US 2008/0313602 A1 · Bounded program failure analysis and correction

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2008/0313602 A1
- Document ID: US20080313602A1
- Status: Published application
- Kind: A1
- Application number: 11/763,312
- Filed: 2007-06-14
- Published: 2008-12-18
- Earliest claimed: 2007-06-14
- Assignees: Microsoft Corporation
- Inventors: Nikolai Tillmann; Jonathan Paul de Halleux; Wolfram Schulte
- Web page: https://patentgrep.com/patent/US20080313602A1

## CPC

- G06F 11/3688: {for test execution, e.g. scheduling of test suites}
- G06F 11/3636: {by tracing the execution of the program}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

In one embodiment, a computer system determines that a previously run test scenario configured to test a software program has failed to produce an expected result due to one or more semantic errors, generates error trace code configured to monitor the called component, processes the test scenario using the error trace code, and analyzes error trace information to determine the point at which the semantic error occurs in the called component. In an alternative embodiment, a computer system detects a semantic error in a software component of a software program, constructs an error condition that may include source code representing a minimum condition under which the error occurs, generates an object invariant based on the error condition that represents an opposite condition to that represented by the error condition, and automatically generates source code change recommendations using the object invariant that prevent the semantic error from reoccurring in subsequent test scenarios.

## Claims

### Claim 1

At a computer system, a method for automatically determining the point at which a semantic error occurs in a software component of a software program using an error trace corresponding to a single component of the software program, the method comprising:
an act of determining that a previously run test scenario configured to test a software program has failed to produce an expected result due to one or more semantic errors, the software program including at least one calling component and at least one called component, the calling component configured to call the called component, the call including one or more values to be used by the called component as inputs;
based on the determination, an act of generating error trace code configured to monitor the called component, the monitoring including identifying input values received in the call from the calling component and return values generated by the called component, the error trace code comprising a plurality of checks configured to detect unexpected result values for each software component;
an act of processing the test scenario using the error trace code, the error trace code detecting unexpected result values at the called component, the unexpected result values indicating a violation of specified allowable behavior for the called component; and
an act of analyzing error trace information provided by each of the plurality of checks of the error trace to determine the point at which the semantic error occurs in the called component.

### Claim 2 (depends on 1)

The method of claim 1, wherein the error trace expands one or more nested calls within the called component in order to show all call and return sequences within the component.

### Claim 3 (depends on 1)

The method of claim 1, further comprising:
an act of determining that the error trace is the same as at least one previously created error trace used with the called component; and
based on the determination, an act of discarding the error trace.

### Claim 4 (depends on 1)

The method of claim 1, wherein the semantic error occurs because one or more of the supplied inputs is an improper input that, when executed, results in an invalid process.

### Claim 5 (depends on 4)

The method of claim 4, further comprising an act of adding a check to the error trace to verify that the improper inputs resulted from improper processing by the calling component.

### Claim 6 (depends on 1)

The method of claim 1, wherein the error trace information provided by each of the plurality of checks of the error trace comprises argument values.

### Claim 7 (depends on 1)

The method of claim 1, wherein the error trace information provided by each of the plurality of checks of the error trace comprises normal result values.

### Claim 8 (depends on 1)

The method of claim 1, wherein the error trace is configured to track inputs and outputs of the called component such that each processing step is reproduceable.

### Claim 9

At a computer system, a method for automatically generating source code change recommendations for a software component that prevents one or more detected semantic errors from reoccurring in subsequent test scenarios, the method comprising:
an act of detecting a semantic error in a software component of a software program during the processing of a test scenario;
an act of constructing an error condition, the error condition comprising source code representing a minimum condition under which the semantic error occurs;
an act of generating an object invariant based on the error condition, the object invariant representing an opposite condition that is the opposite of the condition represented by the error condition; and
an act of automatically generating source code change recommendations using the object invariant that prevent the semantic error from reoccurring in subsequent test scenarios.

### Claim 10 (depends on 9)

The method of claim 9, further comprising an act of automatically applying the generated source code change recommendations to the software component.

### Claim 11 (depends on 10)

The method of claim 10, further comprising:
an act of determining that a different semantic error occurs in the software component that includes the automatically applied source code change recommendations; and
based on the determination, an act of generating an error trace configured to monitor the software component.

### Claim 12 (depends on 9)

The method of claim 9, further comprising an act of presenting the generated source code change recommendations to a software developer for application to the software component.

### Claim 13 (depends on 12)

The method of claim 12, further comprising an act of allowing the software developer to specify how the recommended changes are to be presented.

### Claim 14 (depends on 9)

The method of claim 9, wherein the error condition is directly derived from the source code instructions executed when the code is running.

### Claim 15 (depends on 9)

The method of claim 9, wherein the error condition is an approximation of how the error is reproduced.

### Claim 16 (depends on 9)

The method of claim 9, wherein one or more software components of the software program interact via public data fields.

### Claim 17 (depends on 16)

The method of claim 16, further comprising an act of tracking settings of the public fields to identify semantic errors in a software component of the software program.

### Claim 18

A computer program product for implementing a method for automatically generating source code change recommendations for a software component that prevents one or more detected semantic errors from reoccurring in subsequent test scenarios, the computer program product comprising one or more computer-readable media having thereon computer-executable instructions that, when executed by one or more processors of the computing system, cause the computing system to perform the method, the method comprising:
an act of detecting a semantic error in a software component of a software program during the processing of a test scenario;
an act of constructing an error condition, the error condition comprising source code representing a minimum condition under which the error occurs;
an act of generating an object invariant based on the error condition, the object invariant representing an opposite condition that is the opposite of the condition represented by the error condition; and
an act of automatically generating source code change recommendations using the object invariant that prevents the semantic error from reoccurring in subsequent test scenarios.

### Claim 19 (depends on 18)

The method implemented by the computer program product of claim 18, further comprising an act of automatically applying the generated source code change recommendations to the software component.

### Claim 20 (depends on 18)

The method implemented by computer program product of claim 18, further comprising an act of presenting the generated source code change recommendations to a software developer for application to the software component.
