JPS61211737A - Program comparison deciding method - Google Patents

Program comparison deciding method

Info

Publication number
JPS61211737A
JPS61211737A JP60052205A JP5220585A JPS61211737A JP S61211737 A JPS61211737 A JP S61211737A JP 60052205 A JP60052205 A JP 60052205A JP 5220585 A JP5220585 A JP 5220585A JP S61211737 A JPS61211737 A JP S61211737A
Authority
JP
Japan
Prior art keywords
lines
comparison
section
new
source program
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.)
Granted
Application number
JP60052205A
Other languages
Japanese (ja)
Other versions
JPH0789318B2 (en
Inventor
Masaru Ayabe
綾辺 勝
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP60052205A priority Critical patent/JPH0789318B2/en
Publication of JPS61211737A publication Critical patent/JPS61211737A/en
Publication of JPH0789318B2 publication Critical patent/JPH0789318B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To automatically identify a changing section by providing a comparison deciding reference based on a coincidence of continuing plural lines, extracting the same section in order from a section having many continuous and coincident lines while reducing gradually the number of the lines, and deciding a remaining line to be a correcting line of an addition, a deletion and a replacement. CONSTITUTION:New and old source programs 1, 2 are loaded in new and old source program storing tables 5, 6 and a numerical value is set as a continuous and coincident line number N of a comparison deciding reference. Then, the new and old source program storing tables are compared and scanned and a continuous and coincident section above the N line is extracted. When there is the section of the continuous and coincident section more than the N lines, a flag indicating the coincidence is set in a comparison result area of the new and old source program storing tables 5, 6. In the case where an object to be compared is not present, the value of N is subtracted by one and when N is <=0, referring to the comparison result area, a comparison result is outputted to a printer 7 and printed.

Description

【発明の詳細な説明】 〔発明の利用分野〕 本発明は、ソースプログラム変更において新旧ソースプ
ログラムの変更部分を印刷するに係り、特に、同一部分
と変更部分の判定に好適なプログラム比較判定方法に関
する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Application of the Invention] The present invention relates to printing changed portions of old and new source programs when changing source programs, and particularly relates to a method for comparing and determining programs suitable for determining whether the same portions and changed portions are the same. .

〔発明の背景〕[Background of the invention]

従来のソースプログラム変更チェックは、特開昭57−
123448号公報で示されるようなソースプログラム
編集時のチェックがあるが、複数の変更がなされた後の
最終チェックではこの方法を利用できない。複数の変更
がなされた新ソースプログラムが正しく変更されたかど
うかチェックする方法としては、新旧ソースプログラム
を比較した結果と変更内容を照合チェックする方法が有
効である。
The conventional source program change check is based on Japanese Patent Laid-Open No. 57-
Although there is a check when editing a source program as shown in Japanese Patent No. 123448, this method cannot be used for the final check after multiple changes have been made. An effective way to check whether a new source program that has undergone multiple changes has been changed correctly is to check the changes against the results of comparing the old and new source programs.

しかしながら、第1図で示されるように新旧ソースプロ
グラムの比較判定結果において、実際の変更はαの部分
の削除であるが、比較判定の方法によっては比較結果と
変更個所が一致しないという問題があった。
However, as shown in Figure 1, although the actual change in the comparison judgment result of the old and new source programs is the deletion of the part α, there is a problem that depending on the method of comparison judgment, the comparison result and the changed part do not match. Ta.

〔発明の目的〕[Purpose of the invention]

本発明の目的は、上記問題点を解決するためになされた
もので、内容の全く同じ行が複数ある一般的なソースプ
ログラムに対して任意の変更がなされたとき、その変更
個所を変更前後の新旧ソースプログラムの比較から自動
的に識別するプログラム比較判定方法を提供することに
ある。
An object of the present invention has been made to solve the above problems.When arbitrary changes are made to a general source program that has multiple lines with exactly the same content, the changed parts are recorded before and after the change. An object of the present invention is to provide a program comparison and judgment method that automatically identifies programs by comparing old and new source programs.

〔発明の概要〕[Summary of the invention]

第1図において、新旧ソースプログラムの比較判定で、
比較結果と変更個所が一致しないのは、Do文やEND
文の様な内容の全く同じ行が複数ありその対応関係を考
慮し7てないことに起因する。しだがって本発明は連続
一致部分の多い順に同一と判定していくことにより、上
記問題を解決している。即ち、第2図に示されるように
比較判定は最初に9行が連続一致するbの部分を同一と
判定し、次に1行が一致するCの部分を同一と判定する
。そして残った不一致部分dを新旧ソースプログラムの
対応関係から削除されたと判定する。
In Figure 1, when comparing the old and new source programs,
The difference between the comparison result and the changed part is the Do statement or END.
This is due to the fact that there are multiple lines with exactly the same content, such as sentences, and the correspondence between them is not taken into account. Therefore, the present invention solves the above problem by determining the sameness in descending order of consecutive matching parts. That is, as shown in FIG. 2, in the comparison and determination, first the part b where nine consecutive lines match is determined to be the same, and then the part C where one row matches is determined to be the same. Then, it is determined that the remaining mismatched portion d has been deleted from the correspondence between the old and new source programs.

