# US 9,003,379 B2 · Methods and systems for generating test information from a source code

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

- Number: US 9,003,379 B2
- Document ID: US9003379B2
- Status: Granted
- Kind: B2
- Application number: 13/323,745
- Filed: 2011-12-12
- Published: 2013-06-13
- Granted: 2015-04-07
- Earliest claimed: 2011-12-12
- Assignees: Zynga Inc.
- Applicants: Aleksandr Kuzmin
- Inventors: Aleksandr Kuzmin
- Web page: https://patentgrep.com/patent/US9003379B2

## CPC

- G06F 11/3676: {for coverage analysis}
- G06F 8/72: Code refactoring
- G06F 11/368: {for test version control, e.g. updating test cases to a new software version}
- G06F 11/3684: {for test design, e.g. generating new test cases}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Systems and methods for generating test information from a source code are described. One of the methods includes accessing the source code. The method further includes receiving a modification of the source code to generate a modified source code. The modification includes one or more instructions that do not affect functions performed by executing the source code. The modification further includes one or more instructions for generating test information regarding each executable line of the source code.

## Claims

### Claim 1

A method for generating test information from a source code, comprising:
accessing the source code, wherein the source code includes a declaration line;
receiving an instrumentation of the source code to generate a modified source code, the instrumentation including one or more instructions that do not affect functions performed by executing the source code, the instrumentation including prepending each executable line of the source code with the one or more instructions for generating test information regarding each executable line of the source code, wherein the test information is regarding operability associated with a corresponding one of the functions of each executable line; and
testing each executable line of the source code without testing the declaration line,
wherein said testing is performed to generate the test information that includes coverage information, the coverage information is regarding a number of times each executable line of the source code is executed during said testing,
wherein said testing is performed to generate the test information that includes consumption information, the consumption information is regarding a percentage of a time cycle of a hardware resource each executable line of the source code consumes during said testing,
wherein the method is performed by a processor.

### Claim 2 (depends on 1)

The method of claim 1, further comprising line of the source code to generate the test information that includes coverage providing the coverage information.

### Claim 3 (depends on 1)

The method of claim 1, providing the consumption information.

### Claim 4 (depends on 1)

The method of claim 1, wherein said accessing the source code comprises accessing a game code.

### Claim 5 (depends on 1)

The method of claim 1, wherein said testing is performed to generate the test information, wherein said testing each executable line of the source code comprises executing each executable line of the source code, wherein each executable line of the source code when executed performs at least a part of one of the functions.

### Claim 6 (depends on 1)

The method of claim 1, wherein each executable line is a definitionless line, a function prototypeless line, a commentless line, a non-empty line, and a declarationless line.

### Claim 7 (depends on 1)

The method of claim 1, wherein the consumption information is regarding a percentage of a central processing unit (CPU) time cycle consumed by execution of each executable line of the source code.

### Claim 8 (depends on 1)

The method of claim 1, wherein the test information includes a ratio of a number of loop condition statements within the source code to a number of function calls within the source code.

### Claim 9

A method for generating test information from a source code, comprising:
accessing the source code, wherein the source code includes a declaration line;
instrumenting the source code with one or more instructions, wherein said instrumenting the source code includes prepending each executable line of the source code with one or more instructions to provide coverage information related to each executable line of the source code or consumption information related to each executable line of the source code, wherein the coverage information or the consumption information is regarding operability associated with a corresponding function of each executable line, wherein prepending each executable line of the source code is performed to generate a modified source code;
testing each executable line of the source code without testing the declaration line;
providing the coverage information as a result of said testing, wherein said providing the coverage information comprises providing for display information regarding a number of times each executable line of the source code is executed during said testing; and
providing the consumption information as a result of said testing, wherein said providing the consumption information comprises providing for display information regarding a percentage of a time cycle of a hardware resource consumed by each executable line of the source code during said testing,
wherein the method is performed by a processor.

### Claim 10 (depends on 9)

The method of claim 9, wherein said testing each executable line is performed to generate the coverage information, each executable line of the source code executed during said testing.

### Claim 11 (depends on 9)

The method of claim 9, wherein said testing each executable line is performed to generate the consumption information.

### Claim 12 (depends on 9)

The method of claim 9, wherein said accessing the source code comprises accessing the source code that is executed to generate a game.

### Claim 13 (depends on 9)

The method of claim 9, wherein said testing each executable line of the source code comprises executing each executable line of the source code, wherein said instrumenting the source code comprises inserting the one or more instructions at each executable line of the source code for executing each executable line of the source code.

### Claim 14 (depends on 9)

The method of claim 9, wherein each executable line is a definitionless line, a function prototypeless line, a commentless line, a non-empty line, and a declarationless line.

### Claim 15 (depends on 9)

The method of claim 9, wherein said testing each executable line is performed to generate the consumption information, wherein said providing the consumption information comprises providing for display a percentage of a central processing unit (CPU) time cycle consumed by execution of each executable line of the source code.

### Claim 16 (depends on 9)

The method of claim 9, wherein said instrumenting the source code with the one or more instructions comprises instrumenting the source code to provide a ratio of a number of loop condition statements within the source code to a number of function calls within the source code.

### Claim 17

A computer system for generating test information from a source code, comprising:
an input device for receiving an instrumentation of the source code from a user, wherein the source code includes a declaration line;
an output device for providing test information,
the test information including information related to coverage received by each executable line of the source code during the test,
the test information further including information related to consumption of resources by each executable line of the source code;
a memory device for storing the source code; and
a processor for:
accessing the source code from the memory device;
generating a modified source code in response to receiving the instrumentation, the instrumentation including one or more instructions that do not affect functions performed by executing the source code, the one or more instructions prepended to each executable line of the source code for generating the test information for each executable line of the source code, wherein the test information is regarding operability associated with a corresponding one of the functions of each executable line;
testing each executable line of the source code without testing the declaration line,
wherein the instrumentation includes the one or more instructions for providing the coverage information related to each executable line of the source code, the coverage information including information regarding a number of times each executable line of the source code is executed during the test,
wherein the instrumentation includes the one or more instructions for providing the consumption information related to each executable line of the source code, the consumption information including information regarding a percentage of a time cycle of a hardware resource consumed by each executable line of the source code during the test.

### Claim 18 (depends on 17)

The computer system of claim 17, wherein the processor is for testing each executable line of the source code to generate the test information.

### Claim 19 (depends on 17)

The computer system of claim 17, wherein the processor is for testing each executable line of the source code to generate the test information.

### Claim 20 (depends on 17)

The computer system of claim 17, wherein the source code is executed to execute a game application, wherein each executable line is a definitionless line, a function prototypeless line, a commentless line, a non-empty line, and a declarationless line.

### Claim 21 (depends on 1)

The method of claim 1, wherein said testing each executable line of the source code is performed to generate the test information, the method further comprising compiling each executable line of the source code upon determining that each executable line passed the test.

### Claim 22 (depends on 1)

The method of claim 1, wherein said testing each executable line of the source code is performed to generate the test information, the method further comprising generating graphical user interface data from said testing, the graphical user interface data including a location in the source code at which each executable line started and a location in the source code at which each executable line ended.

### Claim 23 (depends on 1)

The method of claim 1, further comprising compiling the modified source code with a compiler, the compiler is pre-configured to compile the one or more instructions.
