IP Library › Granted Patent US 9,003,366
Granted Patent B2
US 9,003,366 · App. 12/871,808 · Granted Apr 7, 2015

Detecting plagiarism in computer source code

Inventor: Robert Marc Zeidman (Cupertino, CA)
Assignee: Software Analysis and Forensic Engineering Corporation
G06F21/105G06F8/751G06F8/73G06F17/2211G06Q10/10
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 9,003,366
App. No.
12/871,808
Granted
Apr 7, 2015
Kind
B2
Abstract

Plagiarism is detected by comparing statements within source code of a first program to comments within source code of a second program.

Claims (41)

1. A computer-implemented method comprising:

creating, by a computer system, a first array of lines of functional program code from a first program source code file, the first program source code file including the lines of functional program code of a first program and lines of non-functional comments of the first program;

creating, by the computer system, a second array of lines of non-functional comments from a second program source code file, the second program source code file including lines of functional program code of a second program and lines of non-functional comments of the second program, wherein the second array of non-functional comments is created using a predefined list of special characters to determine the beginning and end of comments in the second program source code file;

calculating, by the computer system, a code-to-comment similarity number based on performing a comparison of the lines of functional program code from the first array with the lines of non-functional comments from the second array to find instances of similarity, wherein calculating the code-to-comment similarity number comprises finding a number of matching functional program code statements in the first array and non-functional comments in the second array indicating that the non-functional comments of the second program source code file contain functional program code of the first program source code file; and

presenting to a user an indication of disguised copying of the first program source code file wherein said indication of disguised copying is defined by the similarity number.

2. The method of claim 1 wherein:

calculating the code-to-comment similarity number comprises finding a number of matching lines in the first and second arrays weighted by the number of characters in the matching lines.

3. The method of claim 1 wherein:

calculating the code-to-comment similarity number comprises finding a number of lines in the first and second arrays that have an edit distance less than a given threshold.

4. The method of claim 1 , further comprising:

detecting a selection of a programming language for a second program source code file, wherein the predefined list is selected by the computer system in response to the selected programming language.

5. The method of claim 1 , wherein:

creating the second array of lines of non-functional comments includes removing the special characters from the beginning or end of the non-functional comments from the second program source code file.

6. A non-transitory computer-readable storage medium storing executable instructions to cause a computer system to perform a method comprising:

creating a first array of lines of functional program code from a first program source code file, the first program source code file including the lines of functional program code of a first program and lines of non-functional comments of the first program;

creating a second array of lines of non-functional comments from a second program source code file, the second program source code file including lines of functional program code of a second program and lines of non-functional comments of the second program, wherein the second array of non-functional comments is created using a predefined list of special characters to determine the beginning and end of comments in the second program source code file;

calculating a code-to-comment similarity number based on performing a comparison of the lines of functional program code from the first array with the lines of non-functional comments from the second array to find instances of similarity, wherein calculating the code-to-comment similarity number comprises finding a number of matching functional program code statements in the first array and non-functional comments in the second array indicating that the non-functional comments of the second program source code file contain functional program code of the first program source code file; and

presenting to a user an indication of disguised copying of the first program source code file wherein said indication of disguised copying is defined by the similarity number.

7. The computer-readable storage medium of claim 6 wherein:

calculating the code-to-comment similarity number comprises finding a number of matching lines in the first and second arrays weighted by the number of characters in the matching lines.

8. The computer-readable storage medium of claim 6 wherein:

calculating the code-to-comment similarity number comprises finding a number of lines in the first and second arrays that have an edit distance less than a given threshold.

9. The computer-readable storage medium of claim 6 , the method further comprising:

detecting a selection of a programming language for a second program source code file, wherein the predefined list is selected by the computer system in response to the selected programming language.

10. The computer-readable storage medium of claim 6 , wherein:

creating the second array of lines of non-functional comments includes removing the special characters from the beginning or end of the non-functional comments from the second program source code file.

11. A computer-implemented apparatus comprising:

a computer; and

a source code matching program on the computer, wherein execution of the source code matching program causes the computer to perform a method comprising:

creating a first array of lines of functional program code from a first program source code file, the first program source code file including the lines of functional program code of a first program and lines of non-functional comments of the first program;

creating a second array of lines of non-functional comments from a second program source code file, the second program source code file including lines of functional program code of a second program and lines of non-functional comments of the second program, and wherein the second array of non-functional comments is created using a predefined list of special characters to determine the beginning and end of comments in the second program source code file;

calculating a code-to-comment similarity number based on performing a comparison of the lines of functional program code from the first array with the lines of non-functional comments from the second array to find instances of similarity, wherein calculating the code-to-comment similarity number comprises finding a number of matching functional program code statements in the first array and non-functional comments in the second array indicating that the non-functional comments of the second program source code file contain functional program code of the first program source code file; and

presenting to a user an indication of disguised copying of the first program source code file wherein said indication of disguised copying is defined by the similarity number.

12. The apparatus of claim 11 wherein:

calculating the code-to-comment similarity number comprises means for finding a number of matching lines in the first and second arrays weighted by the number of characters in the matching lines.

13. The apparatus of claim 11 wherein:

calculating the code-to-comment similarity number comprises finding a number of lines in the first and second arrays that have an edit distance less than a given threshold.

14. The apparatus of claim 11 , the method further comprising:

detecting a selection of a programming language for a second program source code file, wherein the predefined list is selected by the computer system in response to the selected programming language.

15. The apparatus of claim 11 , wherein:

creating the second array of lines of non-functional comments includes removing the special characters from the beginning or end of the non-functional comments from the second program source code file.

Assignments (3)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 5, 2022
From: SOFTWARE ANALYSIS AND FORENSIC ENGINEERING CORPORATION
To: SAFE IP LLC
Reel/Frame 059830/0069 →
CORRECTIVE ASSIGNMENT TO CORRECT THE SPELLING OF ASSIGNEE NAME PREVIOUSLY RECORDED AT REEL: 031483 FRAME: 0538. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT. Recorded Mar 4, 2015
From: ZEIDMAN, ROBERT M.
To: SOFTWARE ANALYSIS AND FORENSIC ENGINEERING CORPORATION
Reel/Frame 035128/0351 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 25, 2013
From: ZEIDMAN, ROBERT M.
To: SOFTWARE ANALYSIS AND FORENSIC ENGINEERING CO
Reel/Frame 031483/0538 →
Continuity (3)
Continuation 12330492 · Dec 8, 2008
Continuation In Part 10720636 · Nov 25, 2003
Related Publication 20100325614A1 · Dec 23, 2010