IP Library Granted Patent US 12,608,299
Granted Patent B2
US 12,608,299 · App. 18/351,744 · Granted Apr 21, 2026

System and method for automated unit test generation for programming source code

Inventors: Arnau Giralt Ballbe (Barbera del Valles, ES); Neri Martinez (Barcelona, ES); Anton Hinz (Stadtbergen, DE)
Assignee: CloudBlue LLC
G06F11/3684G06F8/42G06F11/3688
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,608,299
App. No.
18/351,744
Granted
Apr 21, 2026
Kind
B2
Abstract

A system for generating unit tests based on source code is disclosed having a computer; a source code file containing source code having a plurality of constructs; the plurality of constructs each being of a type, such types including functions, return statements, property assignments, function calls, and branches; an abstract syntax tree generated by the computer based on the source code and the plurality of constructs; the abstract syntax tree having a plurality of nodes, wherein each of the plurality of constructs in the source code has a corresponding node; at least one unit test generated by the computer based on the nodes of the abstract syntax tree and pre-defined rules; the unit test including at least one grouping function corresponding to a function or a branch construct and at least one trial function corresponding to a return statement, a property assignment, or a function call construct.

Claims (37)

1 . A system for generating unit tests based on source code, comprising:

a computer, coupled to a processor;

a source code file available to the computer, the source code file containing source code having a plurality of constructs;

the plurality of constructs each being of a type, such types including functions, return statements, property assignments, function calls, and branches;

an abstract syntax tree generated by the computer based on the source code and the plurality of constructs;

the abstract syntax tree having a plurality of nodes, wherein each of the plurality of constructs in the source code has a corresponding node;

at least one unit test generated by the computer based on the nodes of the abstract syntax tree and pre-defined rules;

the unit test including at least one grouping function corresponding to a function construct or a branch construct; and

the unit test including at least one trial function corresponding to a return statement construct, a property assignment construct, or a function call construct,

wherein the computer is configured to traverse the abstract syntax tree using a recursive algorithm or stack-based traversal to identify one or more nodes of the plurality of nodes corresponding to one or more constructs of the plurality of constructs and to extract code information for generating test scenarios.

2 . The system of claim 1 , further comprising computer executable code for formatting the unit test.

3 . The system of claim 2 , wherein formatting the unit test includes making the unit test human readable.

4 . The system of claim 1 , further comprising computer executable code for executing the unit test and generating results.

5 . The system of claim 1 , wherein the source code is written in JavaScript or a JavaScript-derivative language.

6 . The system of claim 1 , wherein the source code is written in a loosely-typed language.

7 . The system of claim 1 , wherein the pre-defined rules are selected based on a programming language of the source code and provide instructions for how to generate a unit test for a particular node or construct.

8 . A computer-implemented method, comprising:

receiving at a computer a source code file having a plurality of constructs, the plurality of constructs each being of a type, such types including functions, return statements, property assignments, function calls, and branches;

generating an abstract syntax tree based on the source code and the plurality of constructs, the abstract syntax tree having a plurality of nodes, wherein each of the plurality of constructs in the source code has a corresponding node;

generating a unit test based on the nodes and pre-defined rules, the unit test including at least one grouping function corresponding to a function construct or a branch construct and the unit test including at least one trial function corresponding to a return statement construct, a property assignment construct, or a function call construct; and

wherein the computer is configured to traverse the abstract syntax tree using a recursive algorithm or stack-based traversal to identify one or more nodes of the plurality of nodes corresponding to one or more constructs of the plurality of constructs and to extract code information for generating test scenarios.

9 . The method of claim 8 , further comprising formatting the unit test.

10 . The method of claim 9 , wherein formatting the unit test includes making the unit test human readable.

11 . The method of claim 8 , further comprising executing the unit test and generating results.

12 . The method of claim 8 , wherein the source code is written in JavaScript or a JavaScript-derivative language.

13 . The method of claim 8 , wherein the source code is written in a loosely-typed language.

14 . The method of claim 8 , wherein the pre-defined rules are selected based on a programming language of the source code and provide instructions for how to generate a unit test for a particular node or construct.

15 . A non-transitory tangible computer-readable device having instructions stored thereon that, when executed by a computing device, cause the computing device to perform operations comprising:

