EP2652621A1 - Intelligent code differencing using code clone detection - Google Patents
Intelligent code differencing using code clone detectionInfo
- Publication number
- EP2652621A1 EP2652621A1 EP10860883.7A EP10860883A EP2652621A1 EP 2652621 A1 EP2652621 A1 EP 2652621A1 EP 10860883 A EP10860883 A EP 10860883A EP 2652621 A1 EP2652621 A1 EP 2652621A1
- Authority
- EP
- European Patent Office
- Prior art keywords
- code
- versions
- source code
- importance
- function
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/75—Structural analysis for program understanding
- G06F8/751—Code clone detection
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
- G06F8/62—Uninstallation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
- G06F8/63—Image based installation; Cloning; Build to order
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Definitions
- the subject disclosure generally relates to code differencing, or
- a common task of code review is to be able to ascertain and appreciate the changes between a previous version of source code and a current version of source code.
- Conventional code differencing, or doffing, systems merely identify changes in source code or between versions of source code. These systems typically provide basic information, such as where there are added and/or deleted lines in one source file.
- a code reviewer reviewing the results of a conventional diffing system is therefore without intuitive or other descriptive information upon which to focus on the nature of the changes to the files, e.g., whether semantic or lexical changes have occurred.
- Various embodiments as provided herein are targeted for integrated development environments (IDEs) wherein code clone detection technology can be employed.
- Various embodiments are also targeted for systems and techniques employing code clone detection methods.
- the code clone detection technology can be employed as a preliminary step in generating semantic information that is output to a code reviewer.
- Other environments and contexts that can benefit from the differencing techniques described herein are contemplated too.
- Various embodiments employ code clone detection technology to generate semantic information about changes between versions of code.
- the semantic information can be a characterization of the change between the versions.
- the characterization can be output to the code reviewer and thereby aids software development generally, and code review processes, in particular.
- information can be output to the developer to review changes made by the developer him/herself and therefore embodiments described herein can aid in self- review of changes previously-entered by the developer and/or review of changes entered by third-parties and merely reviewed by the developer.
- visualization information can be generated such as architectural diagram or color coded information to display information about the changes between versions.
- the visualization information is output to a code reviewer for visually aiding the understanding of the changes.
- clone detection core and an importance engine in some embodiments.
- the clone detection component, or core is configured to generate information indicative of a determination of a type of content change between at least two versions of source code.
- the importance engine is configured to determine a level of importance associated with the type of the content change, and output information indicative of the level of importance.
- the level of importance is related to the characterization of the change in some embodiments. In other embodiments, the level of importance is related to the type of change, e.g., whether a format, lexical or logical change.
- the level of importance can be expressed as a value, e.g., integer, fraction, percentage, etc., or as a visualization, e.g., color coding.
- Figure 1 is a block diagram showing an exemplary non-limiting implementation of an intelligent code diffing system in accordance with one or more embodiments
- Figure 2 is another block diagram showing an exemplary non-limiting implementation of an intelligent code diffing system in accordance with one or more embodiments
- Figure 3 is another block diagram showing an exemplary non-limiting implementation of an intelligent code diffing system in accordance with one or more embodiments
- Figure 4 is a flow diagram illustrating an exemplary non-limiting process for intelligent code diffing using code clone detection technology
- Figure 5 is another flow diagram illustrating an exemplary non- limiting process for intelligent code diffing using code clone detection technology
- Figure 6 is another flow diagram illustrating an exemplary non- limiting process for intelligent code diffing using code clone detection technology
- Figure 7 is another flow diagram illustrating an exemplary non- limiting process for intelligent code diffing using code clone detection technology
- Figure 8 is a block diagram illustrating an exemplary non-limiting screenshot for intelligent code diffing using code clone detection technology
- Figure 9 is another block diagram illustrating an exemplary non- limiting screenshot for intelligent code diffing using code clone detection technology
- Figure 10 is another block diagram illustrating an exemplary non- limiting screenshot for intelligent code diffing using code clone detection technology
- Figure 11 is another block diagram illustrating an exemplary non- limiting screenshot for intelligent code diffing using code clone detection technology
- Figure 12 is another block diagram illustrating an exemplary non- limiting screenshot for intelligent code diffing using code clone detection technology
- Figure 13 is a block diagram showing an exemplary non-limiting implementation of a system architecture for implementing intelligent code diffing using code clone detection technology
- Figure 14 is a block diagram representing exemplary non-limiting networked environments in which various embodiments described herein can be implemented.
- Figure 15 is a block diagram representing an exemplary non-limiting computing system or operating environment in which one or more aspects of various embodiments described herein can be implemented.
- code cloning Reusing a portion of source code with or without some degree of modifications or adaptations is called “code cloning” and the resulting portions of code that match, or correspond, to one another with varying degrees of exactness, are called “code clones” or more simply, “clones.”
- code base a group of one or more files of source code used to build a particular functionality, component or application is reused with or without some degree of modification within or between the files.
- code base While the term “code” is used herein for consistency, it should be understood that the term can apply to a "code base” where applicable.
- Code clone detection technology addresses the problem of identifying and analyzing code clones in source code, or across files of source code.
- Typical code clone detection systems receive source code, pre-process the text of the source code to break lines into tokens and remove non-essential differences, and analyze the remaining code for similarities.
- Code diffing systems typically generate information about differences between two source code files. For example, differences between two source code files can be output. However, these systems typically output only basic information such as information describing lines that have been added or deleted.
- Various embodiments as provided herein are targeted for integrated development environments (IDEs) wherein code clone detection technology can be employed.
- Various embodiments are also targeted for systems and techniques employing code clone detection methods.
- the code clone detection technology can be employed as a preliminary step in generating semantic information that is output to a code reviewer.
- a method of performing intelligent source code processing employing code clone detection technology comprises receiving at least two versions of source code; and processing the versions of the source code using code clone detection technology. Based on the code clone detection technology, a determination can be made as to different portions of the versions that correspond to one another.
- Systems and methods described herein employ code clone detection technology to generate semantic information about changes between versions of code.
- the semantic information is a characterization of the change between the versions.
- the characterization is output to the code reviewer and thereby significantly aids software development generally, and the code review process, in particular.
- a method of performing intelligent source code processing employing code clone detection technology comprises receiving information indicative of a correspondence between at least two versions of source code. A characterization of the correspondence between the versions is determined. The characterization is indicative of a semantic difference between the versions, and is based on the correspondence. The information indicative of the characterization is output. In some embodiments, the information is output to a software development station that may be accessed by a code reviewer.
- the systems and methods also generate visualization information such as architectural diagram or color coded information to display information about the changes between versions.
- the visualization information is output to a code reviewer for visually aiding the understanding of the changes.
- other systems and methods described herein generate information indicative of a level of importance to one or more changes between versions of the code.
- the level of importance is related to the characterization of the change in some embodiments.
- the level of importance is related to the type of change (e.g., whether a format, lexical or logical change, for example).
- the level of importance can be expressed as a value (e.g., integer, fraction, percentage) or as a visualization (e.g., color coding).
- a method of performing intelligent source code processing employing code clone detection technology comprises generating information indicative of a determination of a type of content change between at least two versions of source code. A level of importance associated with the type of the content change is determined. Information indicative of the level of importance is output. In some embodiments, a visualization of the level of importance of the change is output. The output can be provided to a software development station accessible by a code reviewer.
- FIG. 1 is a block diagram showing an exemplary non-limiting implementation of an intelligent code differencing system 102.
- code differencing system 102 is associated with one or more code base storage repositories 104, 106.
- code base storage repositories 104, 106 store one or more code bases.
- code base storage repository 104 stores a first version of source code while code base storage repository 106 stores a second version of source code.
- a first version of source code 110 and a second version of source code 120 can be received by the code differencing system 102 from code base storage repositories 104, 106.
- the code bases need not be so stored and, for example, both versions of code bases can be stored in and received from the same code base storage repository 104 or 106.
- versions of source code is indicated as two in some embodiments, different numbers of versions of source code can be processed simultaneously or concurrently in some non-limiting embodiments. For example, three or more versions of source code can be processed concurrently or sequentially using the systems and methods described herein.
- versions of source code can be generated as a result of different types of processes.
- the two versions of source code can be the same source code that has been processed in two different branches by different developers.
- the two versions of source code can be a first version of source code created at time, t, and a second version of source code created by modifying the first version of source code at a time, t+x.
- a first version of source code could be created and a second version of source code could be later created based on modifying the first version to address bugs in source code or to provide other enhancements.
- Code differencing system 102 includes a pre-processor 130 configured to pre-process the first and second versions of the source code 110, 120 to prepare the source code for code clone detection.
- the first and second versions of source code 110, 120 can be received by the code differencing system 102 and the pre-processor 130 can break lines into tokens and remove non-essential differences between the versions of source code 110, 120.
- Code differencing system 102 includes a code clone detection core 140.
- the code clone detection core 140 can perform the functions of code clone detection and processing.
- the code clone detection that is performed is as described in U. S. patent application number 12/752,942, filed April 1 , 2010, and entitled "CODE-CLONE DETECTION AND ANALYSIS," which is herein incorporated by reference in its entirety, though for the avoidance of doubt, the various embodiments described herein are not limited to any particular code clone detection technology.
- the only requirement to a particular code clone detection technology is being able to detect both exact code clones and near-miss code clones.
- Near-miss code clones are those wherein further modifications such as add, delete and/or edit are performed on the source code after duplication.
- code clone detection includes identifying one or more portions within the two versions of source code that are similar to one another. As such, the code clone detection can detect portions that are not the same as one another and that are merely similar to one another.
- the code clone detection core 140 is configured to identify code that has varying degrees of similarity. As such, the code clone detection core 140 is able to detect portions, e.g., snippets, of code within the versions of code that are different but similar.
- portions that are similar to one another are portions that are modified relative to one another with a deleted code snippet or function, a new code snippet or function, a duplicated code snippet or function, a moved function, a renamed function, a combination of moved and renamed function, a modified function or the like.
- identifying the similar pieces of code includes outputting two code snippets, one code snippet from each of the versions of code.
- identifying the similar pieces of code can include outputting information indicative of a location or description of the two code snippets within the two pieces of code.
- similar pieces of code or location or other information identifying the similar pieces of code
- the similar pieces of code or location or other information identifying the similar pieces of code is output to a software development station 150.
- the software development station 150 is located proximate to the code differencing system 102. In other embodiments, the software development station 150 is located remote from the code differencing system 102.
- the code differencing system 102 is associated with a server and the software development station 150 is associated with a client machine that accesses the code differencing system 102 over a network.
- the detected code snippets can be analyzed by a code reviewer accessing the software development station 150 to enable the code reviewer to focus on the portions of the versions of code that has been changed. In large code bases or large files of code, the ability to focus on a selected portion can significantly reduce the outlay of time and resources.
- the code clone detection core 140 is also configured, to generate a value corresponding to the degree of similarity between the two versions of source code 110, 120.
- the value may be an integer, fraction or percentage value.
- Fig. 2 is another block diagram showing an exemplary non-limiting implementation of an intelligent code differencing system 202.
- code differencing system 202 includes a pre-processor 130 and code clone detection core 140.
- the code differencing system 202 receives first and second versions of source code 110, 120.
- the first and second versions of source code 110, 120 are received from the code base storage repositories 104, 106.
- the code differencing system 202 also includes a characterization engine 210 determine a correspondence between the two versions of source code 110, 120.
- the correspondence is indicative of the change between the two versions of source code 110, 120, and is associated with a characterization.
- the characterization includes semantic information about the changes between the two versions of source code 110, 120.
- the code clone detection core 140 identifies similar portions of the source code and output such information to the characterization engine 210.
- the characterization engine 210 abstracts that information to extract semantic meaning describing the change between the two codes. The semantic meaning is described by the characterization, which is output from the characterization engine 210.
- the different characterizations are new code snippets or functions (e.g., a new code snippet or function is added in one version of code relative to the other version of code is the change); duplicated code snippet or function (e.g., a new code snippet or function is duplicated by copy-and-paste); a deleted code snippet or function (e.g., a function is deleted in one version of code relative to the other version of code); a moved function (e.g., a function is moved from the source file for one version of code to the source file for the other version of code); a renamed function (e.g., a signature is changed in the code but the content has not changed); or a modified function (e.g., a signature is the same but the content has changed).
- a new code snippet or functions e.g., a new code snippet or function is added in one version of code relative to the other version of code is the change
- duplicated code snippet or function
- the above six characterizations are output from the code differencing system 202 to the software development station 150.
- the characterization engine 210 can therefore provide semantic information to the software development station 150 (and code reviewer accessing such software development station 150) about what type of change occurred between the first and second versions of source code 110, 120 as opposed to merely providing the code reviewer with the changes and requiring the code reviewer to assess the type of changes that occurred.
- the code review experience is therefore improved and made more efficient.
- the 202 also includes a visualization engine 220.
- the visualization engine 220 generates a visualization of the characterization.
- the visualization is a file describing the characterization, an architectural diagram graphically displaying the changes between the versions of source code 110, 120 or the characterization, and/or a color-coded listing of functions associated with the changes between the first and second versions of source code 110, 120 identified by the code clone detection core 140.
- Information indicative of the characterization and/or the visualization of the characterization is output to the software development station 150 from the characterization engine 210 and/or the visualization engine 220, respectively.
- Fig. 3 is another block diagram showing exemplary non-limiting implementation of an intelligent code differencing system 302.
- code differencing system 302 includes a pre-processor 130 and code clone detection core 140.
- the code differencing system 302 receives first and second versions of source code 110, 120.
- the first and second versions of source code 110, 120 are received from the code base storage repositories 104, 106.
- code differencing system 302 includes a characterization engine 210 and, in some embodiments, a visualization engine 220. As shown in Fig. 3, code differencing system 302 also includes an importance engine 310 configured to associate a level of importance with the type of content change between the two versions of source code 110, 120 and/or based on a characterization generated by the characterization engine 210.
- the level of importance is mapped from the associated characterization.
- a moved function can be a characterization that is then mapped to a trivial level of importance change, thereby being assigned the lowest level of importance.
- a renamed function can be mapped to a minor change, thereby being assigned a moderate level of importance.
- the modified function can be mapped to a major change, thereby being assigned the greatest level of importance.
- level of importance information can be provided for duplicated code snippet or function, moved function, renamed function or modified function characterizations.
- the level of importance can be generated based on the type of content change from the first to the second versions of the source code 110, 120.
- the type of content change is a format change or a comment change.
- Format and comment changes can be associated with a trivial level of change and therefore assigned the lowest level of importance.
- the type of content change is a lexical change
- Lexical changes can be associated with a moderate level of change and therefore assigned a moderate level of importance.
- the type of content change is a logical change.
- a logical change can be associated with a major level of change, and therefore assigned a highest level of importance.
- the level of importance is determined based on assigning a numeric (e.g., percentage or otherwise) value to the type of the content change and categorizing the level of importance according to the numeric value. For example, a value of a 5% change would represent a trivial change, which would be assigned the lowest level of importance, while a value of a 50% (or more) change would be a major change, which would be assigned the greatest level of importance. Additionally, in various embodiments, the value (e.g., the 5% value above) is utilized in conjunction with other code metrics to further enhance to ability to communicate the importance of a change.
- the relative importance of the actual portion of the code that has changed can be communicated by placing a value on a code metric associated with the portion of the code and/or by selecting a particular metric, value of a metric, importance level of a metric, etc. to communicate the importance of the portion of the code that has changed.
- the level of importance is output from the importance engine 310 to the software development station 150.
- the visualization engine 220 receives information about the level of importance generated by the importance engine 310, and generates and outputs the level of importance as a visual representation.
- Fig. 4 is a flow diagram illustrating an exemplary non-limiting process for performing intelligent code diffing using code clone detection technology.
- At 400 at least two versions of source code are received at the intelligent code diffing system.
- the two versions of source code are processed using code clone detection technology, and similar pieces of source code are identified.
- the code clone detection technology is configured to identify source code that has varying degrees of similarity. As such, the code clone detection technology is able to detect snippets of source code that are different but that are similar.
- identifying the similar pieces of source code includes outputting two source code snippets, one source code snippet from each of the versions of source code.
- identifying the similar pieces of source code can include outputting information indicative of a location or description of the two source code snippets within the two pieces of source code.
- the source code snippets (or information indicative of the location or description of the source code snippets) are processed by the code diffing system. Semantic analysis on the similar pieces of source code is performed to determine a characterization of the differences between the two pieces of source code.
- Step 420 is described in greater detail in one non-limiting embodiment as follows.
- P; [SAi, SB;]
- SA is one code snippet (or function) from one version of source files
- SB is one code snippet (or function) of another version of source files.
- S A and SB are near-miss cloned functions, they will be further categorized as follows: if their signatures are different and have the same body content, then they are characterized as renamed functions. If their body content are different, but have the same signature, then they are characterized as modified functions. Further, if they have different location context, then they are characterized as moved functions. If they have further different body content, they are characterized as moved and modified functions.
- code snippets and functions that are not in the list of set ⁇ Pi ⁇ are further analyzed to get deleted and/or added code snippets or functions.
- the deleted and/or added code snippets or functions are further searched against 13213 (e.g., with an index of a local code base) or 1334 (e.g., with an index of a set of code bases in the server side) to determine if they are duplicated from other places in the current code base or even from other code bases.
- the characterization is based on the level and/or type of complexity of the changes between the two versions of source code in some embodiments.
- the characterization is output as a file that describes the differences between the versions of source code.
- a file is one non-limiting example.
- the visualization can be that of an architectural diagram that graphically depicts the operations on the two versions of source code that result in the characterization. For example, a move operation could be depicted visually by indicating the function of interest and illustrating an arrow from the function in the first version of source code to the function in the second version of source code.
- the visualization can be a color-coded diagram that illustrates different color-coded code snippets or functions or pieces of source code from the two versions of source code. The colors associated with the code snippets or functions or pieces of source code are assigned to different characterizations (e.g., red can represent a moved function, while yellow represents a duplicated code snippet or function, for example).
- the code reviewer can visually identify the type of changes between the two versions of source code.
- characterizations are non-limiting and merely exemplary. Other characterizations are possible and, in some cases, a smaller number (or greater number) of characterizations is possible as determined by the system designer and the needs of the code reviewer, which may change from time to time.
- Fig. 5 is a flow diagram illustrating an exemplary non- limiting process for facilitating intelligent code diffing.
- two versions of source code are received.
- the two versions of source code are processing using code clone detection technology.
- the code clone detection technology uses the code clone detection technology to determine different portions of the source code that correspond to one another.
- the pieces of source code that correspond to one another are either the same pieces of source code or similar pieces of source code.
- the process of Fig. 5 utilizes code clone detection technology to detect near matches of source code (and not merely exact matches of source code).
- the detected source code can be output from an intelligent code diffing system and accessed by a code reviewer.
- Fig. 6 is a flow diagram illustrating an exemplary non-limiting process for facilitating intelligent code diffing.
- information indicative of a correspondence between two versions of source code is received.
- a characterization of the correspondence is determined.
- the correspondence is information indicative of the actual differences between the two versions of source code that is abstracted to determine
- the correspondence is information indicative of a code snippet or function being deleted from a first version and a code snippet or function being added in the second version.
- the characterization is the abstraction to the semantic meaning underlying the added and deleted code snippet or function. For example, if the added and deleted code snippet or function are the same code snippet or function, the semantic meaning of the deletion and addition is determined to be a move from one version to another version and the characterization is then determined to be a move described above with reference to Fig. 4 (as opposed to merely outputting that a deletion of a first file and an addition of a second file occurred across the two versions with no addition information as to whether the added and deleted content was the same or any other semantic information associated therewith).
- a visualization of the characterization is generated.
- the visualization is a file describing the characterization of the changes between versions, an architectural diagram graphically displaying the change between the version and/or a color-coded listing of code snippet or functions that represent a change in one version of source code relative to the other version of source code.
- the characterization is output.
- the changes that drive the identification of the characterization are also output.
- Fig. 7 is a flow diagram illustrating an exemplary non-limiting process for facilitating intelligent code diffing.
- the type of content change can be a format change or comment change; a lexical change (e.g., variable re-naming) or a logical change in different non-limiting embodiments.
- the type of content change is the characterization of the differences between the versions of source code. As such, the type of content change is a moved function, deleted code snippet or function or any number of the other types of code snippet and/or functions described above with reference to Figs. 4-6, for example.
- a level of importance associated with the type of the content change is determined.
- the level of importance is mapped from the associated characterization.
- a moved function can be a characterization mapped to a trivial change, thereby being assigned the lowest level of importance.
- a renamed function can be mapped to a minor change, thereby being assigned a moderate level of importance.
- the modified function can be mapped to a major change, thereby being assigned the greatest level of importance.
- level of importance information can be provided for duplicated code snippet or function, moved function, renamed function or modified function characterizations.
- the level of importance can be determined based on assigning a numeric (e.g., percentage or otherwise) value to the type of the content change and categorizing the level of importance according to the numeric value. For example, a value of a 5% change would represent a trivial change, which would be assigned the lowest level of importance while a value of a 50% (or more) change would represent a major change, which would be assigned the greatest level of importance.
- a numeric e.g., percentage or otherwise
- information indicative of the level of importance is output. As described with regard to Figs. 4 and 6, the level of importance can be depicted visually.
- FIG. 8 is a block diagram
- FIG. 8 illustrating an exemplary non-limiting screenshot for intelligent code diffing using code clone detection technology.
- a developer made changes to multiple files of source code.
- the files are compared to previous versions and information indicative of the change is indicated in the screenshot for each edited file. Additionally, new files that are added relative to previous versions are indicated as added.
- Fig. 9 is another block diagram illustrating an exemplary non-limiting screenshot for intelligent code diffing using code clone detection technology.
- the code diffing system having embodiments described herein outputs information indicative of function-level, intuitive changes to the versions of the source code, as shown in Fig. 9.
- the changes are labeled as one of the six characterizations previously-described herein.
- the amount of change can also be indicated by the code diffing system.
- the percentage of change between the versions is indicated along with the characterization in some embodiments.
- Fig. 10 is another block diagram illustrating an exemplary non-limiting screenshot for intelligent code diffing using code clone detection technology.
- the code diffing system can receive inputs selecting a file such as the selection of NewFile.cs as shown in Fig. 10.
- the detailed changes between the versions is described at a function, intuitive level. For example, for a duplicated code snippet or function, such as function NewFile: :CopiedMethodl in file newFile.cs, the code diffing system shows the detailed changes after duplication, including signature (e.g., function definition) change and content (e.g., body) change (91% similarity).
- signature e.g., function definition
- content e.g., body
- the detailed changes can also be output in an intuitive, semantic manner, as shown in Fig. 11.
- the change is a bug fix.
- Fig. 12 is another block diagram illustrating an exemplary non-limiting screenshot for intelligent code diffing using code clone detection technology.
- Fig. 12 shows the detailed changes between a function (NewFile: :CopiedMethodl in file newFile.cs shown in Fig. 10) and its duplicated version.
- Fig. 13 is a block diagram showing an exemplary non-limiting implementation of a system architecture for implementing intelligent code diffing using code clone detection technology.
- the system includes a code clone analysis core 1310, an integrated development environment (IDE) 1320 and an application server 1350.
- IDE integrated development environment
- the code clone analysis core 1310 includes an indexer 1312 and parser
- the code clone analysis core 1310 includes a code clone detector 1316 configured to detect similar pieces of code.
- the code clone detector 1316 is configured to code clone detection and processing described with reference to U.S.
- the code clone detector 1316 can be configured to characterize the changes between different versions of code at a semantic level and/or generally perform any of the functions described herein with reference to the characterization engine 210 of Fig. 2 and/or the importance engine 310 of Fig. 3.
- the code clone analysis core 1310 also includes a difference visualizer
- the IDE 1320 includes an augmented code review user interface (UI)
- a code clone provider 1324 that includes an analysis driver 1326 and a code clone analysis core 1328.
- a language services component 1340 and functionalities for receiving information from other data providers are also provided at 1342.
- the system also includes a code clone analysis service 1330 as part of the application server 1350.
- the code clone analysis service 1330 includes a code clone analysis core 1332 at a server for providing intelligent code diffing, a code clone search engine 1334 and a code clone detection engine 1336.
- the application server 1350 can also include existing services 1352 and a task manager 1354.
- the application server 1350 includes the code clone analysis service 1330
- indexing of large scale code bases e.g., tens to hundreds of millions of lines of code from multiple code bases
- users can search code clones in larger scope.
- This enables the possibility of determining a code snippet or function that is a duplication of the source code in other solutions, although it could be new in the current solution.
- This further facilitates the developers/code reviewers' ability to understand the context of the code changes better.
- the intelligent code diffing is performed at the client utilizing the code clone analysis core 1310 and the IDE 1320 and relatively small code bases can be processed, however, such solutions are particularly light weight and convenient.
- the various embodiments of the intelligent code diffing systems and methods described herein can be implemented in connection with any computer or other client or server device, which can be deployed as part of a computer network or in a distributed computing environment, and can be connected to any kind of data store.
- the various embodiments described herein can be implemented in any computer system or environment having any number of memory or storage units, and any number of applications and processes occurring across any number of storage units. This includes, but is not limited to, an environment with server computers and client computers deployed in a network environment or a distributed computing
- Distributed computing provides sharing of computer resources and services by communicative exchange among computing devices and systems. These resources and services include the exchange of information, cache storage and disk storage for objects, such as files. These resources and services also include the sharing of processing power across multiple processing units for load balancing, expansion of resources, specialization of processing, and the like. Distributed computing takes advantage of network connectivity, allowing clients to leverage their collective power to benefit the entire enterprise. In this regard, a variety of devices may have applications, objects or resources that may participate in the mechanisms as described for various embodiments of the subject disclosure.
- Fig. 14 provides a schematic diagram of an exemplary networked or distributed computing environment.
- the distributed computing environment comprises computing objects 1410, 1412, etc. and computing objects or devices 1420, 1422, 1424, 1426, 1428, etc., which may include programs, methods, data stores, programmable logic, etc., as represented by applications 1430, 1432, 1434, 1436, 1438.
- computing objects 1410, 1412, etc. and computing objects or devices 1420, 1422, 1424, 1426, 1428, etc. may comprise different devices, such as personal digital assistants (PDAs), audio/video devices, mobile phones, MP3 players, personal computers, laptops, etc.
- PDAs personal digital assistants
- communications network 1440 may comprise other computing objects and computing devices that provide services to the system of Fig. 14, and/or may represent multiple
- Each computing object 1410, 1412, etc. or computing object or device 1420, 1422, 1424, 1426, 1428, etc. can also contain an application, such as applications 1430, 1432, 1434, 1436, 1438, that might make use of an API, or other object, software, firmware and/or hardware, suitable for communication with or implementation of the various embodiments of the subject disclosure.
- computing systems can be connected together by wired or wireless systems, by local networks or widely distributed networks.
- networks are coupled to the Internet, which provides an infrastructure for widely distributed computing and encompasses many different networks, though any network infrastructure can be used for exemplary communications made incident to the code differencing systems as described in various embodiments.
- client/server peer-to-peer
- hybrid architectures a host of network topologies and network infrastructures, such as client/server, peer-to-peer, or hybrid architectures.
- the "client” is a member of a class or group that uses the services of another class or group to which it is not related.
- a client can be a process, i.e., roughly a set of instructions or tasks, that requests a service provided by another program or process.
- the client process utilizes the requested service without having to "know” any working details about the other program or the service itself.
- a client is usually a computer that accesses shared network resources provided by another computer, e.g., a server.
- a server e.g., a server
- computing objects or devices 1420, 1422, 1424, 1426, 1428, etc. can be thought of as clients and computing objects 1410, 1412, etc.
- computing objects 1410, 1412, etc. acting as servers provide data services, such as receiving data from client computing objects or devices 1420, 1422, 1424, 1426, 1428, etc., storing of data, processing of data, transmitting data to client computing objects or devices 1420, 1422, 1424, 1426, 1428, etc., although any computer can be considered a client, a server, or both, depending on the circumstances. Any of these computing devices may be processing data, or requesting transaction services or tasks that may implicate the differencing techniques as described herein for one or more embodiments.
- a server is typically a remote computer system accessible over a remote or local network, such as the Internet or wireless network infrastructures.
- the client process may be active in a first computer system, and the server process may be active in a second computer system, communicating with one another over a communications medium, thus providing distributed functionality and allowing multiple clients to take advantage of the information-gathering capabilities of the server.
- Any software objects utilized pursuant to the techniques described herein can be provided standalone, or distributed across multiple computing devices or objects.
- the computing objects 1410, 1412, etc. can be Web servers with which other computing objects or devices 1420, 1422, 1424, 1426, 1428, etc. communicate via any of a number of known protocols, such as the hypertext transfer protocol (HTTP).
- HTTP hypertext transfer protocol
- Computing objects 1410, 1412, etc. acting as servers may also serve as clients, e.g., computing objects or devices 1420, 1422, 1424, 1426, 1428, etc., as may be characteristic of a distributed computing environment.
- embodiments can partly be implemented via an operating system, for use by a developer of services for a device or object, and/or included within application software that operates to perform one or more functional aspects of the various embodiments described herein.
- Software may be described in the general context of computer-executable instructions, such as program modules, being executed by one or more computers, such as client workstations, servers or other devices.
- computers such as client workstations, servers or other devices.
- client workstations such as client workstations, servers or other devices.
- Fig. 15 thus illustrates an example of a suitable computing system environment 1500 in which one or aspects of the embodiments described herein can be implemented, although as made clear above, the computing system environment 1500 is only one example of a suitable computing environment and is not intended to suggest any limitation as to scope of use or functionality. Neither should the computing system environment 1500 be interpreted as having any dependency or requirement relating to any one or combination of components illustrated in the exemplary computing system environment 1500.
- implementing one or more embodiments includes a general purpose computing device in the form of a computer 1510.
- Components of computer 1510 may include, but are not limited to, a processing unit 1520, a system memory 1530, and a system bus 1522 that couples various system components including the system memory to the processing unit 1520.
- Computer 1510 typically includes a variety of computer readable media and can be any available media that can be accessed by computer 1510.
- the system memory 1530 may include computer storage media in the form of volatile and/or nonvolatile memory such as read only memory (ROM) and/or random access memory (RAM).
- Computer readable media can also include, but is not limited to, magnetic storage devices (e.g., hard disk, floppy disk, magnetic strip), optical disks (e.g., compact disk (CD), digital versatile disk (DVD)), smart cards, and/or flash memory devices (e.g., card, stick, key drive).
- system memory 1530 may also include an operating system, application programs, other program modules, and program data.
- a user can enter commands and information into the computer 1510 through input devices 1540.
- a monitor or other type of display device is also connected to the system bus 1522 via an interface, such as output interface 1550.
- computers can also include other peripheral output devices such as speakers and a printer, which may be connected through output interface 1550.
- the computer 1510 may operate in a networked or distributed environment using logical connections to one or more other remote computers, such as remote computer 1570.
- the remote computer 1570 may be a personal computer, a server, a router, a network PC, a peer device or other common network node, or any other remote media consumption or transmission device, and may include any or all of the elements described above relative to the computer 1510.
- Fig. 15 The logical connections depicted in Fig. 15 include a network 1572, such local area network (LAN) or a wide area network (WAN), but may also include other networks/buses.
- LAN local area network
- WAN wide area network
- Such networking environments are commonplace in homes, offices, enterprise-wide computer networks, intranets and the Internet.
- API application programming interface
- driver source code operating system
- control standalone or downloadable software object
- standalone or downloadable software object etc.
- embodiments herein are contemplated from the standpoint of an API (or other software object), as well as from a software or hardware object that implements one or more aspects of the diffing techniques described herein.
- various embodiments described herein can have aspects that are wholly in hardware, partly in hardware and partly in software, as well as in software.
- a component may be, but is not limited to being, a process running on a processor, a processor, an object, an executable, a thread of execution, a program, and/or a computer.
- an application running on computer and the computer can be a component.
- One or more components may reside within a process and/or thread of execution and a component may be localized on one computer and/or distributed between two or more computers.
- one or more components may be combined into a single component providing aggregate functionality or divided into several separate subcomponents, and that any one or more middle layers, such as a management layer, may be provided to communicatively couple to such sub-components in order to provide integrated functionality. Any components described herein may also interact with one or more other components not specifically described herein but generally known by those of skill in the art.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
- Debugging And Monitoring (AREA)
Abstract
Description
Claims
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2010/079801 WO2012079230A1 (en) | 2010-12-15 | 2010-12-15 | Intelligent code differencing using code clone detection |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| EP2652621A1 true EP2652621A1 (en) | 2013-10-23 |
| EP2652621A4 EP2652621A4 (en) | 2014-08-20 |
Family
ID=46243972
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| EP10860883.7A Ceased EP2652621A4 (en) | 2010-12-15 | 2010-12-15 | INTELLIGENT CODE DIFFERENTIATION USING CODE CLONE DETECTION |
Country Status (6)
| Country | Link |
|---|---|
| EP (1) | EP2652621A4 (en) |
| JP (1) | JP5775599B2 (en) |
| KR (1) | KR101732764B1 (en) |
| CN (1) | CN103262047B (en) |
| CA (2) | CA2820758A1 (en) |
| WO (1) | WO2012079230A1 (en) |
Families Citing this family (30)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105446723B (en) * | 2014-09-02 | 2018-11-23 | 国际商业机器公司 | Method and apparatus for identifying the semantic differential between source code version |
| CN104407872B (en) * | 2014-12-04 | 2018-01-16 | 北京邮电大学 | How to detect code clones |
| KR101568224B1 (en) | 2014-12-26 | 2015-11-11 | 고려대학교 산학협력단 | Analysis device and method for software security |
| CN104572471B (en) * | 2015-01-28 | 2017-10-03 | 杭州电子科技大学 | A kind of Java software Code Clones detection method based on index |
| US10459704B2 (en) | 2015-02-10 | 2019-10-29 | The Trustees Of Columbia University In The City Of New York | Code relatives detection |
| JP2017156937A (en) * | 2016-03-01 | 2017-09-07 | ヤンマー株式会社 | Terminal device and software rewrite program |
| KR101780233B1 (en) | 2016-04-26 | 2017-09-21 | 고려대학교 산학협력단 | Apparatus and method for deteting code cloning of software |
| US10191737B2 (en) | 2016-06-29 | 2019-01-29 | Accenture Global Solutions Limited | Program code comparison and reporting |
| US10621195B2 (en) | 2016-09-20 | 2020-04-14 | Microsoft Technology Licensing, Llc | Facilitating data transformations |
| US10706066B2 (en) | 2016-10-17 | 2020-07-07 | Microsoft Technology Licensing, Llc | Extensible data transformations |
| US10776380B2 (en) | 2016-10-21 | 2020-09-15 | Microsoft Technology Licensing, Llc | Efficient transformation program generation |
| US11170020B2 (en) | 2016-11-04 | 2021-11-09 | Microsoft Technology Licensing, Llc | Collecting and annotating transformation tools for use in generating transformation programs |
| US11163788B2 (en) | 2016-11-04 | 2021-11-02 | Microsoft Technology Licensing, Llc | Generating and ranking transformation programs |
| CN106919403B (en) * | 2017-03-16 | 2019-12-13 | 杭州鹿径科技有限公司 | multi-granularity code clone detection method based on Java byte codes in cloud environment |
| CN106951743A (en) * | 2017-03-22 | 2017-07-14 | 上海英慕软件科技有限公司 | A kind of software code infringement detection method |
| US10402311B2 (en) | 2017-06-29 | 2019-09-03 | Microsoft Technology Licensing, Llc | Code review rebase diffing |
| SE1751167A1 (en) * | 2017-09-20 | 2019-03-21 | Empear Ab | Identifying parts of a software code that are associated via alteration |
| CN109558314B (en) * | 2018-11-09 | 2021-07-27 | 国网四川省电力公司电力科学研究院 | A Method for Cloning Detection of Java Source Codes |
| CN109828785B (en) * | 2019-01-23 | 2022-04-12 | 复旦大学 | An Approximate Code Cloning Detection Method Using GPU Acceleration |
| US11070618B2 (en) * | 2019-01-30 | 2021-07-20 | Valve Corporation | Techniques for updating files |
| CN110737469B (en) * | 2019-09-29 | 2021-09-03 | 南京大学 | Source code similarity evaluation method based on semantic information on function granularity |
| US11048487B1 (en) * | 2019-12-27 | 2021-06-29 | The Mathworks, Inc. | Syntactical change-resistant code generation |
| KR102282705B1 (en) * | 2019-12-30 | 2021-07-29 | 한양대학교 에리카산학협력단 | Method for constructing patched source code from assembly code and apparatus therefor |
| CN111240740B (en) * | 2020-01-23 | 2021-09-17 | 复旦大学 | Code clone hazard assessment method based on evolution history analysis |
| KR102318714B1 (en) | 2020-01-31 | 2021-10-28 | 고려대학교 산학협력단 | Computet program for detecting software vulnerability based on binary code clone |
| JP2022023523A (en) | 2020-07-27 | 2022-02-08 | 富士通株式会社 | Alert matching program, alarm matching method and alarm matching device |
| CN112148359B (en) * | 2020-10-10 | 2022-07-05 | 中国人民解放军国防科技大学 | A distributed code clone detection and search method, system and medium based on sub-block filtering |
| CN112215013B (en) * | 2020-11-02 | 2022-04-19 | 天津大学 | A deep learning-based clone code semantic detection method |
| CN116028112B (en) * | 2023-01-30 | 2025-07-25 | 西安交通大学 | Small program clone detection method based on complex network analysis |
| CN116302089B (en) * | 2023-05-23 | 2023-08-18 | 华中科技大学 | Code clone detection method, system and storage medium based on image similarity |
Family Cites Families (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH08221265A (en) * | 1995-02-10 | 1996-08-30 | Toshiba Corp | Software development support device |
| DE102004010179A1 (en) * | 2004-03-02 | 2005-10-06 | Siemens Ag | Method and data processing device for updating computer programs by data transmission |
| JP2006018693A (en) * | 2004-07-02 | 2006-01-19 | Fujitsu Ltd | Similar source code extraction program, similar source code extraction device, and similar source code extraction method |
| JP2006277127A (en) * | 2005-03-28 | 2006-10-12 | Canon Inc | How to compare hotfixes |
| JP4134218B2 (en) * | 2006-11-16 | 2008-08-20 | インターナショナル・ビジネス・マシーンズ・コーポレーション | Information processing apparatus, method, and program for determining priority of test cases to be executed in regression test |
| JP2008197982A (en) * | 2007-02-14 | 2008-08-28 | Toshiba Corp | Source code protection device |
| JP2009176064A (en) * | 2008-01-24 | 2009-08-06 | Fuji Electric Holdings Co Ltd | Software refactoring support apparatus and method |
| JP2009199172A (en) * | 2008-02-19 | 2009-09-03 | Hitachi Ltd | Information processing system, method for specifying similar parts inside program, and program |
| JP5208635B2 (en) * | 2008-09-12 | 2013-06-12 | インターナショナル・ビジネス・マシーンズ・コーポレーション | Information processing apparatus, information processing system, programming support method and program for supporting programming |
-
2010
- 2010-12-15 CA CA2820758A patent/CA2820758A1/en not_active Abandoned
- 2010-12-15 CA CA2967251A patent/CA2967251C/en active Active
- 2010-12-15 JP JP2013543486A patent/JP5775599B2/en not_active Expired - Fee Related
- 2010-12-15 CN CN201080070705.0A patent/CN103262047B/en not_active Expired - Fee Related
- 2010-12-15 KR KR1020137015514A patent/KR101732764B1/en not_active Expired - Fee Related
- 2010-12-15 EP EP10860883.7A patent/EP2652621A4/en not_active Ceased
- 2010-12-15 WO PCT/CN2010/079801 patent/WO2012079230A1/en not_active Ceased
Non-Patent Citations (6)
| Title |
|---|
| DAQING HOU ET AL: "Proactively managing copy-and-paste induced code clones", SOFTWARE MAINTENANCE, 2009. ICSM 2009. IEEE INTERNATIONAL CONFERENCE ON, IEEE, PISCATAWAY, NJ, USA, 20 September 2009 (2009-09-20), pages 391-392, XP031557805, ISBN: 978-1-4244-4897-5 * |
| FEROSH JACOB ET AL: "Actively comparing clones inside the code editor", PROCEEDINGS OF THE 4TH INTERNATIONAL WORKSHOP ON SOFTWARE CLONES, IWSC '10, 1 January 2010 (2010-01-01), pages 9-16, XP55127885, New York, New York, USA DOI: 10.1145/1808901.1808903 ISBN: 978-1-60-558980-0 * |
| MIRYUNG KIM ET AL: "Automatic Inference of Structural Changes for Matching across Program Versions", 29TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE'07), 1 May 2007 (2007-05-01), pages 333-343, XP55127981, ISSN: 0270-5257, DOI: 10.1109/ICSE.2007.20 ISBN: 978-0-76-952828-1 * |
| PETER WEISSGERBER ET AL: "Identifying Refactorings from Source-Code Changes", AUTOMATED SOFTWARE ENGINEERING, 2006. ASE '06. 21ST IEEE/ACM INTE RNATIONAL CONFERENCE ON, IEEE, PI, 1 September 2006 (2006-09-01), pages 231-240, XP031021412, ISBN: 978-0-7695-2579-2 * |
| See also references of WO2012079230A1 * |
| VAN RYSSELBERGHE F ET AL: "Reconstruction of successful software evolution using clone detection", SOFTWARE EVOLUTION, 2003. PROCEEDINGS. SIXTH INTERNATIONAL WORKSHOP ON PRINCIPLES OF 1-2 SEPT. 2003, PISCATAWAY, NJ, USA,IEEE, 1 September 2003 (2003-09-01), pages 126-130, XP010656987, ISBN: 978-0-7695-1903-6 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN103262047A (en) | 2013-08-21 |
| CA2967251A1 (en) | 2012-06-21 |
| JP2013546090A (en) | 2013-12-26 |
| CA2820758A1 (en) | 2012-06-21 |
| CA2967251C (en) | 2020-04-07 |
| JP5775599B2 (en) | 2015-09-09 |
| WO2012079230A1 (en) | 2012-06-21 |
| CN103262047B (en) | 2016-11-16 |
| KR101732764B1 (en) | 2017-05-04 |
| EP2652621A4 (en) | 2014-08-20 |
| KR20140001951A (en) | 2014-01-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CA2967251C (en) | Intelligent code differencing using code clone detection | |
| JP7776247B2 (en) | Checking source code validity when updating code | |
| Teyton et al. | A study of library migrations in java | |
| US10481884B2 (en) | Systems and methods for dynamically replacing code objects for code pushdown | |
| US20120159434A1 (en) | Code clone notification and architectural change visualization | |
| Schröder et al. | An empirical investigation of command-line customization | |
| US20250208837A1 (en) | Using natural language to perform context-aware code generation | |
| Stolee et al. | Identification, impact, and refactoring of smells in pipe-like web mashups | |
| Aghili et al. | Studying the characteristics of AIOps projects on GitHub | |
| US11947966B2 (en) | Identifying computer instructions enclosed by macros and conflicting macros at build time | |
| Conforti et al. | Analysis of business process variants in apromore | |
| Abdelfattah et al. | Detecting Semantic Clones in Microservices Using Components: AS Abdelfattah et al. | |
| Mateos et al. | A stitch in time saves nine: Early improving code-first web services discoverability | |
| Yao et al. | ToolACE-MCP: Generalizing History-Aware Routing from MCP Tools to the Agent Web | |
| US12099556B2 (en) | Working context transfer across development environments | |
| Garg et al. | Insight to model clone’s differentiation, classification, and visualization | |
| Lukács | Explaining AI Applications through Workflow Provenance | |
| WO2025044101A1 (en) | Processing method and processing apparatus for checking rule | |
| Usai et al. | LogicLens: Leveraging Semantic Code Graph to explore Multi Repository large systems | |
| Liu et al. | LLMAID: Identifying AI Capabilities in Android Apps with LLMs | |
| Mateos Diaz et al. | A stitch in time saves nine: Early improving code-first Web Services discoverability | |
| Witte et al. | The OpenTrace Workbench for Automatic Traceability Link Recovery and Evaluation | |
| Baysal | Aiding comprehension of cloning through categorization | |
| HK1173808A (en) | Code clone notification and architectural change visualization | |
| HK1170036B (en) | Method and device for comparing program text |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PUAI | Public reference made under article 153(3) epc to a published international application that has entered the european phase |
Free format text: ORIGINAL CODE: 0009012 |
|
| 17P | Request for examination filed |
Effective date: 20130715 |
|
| AK | Designated contracting states |
Kind code of ref document: A1 Designated state(s): AL AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HR HU IE IS IT LI LT LU LV MC MK MT NL NO PL PT RO RS SE SI SK SM TR |
|
| RIN1 | Information on inventor provided before grant (corrected) |
Inventor name: LIU, WEIPENG Inventor name: GE, SONG Inventor name: DANG, YINGNONG Inventor name: KHAN, SADI Inventor name: ZHANG, DONGMEI Inventor name: CHENG, GONG |
|
| DAX | Request for extension of the european patent (deleted) | ||
| A4 | Supplementary search report drawn up and despatched |
Effective date: 20140723 |
|
| RIC1 | Information provided on ipc code assigned before grant |
Ipc: G06F 11/28 20060101AFI20140717BHEP Ipc: G06F 9/44 20060101ALI20140717BHEP |
|
| RAP1 | Party data changed (applicant data changed or rights of an application transferred) |
Owner name: MICROSOFT TECHNOLOGY LICENSING, LLC |
|
| STAA | Information on the status of an ep patent application or granted ep patent |
Free format text: STATUS: EXAMINATION IS IN PROGRESS |
|
| 17Q | First examination report despatched |
Effective date: 20170215 |
|
| APBK | Appeal reference recorded |
Free format text: ORIGINAL CODE: EPIDOSNREFNE |
|
| APBN | Date of receipt of notice of appeal recorded |
Free format text: ORIGINAL CODE: EPIDOSNNOA2E |
|
| APBR | Date of receipt of statement of grounds of appeal recorded |
Free format text: ORIGINAL CODE: EPIDOSNNOA3E |
|
| APAF | Appeal reference modified |
Free format text: ORIGINAL CODE: EPIDOSCREFNE |
|
| APAF | Appeal reference modified |
Free format text: ORIGINAL CODE: EPIDOSCREFNE |
|
| RAP3 | Party data changed (applicant data changed or rights of an application transferred) |
Owner name: MICROSOFT TECHNOLOGY LICENSING, LLC |
|
| APBT | Appeal procedure closed |
Free format text: ORIGINAL CODE: EPIDOSNNOA9E |
|
| REG | Reference to a national code |
Ref country code: DE Ref legal event code: R003 |
|
| STAA | Information on the status of an ep patent application or granted ep patent |
Free format text: STATUS: THE APPLICATION HAS BEEN REFUSED |
|
| 18R | Application refused |
Effective date: 20220215 |