Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Formatted Code Comparison

IP.com Disclosure Number: IPCOM000104134D
Original Publication Date: 1993-Mar-01
Included in the Prior Art Database: 2005-Mar-18
Document File: 4 page(s) / 112K

Publishing Venue

IBM

Related People

Sweeny, JW: AUTHOR

Abstract

A logical source code comparison technique is disclosed. The output comparison listing has the source code formatted to the standards of the language, with construct delimiters connected via a bar. An emphasis is placed on not flagging lines of a code that have changed due to reformatting only.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Formatted Code Comparison

      A logical source code comparison technique is disclosed.  The
output comparison listing has the source code formatted to the
standards of the language, with construct delimiters connected via a
bar.  An emphasis is placed on not flagging lines of a code that have
changed due to reformatting only.

      Given any 3rd generation computer language, a new program (or
macro) may be developed for inclusion in a product.  The developer of
this program, under the guidelines of some establish coding standard,
will ensure that the source code is formatted properly (i.e.,
constructs line up in the appropriate columns).

      Once the program has shipped it becomes a candidate for
maintenance, whether it be for service or new function.  When the
existing program is modified, the usual practice is to compare the
modified source code against the existing source code using some
comparison tool.  This comparison would then be used for a code
review (inspection).

      The problem with this is that most comparison tools are
ignorant of the computer language (code) they are comparing.  They
simply compare byte for byte the new source against the old.  Any
line of text that differs in any way from the original will be
flagged as changed by the comparison tool, even if the difference
involves only whitespace.  It is for this reason that developers do
not reformat their source code to standards during maintenance.  If
they did, the comparison tool would likely flag reformatted lines of
text as changed.  Over time, the source code gets so badly out of
format that it becomes unreadable and inspections become error prone.

      The solution is to produce a comparison tool that is not
ignorant of the language of its source code input.  For the examples,
the source code language is PL/I.  This new tool produces a
compa...