Re: Source code comparison tools

"Ira Baxter" <>
22 Jan 2005 18:29:40 -0500

          From comp.compilers

Related articles
Source code comparison tools (John R Levine) (2005-01-19)
Re: Source code comparison tools (Derek M Jones) (2005-01-22)
Re: Source code comparison tools (David Spencer) (2005-01-22)
Re: Source code comparison tools (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" <>
Newsgroups: comp.compilers
Date: 22 Jan 2005 18:29:40 -0500
References: 05-01-065
Keywords: tools
Posted-Date: 22 Jan 2005 18:29:40 EST

"John R Levine" <> 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.

There's a sample Java clone detector you can download there.

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

Post a followup to this message

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