IP Library Granted Patent US 12,282,766
Granted Patent B2
US 12,282,766 · App. 18/282,486 · Granted Apr 22, 2025

Software composition analysis on target source code

Inventors: Jon Aldama (Malmö, SE); Daniel Åkerud (Staffanstorp, SE)
Assignee: Snyk Sweded AB
G06F8/71G06F8/51G06F21/577
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,282,766
App. No.
18/282,486
Granted
Apr 22, 2025
Kind
B2
Abstract

Embodiments perform software composition analysis of target source code. A first exploration process searches first software archives for first occurrences of the target source code among source code files, and for every found first occurrence of the target source code, collects a first set of information about matching source code files or snippets therein. A second exploration process searches second software archives (different from the first plurality of archives) for second occurrences of the target source code among source code snippets, and for every found second occurrence of the target source code, collects a second set of information about matching source code snippets. Each matching source code snippet among the matching source code snippets as collected in the second set of information is mapped to the matching source code files or snippets therein as collected in the first set of information. A software composition is determined based on the mapping.

Claims (40)

1. A computer-implemented method for performing software composition analysis of a target source code for a computer program or a part thereof to determine an origin associated with the target source code, the method involving:

performing a first exploration process, comprising:

searching a plurality of first software archives to find first occurrences of the target source code among source code files in the plurality of first software archives, wherein the plurality of first software archives are open source code archives originating from different sources in a global computer network, and

for every found first occurrence of the target source code, collecting a first set of key information about matching source code files or snippets therein; performing a second exploration process, comprising:

searching a plurality of second software archives originating from one or more sources in the global computer network, the plurality of second software archives being (i) different from the plurality of first software archives and (ii) Internet-based community-driven platform archives, to find second occurrences of the target source code among source code snippets in the second software archives, and

for every found second occurrence of the target source code, collecting a second set of key information about matching source code snippets;

mapping each matching source code snippet among the matching source code snippets as collected in the second set of key information to the matching source code files or snippets therein as collected in the first set of key information, wherein the mapping indicates whether an earlier version of said each matching source code snippet exists in the first set of key information; and

based on the mapped first set of key information and second set of key information, determining a software composition of the target source code, where the determined software composition indicates the origin associated with the target source code.

2. The computer-implemented method according to claim 1 , wherein if an earlier version of said matching source code snippet exists in the first set of key information, the mapping further involves filtering said matching source code snippet from the second set of key information.

3. The computer-implemented method according to claim 2 , wherein the filtering involves discarding, removing, hiding and/or down ranking said matching source code snippet from or in the second set of key information.

4. The computer-implemented method according to claim 1 , wherein the software composition is indicative of licenses, versions, vulnerabilities, comments, repositories, authors, file sizes, snippet sizes and/or resource locations associated with the target source code.

5. The computer-implemented method according to claim 1 , wherein the open source code archives are one of or a combination of Github, Gitlab, or Bitbucket archives.

6. The computer-implemented method according to claim 1 , wherein the Internet-based community-driven platform archives are one of or a combination of StackOverflow or other StackExchange platforms, Coderanch, Quora, Reddit, Google Groups, SitePoint, CodeProject, Google+Communities, Treehouse, Hacker News, DZone, Bytes, DaniWeb, Dream.In.Code, Pineapple, Lobsters, XDA Developers, CodeGuru, Programmers Heaven, FindNerd, Designers Talk, Hashnode or Mozzila Web Developer Community archives.

7. The computer-implemented method according to claim 1 , wherein the method further involves creating a virtual file tree of the software composition of the target source code.

8. The computer-implemented method according to claim 1 , wherein the method further involves an initial step of receiving a request for performing software composition analysis of the target source code.

9. The computer-implemented method according to claim 1 , wherein the method further involves compiling the software composition into a software composition analysis report, and returning said report.

10. The computer-implemented method according to claim 1 , wherein the first set of key information comprises one or more keywords from a plurality of attributes of the matching source code file or snippets therein and/or the first software archive in which it was found.

11. The computer-implemented method according to claim 1 , wherein the second set of key information comprises one or more keywords from a plurality of attributes of the matching source code snippets and/or the second software archive in which it was found.

12. The computer-implemented method according to claim 11 , wherein the plurality of attributes includes at least two of the following: an author, a repository name, a filename and a resource location of the matching source code file and/or the snippets and/or the software archive in which it was found.

13. The computer-implemented method according to claim 1 , wherein the plurality of first and/or second software archives originating from different sources in the global computer network are maintained in a local data repository.

14. An apparatus for performing software composition analysis of a target source code for a computer program or a part thereof to determine an origin associated with the target source code, the apparatus comprising a processing device being configured for:

performing a first exploration process, comprising:

searching a plurality of first software archives to find first occurrences of the target source code among source code files in the plurality of first software archives, wherein the plurality of first software archives are open source code archives from different sources in a global computer network, and