従って、本発明は、修正前の旧ソースプログラムト修正
後の新ソースプログラムの比較判定を行いその判定結果
を印刷する方法において、連続する複数行の一致に基づ
く比較判定基準を設は該比較判定基準の行数を順次減少
させながら連続一致行数の多い部分から順に同一部分を
抽出し、残る部分を追加、削除、置換の修正行と判定す
ることを特徴とする。
Therefore, the present invention provides a method for comparing and determining an old source program before modification and a new source program after modification, and printing the determination result. It is characterized by sequentially decreasing the number of reference lines and extracting the same parts in order from the part with the largest number of consecutive matching lines, and determining the remaining parts as modified lines for addition, deletion, or replacement.

〔発明の実施例〕[Embodiments of the invention]

以下、本発明の一実施例につき図面に従って詳細に説明
する。第3図は本発明を適用した電子計算機システムの
構成を示すブロック図、第4図は比較処理手順を示すフ
ローチャート、第5図は新旧ソースプログラムおよび判
定結果を格納する記憶域のテーブルを示す図である。
Hereinafter, one embodiment of the present invention will be described in detail with reference to the drawings. Fig. 3 is a block diagram showing the configuration of a computer system to which the present invention is applied, Fig. 4 is a flowchart showing the comparison processing procedure, and Fig. 5 is a diagram showing a storage area table for storing old and new source programs and judgment results. It is.

第3図において、1,2は新旧ソースプログラム格納外
部記憶装置、3は中央処理装置、4は比較処理ブロック
、5,6は比較処理ブロックで処理する為の新旧ソース
プログラムおよび判定結果を格納するテーブル、7は比
較結果を印刷するプリンタ装置である。
In FIG. 3, 1 and 2 are external storage devices for storing old and new source programs, 3 is a central processing unit, 4 is a comparison processing block, and 5 and 6 are storage devices for storing old and new source programs and judgment results for processing in the comparison processing block. Table 7 is a printer device that prints the comparison results.

次に、第4図のフローチャートにより比較処理手順を示
す。最初に新旧ソースプログラム1゜2を新旧ソースプ
ログラム格納テーブル5,6にロードし、比較判定基準
である連続一致行数Nとして数値16を設定する(ステ
ップ8)。つぎに新旧ソースプログラム格納テーブルを
比較走・ 3 ・ 査し、N行以上連続一致部分を抽出する(ステップ9)
。N行以上連続一致部分がある場合は一致したことを示
すフラッグを新旧ソースプログラム格納テーブル5.乙
の比較結果エリア12に設定する(ステップ10)。比
較対象が残っている場合はステップ9に戻り、比較対象
が無くなった場合はNの値を1減じる(ステップ11)
Next, the comparison processing procedure will be described using the flowchart of FIG. First, the new and old source programs 1.2 are loaded into the new and old source program storage tables 5 and 6, and a numerical value of 16 is set as the number N of consecutive matching lines, which is a comparison criterion (step 8). Next, the old and new source program storage tables are compared and scanned, and consecutive matching parts of N or more lines are extracted (Step 9).
. If there are consecutive matching parts in N or more lines, a flag indicating that there is a match is added to the old and new source program storage table 5. Set in the comparison result area 12 of Party B (step 10). If comparison targets remain, return to step 9; if there are no comparison targets, subtract 1 from the value of N (step 11).
.

Nが0以下でなければステップ9に戻り、Nが0以下な
らば比較結果エリア12を参照して比較結果をプリンタ
装置7へ出力し印刷する。
If N is not 0 or less, the process returns to step 9, and if N is 0 or less, the comparison result area 12 is referred to and the comparison result is output to the printer device 7 and printed.

〔発明の効果〕〔Effect of the invention〕

以上説明したように、本発明によれば内容の全く同じ行
が複数行あるソースプログラムに対して任意の変更がな
されたとき、その変更個所を変更前後の新旧ソースプロ
グラムの比較から自動的に識別することができるという
効果が得られる。
As explained above, according to the present invention, when an arbitrary change is made to a source program that has multiple lines with exactly the same content, the changed part is automatically identified by comparing the old and new source programs before and after the change. The effect of being able to do this is obtained.

【図面の簡単な説明】[Brief explanation of drawings]

