# US 2017/0255543 A1 · Detecting Errors for Function Calls with an Implicit Receiver Object

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

- Number: US 2017/0255543 A1
- Document ID: US20170255543A1
- Status: Published application
- Kind: A1
- Application number: 15/449,851
- Filed: 2017-03-03
- Published: 2017-09-07
- Earliest claimed: 2016-03-03
- Assignees: Synopsys, Inc.
- Applicants: Synopsys, Inc.
- Inventors: Peter Hallam; Brett van Swelm; Peter Dillinger
- Web page: https://patentgrep.com/patent/US20170255543A1

## CPC

- G06F 11/3604: Analysis of software for verifying properties of programs (testing of software G06F11/3668)
- G06F 11/3624: {by performing operations on the source code, e.g. via a compiler}
- G06F 11/3688: {for test execution, e.g. scheduling of test suites}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A code testing system identifies possible code errors that may generate unexpected application behaviors. The code testing system identifies function calls in the system by identifying function call sites that do not specify a receiver object but may invoke a function that uses a receiver object. To identify these call sites, the code testing system analyzes function operation to determine receiver functions that use a receiver object, and may exclude functions that use the receiver object in a pro forma way or that does not rely on or affect properties of the object. A callgraph is generated for the functions in the code to identify possible functions called from a call site. When a call site, based on the callgraph, may invoke a receiver function, the call site is analyzed to determine whether it specifies a receiver object for the called function and identifies an error when the call site does not specify a receiver object.

## Claims

### Claim 1

A computer-implemented method for detecting errors in computer code, comprising:
identifying, by a processor, a set of functions in computer code in a programming language for execution by a computer, the programming language of the computer code permitting the use of receiver objects for functions in the programming language without explicitly specifying the receiver object;
determining, by the processor, a callgraph for the set of functions in the computer code, the callgraph identifying a set of function call sites in the set of functions and for each function call site a set of called functions that could be invoked from the function call site during execution of the computer code by the computer;
identifying, by the processor, a set of receiver functions that recite a receiver object in the function;
identifying, by the processor, from the set of function call sites, a set of candidate function call sites that include a receiver function of the set of receiver functions in the set of called functions identified for the function call site; and
for each candidate function call site, identifying, by the processor, an error in the computer code at the call site when the call site does not specify a receiver obj ect parameter.

### Claim 2 (depends on 1)

The method of claim 1, wherein identifying the set of called functions comprises filtering the set of receiver functions to exclude functions that do not functionally incorporate the receiver object in the computer code for the receiver function.

### Claim 3 (depends on 2)

The method of claim 2, wherein excluding function that do not functionally incorporate the receiver object comprises excluding functions that do not use an instance-specific variable of the receiver object in the function.

### Claim 4 (depends on 2)

The method of claim 2, wherein excluding functions that do not functionally incorporate the receiver object comprises excluding functions that use only global variables of the receiver object in the function.

### Claim 5 (depends on 2)

The method of claim 2, wherein excluding functions that do not functionally incorporate the receiver object comprises excluding functions that include only pro forma uses of the receiver object.

### Claim 6 (depends on 1)

The method of claim 1, wherein identifying the set of receiver functions comprises identifying receiver functions from the set of called functions

### Claim 7 (depends on 1)

The method of claim 1, wherein the function call graph is generated by iteratively determining possible functions for a function call site.

### Claim 8

A non-transitory computer-readable medium including instructions for execution on a processor, the instructions, when executed by the processor, causing the processor to:
identify, by a processor, a set of functions in computer code in a programming language for execution by a computer, the programming language of the computer code permitting the use of receiver objects for functions in the programming language without explicitly specifying the receiver object;
determine, by the processor, a callgraph for the set of functions in the computer code, the callgraph identifying a set of function call sites in the set of functions and for each function call site a set of called functions that could be invoked from the function call site during execution of the computer code by the computer;
identify, by the processor, a set of receiver functions that recite a receiver object in the function;
identify, by the processor, from the set of function call sites, a set of candidate function call sites that include a receiver function of the set of receiver functions in the set of called functions identified for the function call site; and
for each candidate function call site, identify, by the processor, an error in the computer code at the call site when the call site does not specify a receiver obj ect parameter.

### Claim 9 (depends on 8)

The non-transitory computer-readable medium of claim 8, wherein identifying the set of called functions comprises filtering the set of receiver functions to exclude functions that do not functionally incorporate the receiver object in the computer code for the receiver function.

### Claim 10 (depends on 9)

The non-transitory computer-readable medium of claim 9, wherein excluding function that do not functionally incorporate the receiver object comprises excluding functions that do not use an instance-specific variable of the receiver object in the function.

### Claim 11 (depends on 9)

The non-transitory computer-readable medium of claim 9, wherein excluding functions that do not functionally incorporate the receiver object comprises excluding functions that use only global variables of the receiver object in the function.

### Claim 12 (depends on 9)

The non-transitory computer-readable medium of claim 9, wherein excluding functions that do not functionally incorporate the receiver object comprises excluding functions that include only pro forma uses of the receiver object.

### Claim 13 (depends on 8)

The non-transitory computer-readable medium of claim 8, wherein identifying the set of receiver functions comprises identifying receiver functions from the set of called functions

### Claim 14 (depends on 8)

The non-transitory computer-readable medium of claim 8, wherein the function call graph is generated by iteratively determining possible functions for a function call site.

### Claim 15

A system comprising:
a processor configured to execute instructions;
a non-transitory computer-readable medium including instructions for execution by
the processor, the instructions causing the processor to:
identify a set of functions in computer code in a programming language for execution by a computer, the programming language of the computer code permitting the use of receiver objects for functions in the programming language without explicitly specifying the receiver object;
determine a callgraph for the set of functions in the computer code, the callgraph identifying a set of function call sites in the set of functions and for each function call site a set of called functions that could be invoked from the function call site during execution of the computer code by the computer;
identify a set of receiver functions that recite a receiver object in the function;
identify, from the set of function call sites, a set of candidate function call sites that include a receiver function of the set of receiver functions in the set of called functions identified for the function call site; and
for each candidate function call site, identify an error in the computer code at the call site when the call site does not specify a receiver object parameter.

### Claim 16 (depends on 15)

The system of claim 15, wherein identifying the set of called functions comprises filtering the set of receiver functions to exclude functions that do not functionally incorporate the receiver object in the computer code for the receiver function.

### Claim 17 (depends on 16)

The system of claim 16, wherein excluding function that do not functionally incorporate the receiver object comprises excluding functions that do not use an instance-specific variable of the receiver object in the function.

### Claim 18 (depends on 16)

The system of claim 16, wherein excluding functions that do not functionally incorporate the receiver object comprises excluding functions that use only global variables of the receiver object in the function.

### Claim 19 (depends on 16)

The system of claim 16, wherein excluding functions that do not functionally incorporate the receiver object comprises excluding functions that include only pro forma uses of the receiver object.

### Claim 20 (depends on 15)

The system of claim 15, wherein identifying the set of receiver functions comprises identifying receiver functions from the set of called functions
