IP Library › Granted Patent US 8,261,237
Granted Patent B2
US 8,261,237 · App. 12/217,711 · Granted Sep 4, 2012

Software tool for detecting plagiarism in computer source code

Assignee: Software Analysis and Forensic Engineering Corp.
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 8,261,237
App. No.
12/217,711
Granted
Sep 4, 2012
Kind
B2
Abstract

A method and system for detecting plagiarism of software source code. In one embodiment, a first set of arrays and a second set of arrays are created for a first program source code file and a second program source code file respectively. Each pair of arrays in the first and second sets has entries corresponding to program elements of a distinct program element type such as functional program code, program comments, or program code identifiers. Next, each pair of arrays from the first and second sets is compared to find similar entries, and an intermediate match score is calculated for each pair of arrays based on the similar entries. Further, the resulting intermediate match scores are combined to produce a combined match score, which is then used to provide an indication of copying with respect to the first program source code file and the second program source code file.

Claims (72)

1. A computer-implemented method comprising:

creating, by a computing device executing a detector, a first array based on a first program source code file including a plurality of program elements, the first array having entries corresponding to lines of functional program code from the first program source code file;

creating, by the computing device, a second array based on a second program source code file including a plurality of program elements, the second array having entries corresponding to lines of functional program code from the second program source code file;

comparing first words in entries of the first array with first words in entries of the second array while ignoring subsequent words in the entries of the first array and in the entries of the second array;

finding a longest sequence of similar entries between the first array and the second array based on the comparing of the first words in the entries of the first array with the first words in the entries of the second array;

calculating a match score based on a number of lines in the longest sequence; and

providing an indication of copying with respect to the first program source code file and the second program source code file, wherein the indication of copying is defined by the match score.

2. The method of claim 1 wherein providing an indication of copying with respect to the first program source code file and the second program source file comprises:

presenting a report identifying the first program source file and the second program source code file, and the match score calculated based on the comparison; and

allowing a user to select the match score to view the similar entries.

3. The method of claim 1 wherein the first and second arrays are created based on program dependent information.

4. A computer-implemented method comprising:

creating, by a computing device executing a detector, a first set of arrays based on a first program source code file including a plurality of program elements;

creating, by the computing device, a second set of arrays for a second program source code file;

comparing the arrays of the first set with the arrays of the second set to find similar entries;

calculating a plurality of intermediate match scores based on the similar entries, the plurality of intermediate match scores including a first intermediate match score calculated based on comparing a first array of the first set of arrays with a second array of the second set of arrays to find entries in the first array that contain similar first words as entries in the second array while ignoring subsequent words in the entries;

combining the plurality of intermediate match scores to produce a combined match score; and

providing an indication of copying with respect to the first program source code file and the second program source code file, wherein the indication of copying is defined by the combined match score.

5. The method of claim 4 wherein the plurality of intermediate match scores are combined using corresponding weights.

6. The method of claim 4 wherein providing an indication of copying with respect to the first program source code file and the second program source file comprises:

presenting a report identifying the first program source file and the second program source code file, and the match score calculated based on the comparison; and

allowing a user to select the match score to view the similar entries.

7. The method of claim 4 wherein the first and second sets of arrays are created based on program dependent information.

8. The method of claim 4 wherein calculating a second intermediate match score of the plurality of intermediate match scores comprises finding a number of matching lines in the first array and the second array.

9. The method of claim 8 wherein the first array is a first functional program code array and the second array is a second functional program code array, and wherein matching lines in the first functional program code array and the second functional program code array exclude lines consisting entirely of programming keywords.

10. The method of claim 4 , wherein calculating the plurality of intermediate match scores comprises calculating a second intermediate match score for a first program comments array of the first set of arrays and a second program comments array of the second set of arrays to find a number of matching comment lines in the first program comments array and the second program comments array.

11. The method of claim 4 wherein:

an array from the first set and an array from the second set have a program element type represented by program code identifiers;

at least some of the similar entries comprise similar program code identifiers; and

calculating an intermediate match score comprises computing a number of the similar program code identifiers.

12. The method of claim 11 wherein calculating an intermediate match score further comprises combining a number of alphabetical characters in the similar program code identifiers and a fraction of a number of numerical characters in the similar program code identifiers.

13. The method of claim 4 wherein the first array is a first functional program code array and the second array is a second functional program code array, and wherein:

comparing the first functional program code array with the second functional program code array comprises finding a longest sequence of similar entries, wherein at least some similar entries are different from one another but perform logically equivalent functions; and

calculating the first intermediate match score comprises finding a number of lines contained in the longest sequence.