receiving at a computer a source code file having a plurality of constructs, the plurality of constructs each being of a type, such types including functions, return statements, property assignments, function calls, and branches;

generating an abstract syntax tree based on the source code and the plurality of constructs, the abstract syntax tree having a plurality of nodes, wherein each of the plurality of constructs in the source code has a corresponding node;

generating a unit test based on the nodes and pre-defined rules, the unit test including at least one grouping function corresponding to a function construct or a branch construct and the unit test including at least one trial function corresponding to a return statement construct, a property assignment construct, or a function call construct; and

wherein the computer device is configured to traverse the abstract syntax tree using a recursive algorithm or stack-based traversal to identify one or more nodes of the plurality of nodes corresponding to one or more constructs of the plurality of constructs and to extract code information for generating test scenarios.

16 . The computer-readable device of claim 15 , further comprising formatting the unit test, including making the unit test human readable.

17 . The computer-readable device of claim 15 , further comprising executing the unit test and generating results.

18 . The computer-readable device of claim 15 , wherein the source code is written in JavaScript or a JavaScript-derivative language.

19 . The computer-readable device of claim 15 , wherein the source code is written in a loosely-typed language.

20 . The computer-readable device of claim 15 , wherein the pre-defined rules are selected based on a programming language of the source code and provide instructions for how to generate a unit test for a particular node or construct.

Assignments (9)
RELEASE OF SECURITY INTEREST Recorded Oct 1, 2025
From: THE BANK OF NEW YORK MELLON TRUST COMPANY, N.A.
To: CLOUDBLUE LLC
Reel/Frame 072439/0114 →
SECURITY INTEREST Recorded Sep 25, 2025
From: CLOUDBLUE LLC
To: BANK OF MONTREAL
Reel/Frame 072935/0233 →
PARTIAL RELEASE (REEL 070433 / FRAME 0401) Recorded Aug 22, 2025
From: JPMORGAN CHASE BANK, N.A.
To: CLOUDBLUE LLC
Reel/Frame 072566/0004 →
PARTIAL RELEASE (REEL 070433 / FRAME 0480) Recorded Aug 22, 2025
From: JPMORGAN CHASE BANK, N.A.
To: CLOUDBLUE LLC
Reel/Frame 072565/0846 →
SECURITY AGREEMENT (ABL) Recorded Mar 6, 2025
From: CLOUDBLUE LLC; INGRAM MICRO INC.
To: JPMORGAN CHASE BANK, N.A., AS COLLATERAL AGENT
Reel/Frame 070433/0480 →
SECURITY AGREEMENT (NOTES) Recorded Mar 6, 2025
From: CLOUDBLUE LLC; INGRAM MICRO INC.
To: THE BANK OF NEW YORK MELLON TRUST COMPANY, N.A., AS NOTES COLLATERAL AGENT
Reel/Frame 070433/0331 →
SECURITY AGREEMENT (TERM) Recorded Mar 6, 2025
From: CLOUDBLUE LLC; INGRAM MICRO INC.
To: JPMORGAN CHASE BANK, N.A., AS COLLATERAL AGENT
Reel/Frame 070433/0401 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 17, 2024
From: GIRALT BALLBE, ARNAU; MARTINEZ, NERI
To: CLOUDBLUE LLC
Reel/Frame 068606/0912 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 13, 2024
From: HINZ, ANTON
To: CLOUDBLUE LLC
Reel/Frame 068581/0931 →
Continuity (1)
Related Publication 20250021470A1 · Jan 16, 2025
References Cited (10)
US 9792443B1 · Sheridan · 2017 [cited by applicant]
US 20190391910A1 · Okazaki · 2019 [cited by applicant]
US 20220066747A1 · Drain · 2022 [cited by applicant]
US 20220075710A1 · Glowa · 2022 [cited by examiner]
CN 112035370A · 2020 [cited by examiner]
CN 113010431A · 2021 [cited by examiner]
CN 113448874A · 2021 [cited by examiner]
CN 113778848A · 2021 [cited by examiner]
JP 2010267266A · 2010 [cited by examiner]
International Search Report and Written Opinion issued in PCT/US2024/037899, dated Nov. 22, 2024, 16 pgs. [cited by applicant]