Identifying differences between source codes of different versions of a software when each source code is organized using incorporated files
First Claim
1. A method of identifying differences between source codes when each source code is organized using incorporated files, said method comprising:
- receiving identifiers of a first source code and a second source code, said first source code being organized as a first plurality of code files and said second source code being organized as a second plurality of code files,wherein said first source code contains a first conditional incorporate statement having a first condition, said first conditional incorporate statement indicating that a first code file of said first plurality of code files is to be incorporated when said first condition is true and a second code file of said first plurality of code files is to be incorporated when said first condition is false,wherein said second source code contains a second conditional incorporate statement also having said first condition, said second conditional incorporate statement indicating that a third code file of said second plurality of code files is to be incorporated when said first condition is true and a fourth code file of said second plurality of code files is to be incorporated when said first condition is false;
constructing a first listing of instructions for said first source code and a second listing of instructions for said second source code, wherein said constructing said first listing comprises including, for each incorporate statement in said first plurality of code files, the instructions stored in a corresponding one of said first plurality of code files as specified by the corresponding incorporate statement,wherein said constructing, in response to said first conditional incorporate statement, includes the instructions stored in both of said first code file and said second code file respectively as a first code portion and a second code portion in said first listing of instructions without evaluation of said first condition,wherein said constructing said second listing comprises including, for each incorporate statement in said second plurality of code files, the instructions stored in a corresponding one of said second plurality of code files as specified by the corresponding incorporate statement,wherein said constructing, in response to said second conditional incorporate statement, includes the instructions stored in both of said third code file and said fourth code file respectively as a third code portion and a fourth code portion in said second listing of instructions without evaluation of said first condition; and
finding the differences between said first source code and said second source code by comparing said first listing of instructions and said second listing of instructions,wherein said comparing compares the instructions in said first code portion with instructions in said third code portion in view of both of said first code portion and said third code portion being present in said first listing and said second listing corresponding to said first condition being true, and compares the instructions in said second code portion with instructions in said fourth code portion in view of both of said second code portion and said fourth code portion being present in said first listing and said second listing corresponding to said first condition being false.
1 Assignment
0 Petitions
Accused Products
Abstract
An aspect of the present invention identifies differences between source codes (e.g. of different versions of a software), when each source code is organized using incorporated files. In one embodiment, in response to receiving identifiers of a first and second source codes (each source code being organized as a corresponding set of code files), listings of the instructions in the first and second source codes are constructed. Each listing is constructed, for example, by replacing each incorporate statement in the source code with instructions stored in a corresponding one of code files. The differences between the first and second source codes are then found by comparing the constructed listings of instructions.
-
Citations
16 Claims
-
1. A method of identifying differences between source codes when each source code is organized using incorporated files, said method comprising:
-
receiving identifiers of a first source code and a second source code, said first source code being organized as a first plurality of code files and said second source code being organized as a second plurality of code files, wherein said first source code contains a first conditional incorporate statement having a first condition, said first conditional incorporate statement indicating that a first code file of said first plurality of code files is to be incorporated when said first condition is true and a second code file of said first plurality of code files is to be incorporated when said first condition is false, wherein said second source code contains a second conditional incorporate statement also having said first condition, said second conditional incorporate statement indicating that a third code file of said second plurality of code files is to be incorporated when said first condition is true and a fourth code file of said second plurality of code files is to be incorporated when said first condition is false; constructing a first listing of instructions for said first source code and a second listing of instructions for said second source code, wherein said constructing said first listing comprises including, for each incorporate statement in said first plurality of code files, the instructions stored in a corresponding one of said first plurality of code files as specified by the corresponding incorporate statement, wherein said constructing, in response to said first conditional incorporate statement, includes the instructions stored in both of said first code file and said second code file respectively as a first code portion and a second code portion in said first listing of instructions without evaluation of said first condition, wherein said constructing said second listing comprises including, for each incorporate statement in said second plurality of code files, the instructions stored in a corresponding one of said second plurality of code files as specified by the corresponding incorporate statement, wherein said constructing, in response to said second conditional incorporate statement, includes the instructions stored in both of said third code file and said fourth code file respectively as a third code portion and a fourth code portion in said second listing of instructions without evaluation of said first condition; and finding the differences between said first source code and said second source code by comparing said first listing of instructions and said second listing of instructions, wherein said comparing compares the instructions in said first code portion with instructions in said third code portion in view of both of said first code portion and said third code portion being present in said first listing and said second listing corresponding to said first condition being true, and compares the instructions in said second code portion with instructions in said fourth code portion in view of both of said second code portion and said fourth code portion being present in said first listing and said second listing corresponding to said first condition being false. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. A non-transitory machine readable medium storing one or more sequences of instructions for causing a system to identify differences between source codes when each source code is organized using incorporated files, wherein execution of said one or more instructions by one or more processors contained in said system causes said system to perform the actions of:
-
receiving identifiers of a first source code and a second source code, said first source code being organized as a first plurality of code files and said second source code being organized as a second plurality of code files, wherein said first source code contains a first conditional incorporate statement having a first condition, said first conditional incorporate statement indicating that a first code file of said first plurality of code files is to be incorporated when said first condition is true and a second code file of said first plurality of code files is to be incorporated when said first condition is false, wherein said second source code contains a second conditional incorporate statement also having said first condition, said second conditional incorporate statement indicating that a third code file of said second plurality of code files is to be incorporated when said first condition is true and a fourth code file of said second plurality of code files is to be incorporated when said first condition is false; constructing a first listing of instructions for said first source code and a second listing of instructions for said second source code, wherein said constructing said first listing comprises including, for each incorporate statement in said first plurality of code files, the instructions stored in a corresponding one of said first plurality of code files as specified by the corresponding incorporate statement, wherein said constructing, in response to said first conditional incorporate statement, includes the instructions stored in both of said first code file and said second code file respectively as a first code portion and a second code portion in said first listing of instructions without evaluation of said first condition, wherein said constructing said second listing comprises including, for each incorporate statement in said second plurality of code files, the instructions stored in a corresponding one of said second plurality of code files as specified by the corresponding incorporate statement, wherein said constructing, in response to said second conditional incorporate statement, includes the instructions stored in both of said third code file and said fourth code file respectively as a third code portion and a fourth code portion in said second listing of instructions without evaluation of said first condition; and finding the differences between said first source code and said second source code by comparing said first listing of instructions and said second listing of instructions, wherein said comparing compares the instructions in said first code portion with instructions in said third code portion in view of both of said first code portion and said third code portion being present in said first listing and said second listing corresponding to said first condition being true, and compares the instructions in said second code portion with instructions in said fourth code portion in view of both of said second code portion and said fourth code portion being present in said first listing and said second listing corresponding to said first condition being false. - View Dependent Claims (11, 12, 13, 14)
-
-
15. A digital processing system comprising:
-
a processor; a random access memory (RAM); a machine readable medium to store one or more instructions, which when retrieved into said RAM and executed by said processor causes said digital processing system to identify differences between source codes when each source code is organized using incorporated files, said digital processing system performing the actions of; receiving identifiers of a first source code and a second source code, said first source code being organized as a first plurality of code files and said second source code being organized as a second plurality of code files, wherein said first source code contains a first conditional incorporate statement having a first condition, said first conditional incorporate statement indicating that a first code file of said first plurality of code files is to be incorporated when said first condition is true and a second code file of said first plurality of code files is to be incorporated when said first condition is false, wherein said second source code contains a second conditional incorporate statement also having said first condition, said second conditional incorporate statement indicating that a third code file of said second plurality of code files is to be incorporated when said first condition is true and a fourth code file of said second plurality of code files is to be incorporated when said first condition is false; constructing a first listing of instructions for said first source code and a second listing of instructions for said second source code, wherein said constructing said first listing comprises including, for each incorporate statement in said first plurality of code files, the instructions stored in a corresponding one of said first plurality of code files as specified by the corresponding incorporate statement, wherein said constructing, in response to said first conditional incorporate statement, includes the instructions stored in both of said first code file and said second code file respectively as a first code portion and a second code portion in said first listing of instructions without evaluation of said first condition, wherein said constructing said second listing comprises including, for each incorporate statement in said second plurality of code files, the instructions stored in a corresponding one of said second plurality of code files as specified by the corresponding incorporate statement, wherein said constructing, in response to said second conditional incorporate statement, includes the instructions stored in both of said third code file and said fourth code file respectively as a third code portion and a fourth code portion in said second listing of instructions without evaluation of said first condition; and finding the differences between said first source code and said second source code by comparing said first listing of instructions and said second listing of instructions, wherein said comparing compares the instructions in said first code portion with instructions in said third code portion in view of both of said first code portion and said third code portion being present in said first listing and said second listing corresponding to said first condition being true, and compares the instructions in said second code portion with instructions in said fourth code portion in view of both of said second code portion and said fourth code portion being present in said first listing and said second listing corresponding to said first condition being false. - View Dependent Claims (16)
-
Specification