IP Library › Granted Patent US 12,579,053
Granted Patent B2
US 12,579,053 · App. 17/820,691 · Granted Mar 17, 2026

Contextual test code generation

Inventors: Adrian Tran (Issaquah, WA); Sichao Wang (Irvine, CA)
Assignee: SNAP INC.
G06F11/3688G06F11/3684
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,579,053
App. No.
17/820,691
Granted
Mar 17, 2026
Kind
B2
Abstract

At least one unit of a software application is identified. The at least one unit includes source code. The source code of the at least one unit is analyzed to determine a style of the source code. Metadata is extracted from the at least one unit based on the source code analysis. One or more features of the extracted metadata are classified. A template file is modified based on the extracted metadata and the classified features to create a modified template file.

Claims (25)

1 . A method performed by a computing device, the method comprising:

executing one or more unit tests using the modified template file, wherein modifying the template file includes adding one or more component definitions and dependencies in the style identified from the source code analysis and modifying a template file based on classified features of extracted metadata that is from at least one unit of a software application, the at least one unit comprising source code as a result of source code analysis, the result of the source code analysis comprising: a style of the source code and whether a first component is a property-less component indicating a structural characteristic of the component lacking property data, the classified features of the extracted metadata including a fake dependency between the first component and a second component; and

wherein executing the one or more unit tests further comprises generating the fake dependency for the software application that uses an Application Programming Interface (API).

2 . The method of claim 1 , wherein the metadata comprises one or more imports of one or more software modules, component definitions, and features used by the at least one unit.

3 . The method of claim 1 , further comprising determining at least one syntax pattern in the source code and wherein modifying the template file comprises modifying the template file based on the at least one syntax pattern.

4 . The method of claim 1 , wherein modifying the template file comprises modifying the template file using a customizable process based on the metadata.

5 . The method of claim 1 , wherein the modifying the template file comprises modifying the template file at a predefined place within the template file.

6 . The method of claim 5 , wherein the predefined place within the source code is customizable by a user.

7 . The method of claim 1 , wherein classifying one or more features of the extracted metadata comprises classifying one or more functions of the at least one unit based on the extracted metadata.

8 . The method of claim 1 , wherein the modifying the template file comprises modifying the template file at a predefined time for the template file.

9 . The method of claim 8 , wherein the predefined time is customizable by a user.

10 . A computing apparatus, the computing apparatus comprising:

at least one processor; and

a memory storing instructions that, when executed by the at least one processor, configure the apparatus to perform operations comprising:

executing one or more unit tests using the modified template file, wherein modifying the template file includes adding one or more component definitions and dependencies in the style identified from the source code analysis and modifying a template file based on classified features of extracted metadata that is from at least one unit of a software application, the at least one unit comprising source code as a result of source code analysis, the result of the source code analysis comprising: a style of the source code and whether a first component is a property-less component indicating a structural characteristic of the component lacking property data, the classified features of the extracted metadata including a fake dependency between the first component and a second component; and

wherein executing the one or more unit tests further comprises generating the fake dependency for the software application that uses an Application Programming Interface (API).

11 . The computing apparatus of claim 10 , wherein the metadata comprises one or more of imports of one or more software modules, component definitions, and features used by the at least one unit.

12 . The computing apparatus of claim 10 , the operations further comprising determining at least one syntax pattern in the source code and wherein modifying the template file comprises modifying the template file based on the at least one syntax pattern.

13 . The computing apparatus of claim 10 , wherein modifying the template file comprises modifying the template file using a customizable process based on the extracted metadata.

14 . The computing apparatus of claim 10 , wherein modifying the template file comprises modifying the template file at one or more of a predefined time and a predefined place within the template file.

15 . The computing apparatus of claim 14 , wherein one or both of the predefined time and the predefined place within the source code is customizable by a user.

16 . The computing apparatus of claim 10 , wherein classifying one or more features of the extracted metadata comprises classifying one or more functions of the at least one unit based on the extracted metadata.

17 . A non-transitory computer-readable storage medium including instructions that, when processed by a computer, configure the computer to perform operations comprising:

executing one or more unit tests using the modified template file, wherein modifying the template file includes adding one or more component definitions and dependencies in the style identified from the source code analysis and modifying a template file based on classified features of extracted metadata that is from at least one unit of a software application, the at least one unit comprising source code as a result of source code analysis, the result of the source code analysis comprising: a style of the source code and whether a first component is a property-less component indicating a structural characteristic of the component lacking property data, the classified features of the extracted metadata including a fake dependency between the first component and a second component; and

wherein executing the one or more unit tests further comprises generating the fake dependency for the software application that uses an Application Programming Interface (API).

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 18, 2022
From: TRAN, ADRIAN; WANG, SICHAO
To: SNAP INC.
Reel/Frame 060845/0022 →
Continuity (1)
Related Publication 20240061766A1 · Feb 22, 2024
References Cited (31)
US 5671415A · Hossain · 1997 [cited by examiner]
US 6954894B1 · Balnaves · 2005 [cited by examiner]
US 7518630B2 · Gaylord · 2009 [cited by applicant]
US 7548258B2 · Kaplinsky · 2009 [cited by applicant]
US 7646736B2 · Yang et al. · 2010 [cited by applicant]
US 7852948B2 · Suzuki · 2010 [cited by applicant]
US 8477173B2 · Kenoyer et al. · 2013 [cited by applicant]
US 8817870B2 · Zhang et al. · 2014 [cited by applicant]
US 8966556B2 · Sharp et al. · 2015 [cited by applicant]
US 8988486B2 · Golas · 2015 [cited by applicant]
US 9838329B2 · Sun et al. · 2017 [cited by applicant]
US 10257246B2 · Son et al. · 2019 [cited by applicant]
US 10545850B1 · Iyer · 2020 [cited by examiner]
US 10567765B2 · Marlatt et al. · 2020 [cited by applicant]
US 20070168946A1 · Drissi · 2007 [cited by examiner]
US 20070263077A1 · Dhuey et al. · 2007 [cited by applicant]
US 20110082721A1 · Arni · 2011 [cited by examiner]
US 20110239199A1 · Kim · 2011 [cited by examiner]
US 20120287088A1 · Queck · 2012 [cited by examiner]
US 20180091568A1 · Edgington, Jr. · 2018 [cited by examiner]
US 20210103514A1 · Das et al. · 2021 [cited by applicant]
CN 113778848 · 2021 [cited by applicant]
CN 113778848A · 2021 [cited by examiner]
CN 119731639A · 2025 [cited by applicant]
JP 2003203000A · 2003 [cited by examiner]
WO WO2024039986A1 · 2024 [cited by applicant]
Nan, CN-113778848 (Translated verion in English) Test code generating method, device, computer system and medium, Jan. 29, 2021. [cited by examiner]
“International Application Serial No. PCT US2023 071916, International Search Report mailed Nov. 27, 2023”, 4 pgs. [cited by applicant]
“International Application Serial No. PCT US2023 071916, Written Opinion mailed Nov. 27, 2023”, 7 pgs. [cited by applicant]
“International Application Serial No. PCT/US2023/071916, International Preliminary Report on Patentability mailed Feb. 27, 2025”, 9 pgs. [cited by applicant]
Zeunert, Matt, “Lazy JavaScript Parsing in V8”, [Online]. Retrieved from the Internet: <URL: https://web.archive.org/web/20220706202932/https://www.mattzeunert.com/2017/01/30/lazy-javascript-parsing-in-v8.html>, (Archiv… [cited by applicant]