# US 12,111,750 B1 · Source code evaluator and modified parameter structure for enabling automated validation of parameter values in source code

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

- Number: US 12,111,750 B1
- Document ID: US12111750B1
- Status: Granted
- Kind: B1
- Application number: 18/609,387
- Filed: 2024-03-19
- Granted: 2024-10-08
- Earliest claimed: 2023-11-22
- Assignees: SAS Institute Inc.
- Applicants: SAS Institute Inc.
- Inventors: Yongqiao Xiao; Patrick Nathan Koch
- Web page: https://patentgrep.com/patent/US12111750B1

## CPC

- G06F 11/3624: {by performing operations on the source code, e.g. via a compiler}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Parameter values in source code can be automatically validated using the techniques described herein. For example, a system can receive source code that includes a call to an action. The action can have a parameter that is set to a selected value in the source code. The parameter can be defined in definition data. The system can also receive a file that separate from the source code and includes metadata for the parameter. The system can extract the metadata from the file and modify the definition data to include the metadata. The system can then execute a validation process on the selected value for the parameter. The validation process can involve retrieving the metadata from the modified definition data, evaluating the selected value using the metadata to determine whether the selected value is invalid, and if it is invalid, outputting an error notification indicating that the selected value is invalid.

## Claims

### Claim 1

A system comprising:
one or more processors; and
one or more memories including program code that is executable by the one or more processors for causing the one or more processors to perform operations including:
receiving source code for a software program written in a programming language, the source code including a call to an action to be executed, the action having a parameter that is set to a selected value in the source code prior to the call to the action in the source code, wherein the parameter is defined in definition data;
receiving a file associated with the action, wherein the file is separate from the source code, and wherein the file includes metadata about the parameter;
extracting the metadata from the file;
modifying the definition data for the parameter to include the metadata for the parameter and a setter function, wherein the setter function is configured to validate the selected value and set the parameter to the selected value; and
after modifying the definition data and prior to calling the action for execution, automatically executing a validation process on the selected value for the parameter, wherein the validation process involves:
retrieving the metadata from the modified definition data;
executing the setter function in the modified definition data, wherein the setter function includes validation logic configured to evaluate the selected value using the retrieved metadata to determine that the selected value is invalid; and
in response to determining that the selected value is invalid, outputting an error notification indicating that the selected value is invalid.

### Claim 2 (depends on 1)

The system of claim 1, wherein the operations further comprise:
providing a code editing interface through which a user can edit the source code;
presenting the source code in the code editing interface to the user;
triggering the validation process based on an input from the user in the code editing interface; and
in response to determining that the selected value is invalid, outputting the error notification to the user in the code editing interface.

### Claim 3 (depends on 1)

The system of claim 1, wherein the parameter is a class in an object-oriented programming language, and wherein modifying the definition data includes modifying the class to include the metadata.

### Claim 4 (depends on 3)

The system of claim 3, wherein modifying the definition data further includes:
adding a getter function to the definition data, wherein the getter function is configured to validate and return a value of the parameter.

### Claim 5 (depends on 4)

The system of claim 4, wherein automatically executing the validation process on the selected value involves executing the getter function in the modified definition data.

### Claim 6 (depends on 1)

The system of claim 1, wherein the file is a binary file that is separate from the source code, the binary file including the metadata.

### Claim 7 (depends on 1)

The system of claim 1, wherein the metadata indicates a name associated with the parameter, a type associated with the parameter, a default value associated with the parameter, a set of valid values associated with the parameter, and a sub-parameter associated with the parameter.

### Claim 8 (depends on 7)

The system of claim 7, wherein the set of valid values includes a maximum value and a minimum value for the parameter.

### Claim 9 (depends on 1)

The system of claim 1, wherein the operations comprise:
overriding a default parameter structure associated with the action with a custom parameter structure associated with the action, wherein the default parameter structure requires parameters of the action to be set to values as part of a run command for the action in the source code, and wherein the custom parameter structure allows the parameters of the action to be set to the values in the source code prior to the run command for the action, so that the parameters of the action can be individually validated using the metadata prior to executing the run command for the action.

### Claim 10 (depends on 1)

The system of claim 1, wherein the definition data is in a declarative format.

### Claim 11 (depends on 1)

The system of claim 1, wherein the metadata includes validation information for multiple parameters of the action, wherein the multiple parameters are set to respective values in the source code, and wherein the operations comprise, prior to executing a run command for the action:
sequentially validating each respective value for each respective parameter of the multiple parameters using a corresponding portion of the metadata; and
for each respective parameter of the multiple parameters determined to be invalid, outputting a respective error notification.

### Claim 12 (depends on 1)

The system of claim 1, wherein the error notification indicates one or more valid values for the parameter, the one or more valid values being extracted from the metadata.

### Claim 13 (depends on 1)

The system of claim 1, wherein the operations further comprise:
determining that the selected value is valid; and
in response to determining that the selected value is valid, allowing the call to the action to be executed.

### Claim 14 (depends on 1)

The system of claim 1, wherein the metadata includes validation information for a plurality of nested sub-parameters associated with the parameter, wherein the plurality of nested sub-parameters are set to respective values in the source code, and wherein the operations comprise, prior to executing a run command for the action:
validating each respective value for each respective sub-parameter of the plurality of nested sub-parameters using a respective portion of the metadata; and
for each respective sub-parameter of the plurality of nested sub-parameters determined to be invalid, outputting a respective error notification.