第1図は比較方法の問題点を説明するだめの図、第2図
は本発明の比較判定例を示す説明図・ 4 ・ 第3図は本実施例のシステム構成を示すブロック図、第
4図は本実施例の比較判定基準のフローチャート、第5
図は本実施例で使用するテーブルのフォーマットを示す
図である。 α・・ソースプログラム変更部分(削除)N・・比較判
定基準の連続一致行数 1・・新ソースプログラム格納外部記憶装置2・・・旧
ソースプログラム格納外部記憶装置3・・・中央処理装
置 7・・プリンタ装置。 篤 1 図 第λ 図 し 第3 図 O6 第4図 篤5 図
Fig. 1 is a diagram for explaining the problems of the comparison method, Fig. 2 is an explanatory diagram showing an example of comparison and judgment according to the present invention. The figure is a flowchart of the comparison criteria of this example.
The figure shows the format of a table used in this embodiment. α... Source program changed part (deletion) N... Number of consecutive matching lines of comparison criteria 1... New source program storage external storage device 2... Old source program storage external storage device 3... Central processing unit 7 ...Printer device. Atsushi 1 Figure λ Figure 3 Figure O6 Figure 4 Atsushi 5

Claims (1)

【特許請求の範囲】[Claims] 1、修正前の旧ソースプログラムと修正後の新ソースプ
ログラムの比較判定を行い、その判定結果を印刷する方
法において、連続する複数行の一致に基づく比較判定基
準を設け、該比較判定基準の行数を順次減少させながら
連続一致行数の多い部分から順に同一部分を抽出し、残
る部分を追加、削除、置換の修正行と判定することを特
徴とするプログラム比較判定方法。
1. In a method of comparing and judging the old source program before modification and the new source program after modification, and printing the result, a comparison criterion is established based on the match of multiple consecutive lines, and the line of the comparison criterion is A program comparison and determination method is characterized in that the same portions are extracted in order from the portion with the largest number of consecutive matching lines while decreasing the number sequentially, and the remaining portions are determined to be modified lines for addition, deletion, or replacement.
JP60052205A 1985-03-18 1985-03-18 Program comparison judgment method Expired - Lifetime JPH0789318B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60052205A JPH0789318B2 (en) 1985-03-18 1985-03-18 Program comparison judgment method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60052205A JPH0789318B2 (en) 1985-03-18 1985-03-18 Program comparison judgment method

Publications (2)

Publication Number Publication Date
JPS61211737A true JPS61211737A (en) 1986-09-19
JPH0789318B2 JPH0789318B2 (en) 1995-09-27

Family

ID=12908272

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60052205A Expired - Lifetime JPH0789318B2 (en) 1985-03-18 1985-03-18 Program comparison judgment method

Country Status (1)

Country Link
JP (1) JPH0789318B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0384627A (en) * 1989-08-29 1991-04-10 Nippon Steel Corp Computer program transfer device
JP2008059514A (en) * 2006-09-04 2008-03-13 Hitachi Information Systems Ltd Program source comparison system, comparison method, and program for it

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS4883746A (en) * 1972-01-21 1973-11-08
JPS59135523A (en) * 1983-01-25 1984-08-03 Riyouden Koki Service Eng Kk Content collating system for cassette loader of programmable controller

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS4883746A (en) * 1972-01-21 1973-11-08
JPS59135523A (en) * 1983-01-25 1984-08-03 Riyouden Koki Service Eng Kk Content collating system for cassette loader of programmable controller

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0384627A (en) * 1989-08-29 1991-04-10 Nippon Steel Corp Computer program transfer device
JP2008059514A (en) * 2006-09-04 2008-03-13 Hitachi Information Systems Ltd Program source comparison system, comparison method, and program for it

Also Published As

Publication number Publication date
JPH0789318B2 (en) 1995-09-27

Similar Documents

Publication Publication Date Title
GB2339487A8 (en) Error detection in data transfer by comparing expected and actual identifiers
JPS5622143A (en) Error processing system
ATE205029T1 (en) COMPUTER SORTING SYSTEM FOR DATA COMPRESSION
JPS61211737A (en) Program comparison deciding method
JPS60186920A (en) Starting method of document processing program
JP2833871B2 (en) Alien name data judgment method
JPH05241921A (en) System for detecting difference for unit of clause in source file
JPS60178795A (en) Condition transition processing system
JPH04257037A (en) Data base stored failure page erase/restore system
JPH05108443A (en) File management system for information processor
JPH0527862A (en) Date take-out system
JP2742280B2 (en) Japanese automatic analyzer
JPH06309366A (en) Key word extraction system
DE59600702D1 (en) System start of a computer for the control center of a printing press
CN118519975A (en) Automatic updating method and device for table file data, equipment and storage medium
JPH09167206A (en) Space detecting method for japanese/english-mixed document, pitch format judging method, space detecting method for constant pitch alphanumeric character string and space detecting method for proportional pitch alphanumeric character string
CN112114900A (en) Formatting method and related equipment
JPH02238524A (en) Verifying system for source program
JPH08249193A (en) Checking system for language specification range of program
JPS60251769A (en) Method for generating compression data
JPH08152999A (en) Program difference management system
JPH04155455A (en) Method for managing file
JPH01159719A (en) Information processing device
JPH08227370A (en) Device and method for editing file
JPH05127947A (en) Computer program test method

Legal Events

Date Code Title Description
EXPY Cancellation because of completion of term