14. The method of claim 13 , wherein an order of found entries in the first functional program code array corresponds to an order of entries with the similar first words in the second functional program code array.

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

creating, by a computing device executing a detector, a first set of arrays based on a first program source code file including a plurality of program elements;

creating, by the computing device, a second set of arrays for a second program source code file;

comparing the arrays of the first set with the arrays of the second set to find similar entries;

calculating a plurality of intermediate match scores based on the similar entries, the plurality of intermediate match scores including a first intermediate match score calculated based on comparing a first array of the first set of arrays with a second array of the second set of arrays to find entries in the first array that contain similar first words as entries in the second array while ignoring subsequent words in the entries;

combining the plurality of intermediate match scores to produce a combined match score; and

providing an indication of copying with respect to the first program source code file and the second program source code file, wherein the indication of copying is defined by the combined match score.

16. The computer-readable storage medium of claim 15 wherein the plurality of intermediate match scores are combined using corresponding weights.

17. The computer-readable storage medium of claim 15 wherein the first array is a first functional program code array and the second array is a second functional program code array, and wherein:

calculating a second intermediate match score comprises finding a number of matching lines of functional program code in the first functional program code array and the second functional program code array; and

calculating a third intermediate match score comprises finding a number of matching comment lines in a first program comments array of the first set of arrays and a second program comments array of the second set of arrays.

18. The computer-readable storage medium of claim 15 wherein:

an array from the first set and an array from the second set have a program element type represented by program code identifiers;

at least some of the similar entries comprise similar program code identifiers; and

calculating an intermediate match score comprises computing a number of the similar program code identifiers.

19. The method of claim 18 wherein calculating an intermediate match score further comprises combining a number of alphabetical characters in the similar program code identifiers and a fraction of a number of numerical characters in the similar program code identifiers.

20. The computer-readable storage medium of claim 15 wherein the first array is a first functional program code array and the second array is a second functional program code array, and wherein:

comparing the first functional program code array and the second functional program code array comprises finding a longest sequence of similar entries, wherein at least some similar entries are different from one another but perform logically equivalent functions; and

calculating the first intermediate match score comprises finding a number of lines contained in the longest sequence.

21. The computer-readable storage medium of claim 15 wherein providing an indication of copying with respect to the first program source code file and the second program source file comprises:

presenting a report identifying the first program source file and the second program source code file, and the match score calculated based on the comparison; and

allowing a user to select the match score to view the similar entries.

22. The computer-readable storage medium of claim 15 wherein the first and second sets of arrays are created based on program dependent information.

23. The computer-readable storage medium of claim 15 wherein calculating a second intermediate match score of the plurality of intermediate match scores comprises finding a number of matching lines in the first array and the second array.

24. The computer-readable storage medium of claim 23 wherein the first array is a first functional program code array and the second array is a second functional program code array, and wherein matching lines in the first functional program code array and the second functional program code array exclude lines consisting entirely of programming keywords.

25. The computer-readable storage medium of claim 15 wherein calculating the plurality of intermediate match scores comprises calculating a second intermediate match score for a first program comments array of the first set of arrays and a second program comments array of the second set of arrays to find a number of matching comment lines in the first program comments array and the second program comments array.

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

creating, by the computer system, a first array on a first program source code file including a plurality of program elements, the first array having entries corresponding to lines of functional program code from the first program source code file;

creating, by the computer system, a second array based on a second program source code file including a plurality of program elements, the second array having entries corresponding to lines of functional program code from the second program source code file;

comparing first words in entries of the first array with first words in entries of the second array while ignoring subsequent words in the entries of the first array and in the entries of the second array;

finding a longest sequence of similar entries between the first array and the second array based on the comparing of the first words in the entries of the first array with the first words in the entries of the second array;

calculating a match score based on a number of lines in the longest sequence; and

providing an indication of copying with respect to the first program source code file and the second program source code file, wherein the indication of copying is defined by the match score.

27. The computer-readable storage medium of claim 26 wherein providing an indication of copying with respect to the first program source code file and the second program source file comprises:

presenting a report identifying the first program source file and the second program source code file, and the match score calculated based on the comparison; and

allowing a user to select the match score to view the similar entries.

28. The computer-readable storage medium of claim 26 wherein the first and second arrays are created based on program dependent information.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 5, 2022
From: SOFTWARE ANALYSIS AND FORENSIC ENGINEERING CORPORATION
To: SAFE IP LLC
Reel/Frame 059830/0069 →
Continuity (2)
Continuation 10720636 · Nov 25, 2003
Related Publication 20080270991A1 · Oct 30, 2008