Re: Source code comparison tools

"Ira Baxter" <idbaxter@semdesigns.com>
22 Jan 2005 18:29:40 -0500

          From comp.compilers

Related articles
Source code comparison tools johnl@iecc.com (John R Levine) (2005-01-19)
Re: Source code comparison tools derek@knosof.co.uk (Derek M Jones) (2005-01-22)
Re: Source code comparison tools spencer@panix.com (David Spencer) (2005-01-22)
Re: Source code comparison tools idbaxter@semdesigns.com (Ira Baxter) (2005-01-22)
Re: Source code comparison tools debray@CS.Arizona.EDU (2005-01-22)
| List of all articles for this month |

From: "Ira Baxter" <idbaxter@semdesigns.com>
Newsgroups: comp.compilers
Date: 22 Jan 2005 18:29:40 -0500
Organization: http://extra.newsguy.com
References: 05-01-065
Keywords: tools
Posted-Date: 22 Jan 2005 18:29:40 EST

"John R Levine" <johnl@iecc.com> wrote in message
> I'm working on a project where I'm trying to understand how a program
> evolved. I have a bunch of snapshots of the C source code to work from.
>
> It's easy enough to use the Unix diff program to compare the snapshots,
> but it's much too low level. If someone changes the name of variable A to
> B, diff sees that as a change every time the variable is referenced, but
> it's really only one change.
>
> I can hack up some preprocessing scripts to abstract out variable names,
> indentation, and the like before handing the files to diff, but before I
> do so, I'd like to see if there's existing tools I can use.


Hmm. Our CloneDR tool finds exact and near-miss duplicate code across
programs. Clearly it would find (a lot!) of duplicate code across
evolutionary versions. The duplicates it finds are effectively macro
bodies; the parameters is proposes take into account replication of
instances. In effect, this means if somebody renames variables
consistently in a block of code, the detected duplicate will have one
parameter for each changed variable name, e.g, exactly your "only one
change" effect.


See http://www.semanticdesigns.com/Products/Clone.
There's a sample Java clone detector you can download there.


--
Ira D. Baxter, Ph.D., CTO 512-250-1018
Semantic Designs, Inc. www.semdesigns.com


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.