# US 12,222,850 B2 · Automatic generation of code function and test case mapping

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

- Number: US 12,222,850 B2
- Document ID: US12222850B2
- Status: Granted
- Kind: B2
- Application number: 17/740,756
- Filed: 2022-05-10
- Published: 2023-10-19
- Granted: 2025-02-11
- Earliest claimed: 2022-04-15
- Assignees: Dell Products L.P.
- Applicants: Dell Products L.P.
- Inventors: Qin Zhang; Jin Qin; Jinghui Zhang; Shuyu Zhao; Xiaoxuan Dong
- Web page: https://patentgrep.com/patent/US12222850B2

## CPC

- G06F 11/3688: {for test execution, e.g. scheduling of test suites}
- G06F 11/3636: {by tracing the execution of the program}
- G06F 11/3684: {for test design, e.g. generating new test cases}
- G06F 11/3696: {Methods or tools to render software testable}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

An information handling system executes test cases against a code that includes a set of functions, wherein the execution is performed at least twice using a different trace switch value. The system also identifies trace logs associated with each test case, and maps each test case to one or more functions based on the association of the trace logs with each test case.

## Claims

### Claim 1

A method comprising:
executing, by a processor, a plurality of test cases against a code that includes a plurality of functions, wherein the executing of the test cases against the code is performed at least twice generating trace logs, wherein each of the executing of the test cases is performed a first time using a first trace switch value and a second time using a second trace switch value, and wherein the first trace switch value is different from the second trace switch value, wherein the executing of the test cases the first time is associated with a first set of functions, wherein the executing of the test cases the second time is associated with a second set of functions, and wherein the first set of functions is different than the second set of functions;
identifying the trace logs associated with each of the executing of the test cases;
generating a mapping of each test case of the test cases to at least one function of the plurality of functions based on association of the trace logs with each test case by randomly sampling the trace logs; and
generating a code coverage report that provides a first list of functions covered by the test cases and a second list of functions that are not covered by the test cases.

### Claim 2 (depends on 1)

The method of claim 1, further comprising identifying the plurality of functions associated with the code.

### Claim 3 (depends on 1)

The method of claim 1, wherein the code is a firmware associated with an embedded system.

### Claim 4 (depends on 1)

The method of claim 1, wherein the code is a software code.

### Claim 5 (depends on 1)

The method of claim 1, wherein each of the plurality of functions is associated with a trace log.

### Claim 6 (depends on 1)

The method of claim 1, further comprising generating another mapping of each test case to one or more trace logs.

### Claim 7 (depends on 1)

The method of claim 1, further comprising aggregating the mapping of each test case to the at least one function with a previous mapping of each test case to at least another function, resulting in an aggregated mapping of each test case to both functions.

### Claim 8

An information handling system, comprising:
a memory; and
a processor associated with the memory and configured to:
execute a plurality of test cases against a code that includes a plurality of functions, wherein the execution is performed at least twice generating trace logs, wherein each of the executions is performed a first time using a first trace switch value and a second time using a second trace switch value, and wherein the first trace switch value used the first time is different than the second trace switch value used the second time, wherein the executing of the test cases the first time is associated with a first set of functions, wherein the executing of the test cases the second time is associated with a second set of functions, and wherein the first set of functions is different than the second set of functions;
identify the trace logs associated with each execution of the test cases;
generate a mapping of each test case of the test cases to one or more of the plurality of functions based on association of the trace logs with each test case by randomly sampling the trace logs; and
generate a code coverage report that provides a first list of functions covered by the test cases and a second list of functions that are not covered by the test cases.

### Claim 9 (depends on 8)

The information handling system of claim 8, the processor further configured to identify the plurality of functions.

### Claim 10 (depends on 8)

The information handling system of claim 8, wherein the code is firmware associated with an embedded system.

### Claim 11 (depends on 8)

The information handling system of claim 8, wherein the code is a software code.

### Claim 12 (depends on 8)

The information handling system of claim 8, wherein each of the functions of the plurality of functions is associated with a trace log.

### Claim 13 (depends on 8)

The information handling system of claim 8, the processor further configured to generate another mapping of each test case to one or more trace logs.

### Claim 14 (depends on 8)

The information handling system of claim 8, wherein a current mapping of each test case to the one or more functions includes an aggregation of a previous mapping of each test case to the one or more functions that was generated in a previous execution of the test cases.

### Claim 15

A non-transitory computer-readable media to store instructions that are executable to perform operations comprising:
executing a plurality of test cases against a code that includes a plurality of functions, wherein the executing of the test cases against the code is performed at least twice generating trace logs, wherein each executing is performed a first time using a first trace switch value and a second time using a second trace switch value, and wherein the first trace switch value used the first time is different than the second trace switch value used the second time, wherein the executing of the test cases the first time is associated with a first set of functions, wherein the executing of the test cases the second time is associated with a second set of functions, and wherein the first set of functions is different than the second set of functions;
identifying the trace logs associated with each of the executing of the test cases;
mapping each test case of the test cases to one or more functions based on association of the trace logs with each test case by randomly sampling the trace logs; and
generating a code coverage report that provides a first list of functions covered by the test cases and a second list of functions that are not covered by the test cases.

### Claim 16 (depends on 15)

The non-transitory computer-readable media of claim 15, wherein the operations further comprise identifying each of the plurality of functions associated with the code.

### Claim 17 (depends on 15)

The non-transitory computer-readable media of claim 15, wherein the code is firmware associated with an embedded system.

### Claim 18 (depends on 15)

The non-transitory computer-readable media of claim 15, wherein the code is a software code.

### Claim 19 (depends on 15)

The non-transitory computer-readable media of claim 15, wherein each of the plurality of functions is associated with a trace log.

### Claim 20 (depends on 15)

The non-transitory computer-readable media of claim 15, wherein the operations further comprise aggregating the mapping of each test case to at least one function with a previous mapping of each test case to at least one different function.