for every found first occurrence of the target source code, collecting a first set of key information about matching source code files or snippets therein; performing a second exploration process, comprising:

searching a plurality of second software archives from different sources in the global computer network, the plurality of second software archives being (i) different from the plurality of first software archives and (ii) Internet-based community-drive platform archives, to find second occurrences of the target source code among snippets in the second software archives, and

for every found second occurrence of the target source code, collecting a second set of key information about matching source code snippets;

mapping each matching source code snippet among the matching source code snippets as collected in the second set of key information to the matching source code files or snippets therein as collected in the first set of key information, wherein the mapping indicates whether an earlier version of said each matching source code snippet exists in the first set of key information; and

based on the mapped first set of key information and second set of key information, determining a software composition of the target source code, where the determined software composition indicates the origin associated with the target source code.

15. The apparatus as defined in claim 14 , wherein if an earlier version of said matching source code snippet exists in the first set of key information, the mapping further involves filtering said matching source code snippet from the second set of key information.

16. A computer program product for performing software composition analysis of a target source code for a computer program or a part thereof to determine an origin associated with the target source code, the computer program product executed by a server in communication across a network with one or more clients and comprising:

a non-transitory computer readable storage medium, the non-transitory computer readable storage medium having stored thereon program instructions, which, when executed by one or more processors, causes the one or more processors to:

perform a first exploration process, comprising:

searching a plurality of first software archives to find first occurrences of the target source code among source code files in the plurality of first software archives, wherein the plurality of first software archives are open source code archives originating from different sources in a global computer network, and

for every found first occurrence of the target source code, collecting a first set of key information about matching source code files or snippets therein;

perform a second exploration process, comprising:

searching a plurality of second software archives originating from one or more sources in the global computer network, the plurality of second software archives being (i) different from the plurality of first software archives and (ii) Internet-based community-driven platform archives, to find second occurrences of the target source code among source code snippets in the second software archives, and

for every found second occurrence of the target source code, collecting a second set of key information about matching source code snippets;

map each matching source code snippet among the matching source code snippets as collected in the second set of key information to the matching source code files or snippets therein as collected in the first set of key information, wherein the mapping indicates whether an earlier version of said each matching source code snippet exists in the first set of key information; and

based on the mapped first set of key information and second set of key information, determine a software composition of the target source code, where the determined software composition indicates the origin associated with the target source code.

17. A non-transitory computer readable storage medium having stored thereon a computer program comprising computer program code for performing the method according to claim 1 when the computer program code is executed by a processing device.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 11, 2024
From: ALDAMA, JON; ÅKERUD, DANIEL
To: FOSSID AB
Reel/Frame 066103/0001 →
CHANGE OF NAME Recorded Jan 11, 2024
From: FOSSID AB
To: SNYK SWEDEN AB
Reel/Frame 066285/0194 →
Continuity (3)
Continuation 17207238 · Mar 19, 2021
Related Publication 20240134636A1 · Apr 25, 2024
Related Publication 20240231808A9 · Jul 11, 2024
References Cited (25)
US 7565410B2 · Stickler · 2009 [cited by examiner]
US 8307351B2 · Weigert · 2012 [cited by examiner]
US 8359655B1 · Pham · 2013 [cited by examiner]
US 8688676B2 · Rush · 2014 [cited by examiner]
US 9274803B2 · De Meno · 2016 [cited by examiner]
US 10936225B1 · Eddey · 2021 [cited by examiner]
US 11099842B2 · Alomari · 2021 [cited by applicant]
US 11500990B2 · Åkerud · 2022 [cited by examiner]
US 11836486B2 · Lee · 2023 [cited by examiner]
US 20100198843A1 · Sirota · 2010 [cited by examiner]
US 20100242028A1 · Weigert · 2010 [cited by examiner]
US 20130067449A1 · Sannidhanam · 2013 [cited by examiner]
US 20160140141A1 · Darcy · 2016 [cited by examiner]
US 20170011058A1 · Gheith · 2017 [cited by examiner]
US 20170109137A1 · Subramanian · 2017 [cited by examiner]
US 20170286095A1 · Grabska · 2017 [cited by examiner]
US 20170357486A1 · DeLuca · 2017 [cited by examiner]
US 20190278931A1 · Tobias · 2019 [cited by examiner]
US 20200082078A1 · Boulton · 2020 [cited by examiner]
US 20200218535A1 · Alomari · 2020 [cited by applicant]
US 20200304574A1 · Gupta · 2020 [cited by examiner]
US 20200394588A1 · Sanchez · 2020 [cited by examiner]
US 20220300277A1 · Aldama et al. · 2022 [cited by applicant]
WO 2022195103A1 · 2022 [cited by applicant]
International Search Report and Written Opinion for PCT/EP2022/057228, dated Sep. 8, 2022. [cited by applicant]