### Claim 15

A method comprising:
receiving, by one or more processors, source code for a software program written in a programming language, the source code including a call to an action to be executed, the action having a parameter that is set to a selected value in the source code prior to the call to the action in the source code, wherein the parameter is defined in definition data;
receiving, by the one or more processors, a file associated with the action, wherein the file is separate from the source code, and wherein the file includes metadata about the parameter;
extracting, by the one or more processors, the metadata from the file;
modifying, by the one or more processors, the definition data for the parameter to include the metadata for the parameter and a setter function, wherein the setter function is configured to validate the selected value and set the parameter to the selected value; and
after modifying the definition data and prior to calling the action for execution, automatically executing, by the one or more processors, a validation process on the selected value for the parameter, wherein the validation process involves:
retrieving the metadata from the modified definition data;
executing the setter function in the modified definition data, wherein the setter function includes validation logic configured to evaluate the selected value using the retrieved metadata to determine that the selected value is invalid; and
in response to determining that the selected value is invalid, outputting an error notification indicating that the selected value is invalid.

### Claim 16 (depends on 15)

The method of claim 15, further comprising:
providing a code editing interface through which a user can edit the source code;
presenting the source code in the code editing interface to the user;
triggering the validation process based on an input from the user in the code editing interface; and
in response to determining that the selected value is invalid, outputting the error notification to the user in the code editing interface.

### Claim 17 (depends on 15)

The method of claim 15, wherein the parameter is a class in an object-oriented programming language, and wherein modifying the definition data includes modifying the class to include the metadata.

### Claim 18 (depends on 15)

The method of claim 15, wherein modifying the definition data further includes:
adding a getter function to the definition data, wherein the getter function is configured to validate and return a value of the parameter.

### Claim 19 (depends on 18)

The method of claim 18, wherein automatically executing the validation process on the selected value involves executing the getter function in the modified definition data.

### Claim 20 (depends on 15)

The method of claim 15, wherein the file is a binary file that is separate from the source code, the binary file including the metadata.

### Claim 21 (depends on 15)

The method of claim 15, wherein the metadata indicates a name associated with the parameter, a type associated with the parameter, and a set of valid values associated with the parameter.

### Claim 22 (depends on 21)

The method of claim 21, wherein the set of valid values includes multiple numerical values for the parameter.

### Claim 23 (depends on 15)

The method of claim 15, further comprising:
overriding a default parameter structure associated with the action with a custom parameter structure associated with the action, wherein the default parameter structure requires parameters of the action to be set to values as part of a run command for the action in the source code, and wherein the custom parameter structure allows the parameters of the action to be set to the values in the source code prior to the run command for the action, so that the parameters of the action can be individually validated using the metadata prior to executing the run command for the action.

### Claim 24 (depends on 15)

The method of claim 15, wherein the definition data is in a declarative format.

### Claim 25 (depends on 15)

The method of claim 15, wherein the metadata includes validation information for multiple parameters of the action, wherein the multiple parameters are set to respective values in the source code, and further comprising, prior to executing a run command for the action:
sequentially validating each respective value for each respective parameter of the multiple parameters using a corresponding portion of the metadata; and
for each respective parameter of the multiple parameters determined to be invalid, outputting a respective error notification.

### Claim 26 (depends on 15)

The method of claim 15, wherein the error notification indicates one or more valid values for the parameter, the one or more valid values being extracted from the metadata.

### Claim 27 (depends on 15)

The method of claim 15, further comprising:
determining that the selected value is valid; and
in response to determining that the selected value is valid, allowing the call to the action to be executed.

### Claim 28 (depends on 15)

The method of claim 15, wherein the metadata includes validation information for a plurality of nested sub-parameters associated with the parameter, wherein the plurality of nested sub-parameters are set to respective values in the source code, and further comprising, prior to executing a run command for the action:
validating each respective value for each respective sub-parameter of the plurality of nested sub-parameters using a respective portion of the metadata; and
for each respective sub-parameter of the plurality of nested sub-parameters determined to be invalid, outputting a respective error notification.

### Claim 29

A non-transitory computer-readable medium comprising including program code that is executable by one or more processors for causing the one or more processors to perform operations including:
receiving source code for a software program written in a programming language, the source code including a call to an action to be executed, the action having a parameter that is set to a selected value in the source code prior to the call to the action in the source code, wherein the parameter is defined in definition data;
receiving a file associated with the action, wherein the file is separate from the source code, and wherein the file includes metadata about the parameter;
extracting the metadata from the file;
modifying the definition data for the parameter to include the metadata for the parameter and a setter function, wherein the setter function is configured to validate the selected value and set the parameter to the selected value;
and
after modifying the definition data and prior to calling the action for execution, automatically executing a validation process on the selected value for the parameter, wherein the validation process involves:
retrieving the metadata from the modified definition data;
executing the setter function in the modified definition data, wherein the setter function includes validation logic configured to evaluate the selected value using the retrieved metadata to determine that the selected value is invalid; and
in response to determining that the selected value is invalid, outputting an error notification indicating that the selected value is invalid.

### Claim 30 (depends on 29)

The non-transitory computer-readable medium of claim 29, wherein the operations further comprise:
providing a code editing interface through which a user can edit the source code;
presenting the source code in the code editing interface to the user;
triggering the validation process based on an input from the user in the code editing interface; and
in response to determining that the selected value is invalid, outputting the error notification to the user in the code editing interface.
