JP5020184B2 - Program analysis method and program creation method - Google Patents
Program analysis method and program creation method Download PDFInfo
- Publication number
- JP5020184B2 JP5020184B2 JP2008193652A JP2008193652A JP5020184B2 JP 5020184 B2 JP5020184 B2 JP 5020184B2 JP 2008193652 A JP2008193652 A JP 2008193652A JP 2008193652 A JP2008193652 A JP 2008193652A JP 5020184 B2 JP5020184 B2 JP 5020184B2
- Authority
- JP
- Japan
- Prior art keywords
- program
- common element
- common
- source
- quasi
- 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.)
- Expired - Fee Related
Links
Images
Landscapes
- Stored Programmes (AREA)
Description
この発明は、構造化プログラミングがされていない複数のソースプログラムを分析し、プログラムの再利用可能な単位を特定するプログラム分析方法及びプログラム作成方法に関するものである。 The present invention relates to a program analysis method and a program creation method for analyzing a plurality of source programs that are not structured and specifying a reusable unit of the program.
大規模なソフトウエアシステムを開発・保守する組織において、長期にわたるシステム保守の中で作成された膨大な類似プログラム資産を管理することが難しくなっている。特に、システムの信頼性と安全性確保のために、納入実績のあるプログラムを、生産性向上のためにプログラム構造を大きく組み直すようなことは許容されにくく、既存のプログラムを流用して作成することが基本となっている。
また、流用元のプログラムが開発されたのは事業創設期であり、構造化プログラミングがされていないことが多い。
構造化プログラミングされているソースプログラムの共通部分を類型化する方法については、特許文献1が提案されている。
In an organization that develops and maintains a large-scale software system, it is difficult to manage a large number of similar program assets created during long-term system maintenance. In particular, to ensure system reliability and safety, it is difficult to restructure a program with a delivery record, and to restructure the program structure to improve productivity. Is the basis.
In addition, the diversion source program was developed during the business establishment period, and structured programming is often not performed.
大規模ソフトウエアのプログラムの流用設計をする上で、構造化プログラミングされていないプログラムのカスタマイズ範囲や改造範囲を抽出するためには、大規模プログラムのソースプログラムを人間系で一行一行確認する他に方法がないため、解析に時間を要する問題があった。
また、あるプログラムに動作不良が発生した場合、納入実績のあるプログラムのうちで改修対象となる対象を選定するにも、ソースプログラムを人間系で確認する必要があるため、ヒューマンエラーが入り込み易いという問題があった。
特許文献1は、構造化プログラミングされているソースプログラムの共通部分を類型化するものであり、構造化プログラミングされていないソースプログラムについてのものではなかった。
In order to extract the customization range and remodeling range of programs that are not structured programming in designing diversion of large-scale software programs, in addition to checking the source programs of large-scale programs one by one in a human system Since there was no method, there was a problem that analysis took time.
In addition, when a malfunction occurs in a program, it is easy for human errors to enter because it is necessary to check the source program with a human system in order to select the target to be repaired among the programs that have been delivered. There was a problem.
この発明は、上記のような課題を解決するためになされたものであり、構造化プログラミングされていないプログラムでも、再利用可能な部品単位に分割し、これらを組合せてプログラムを再構築することができるプログラム分析方法及びプログラム作成方法を得ることを目的としている。 The present invention has been made to solve the above-described problems, and even a program that is not structured can be divided into reusable component units, and these can be combined to reconstruct the program. It is an object of the present invention to obtain a program analysis method and a program creation method.
この発明に係わるプログラム分析方法においては、単位抽出部が、複数のソースプログラムからソースプログラムごとにプログラムの構成要素であるプログラム文を抽出し、表形式のファイルに保存する第一のステップ、共通要素抽出部が、プログラム文のうち、各ソースプログラム内で一つしかないプログラム文であり、かつ複数のソースプログラムのすべてに存在するプログラム文を共通要素として抽出し、共通要素一覧データに保存する第二のステップ、準共通要素抽出部が、各ソースプログラムの共通要素で区切られた同じ範囲において、複数のソースプログラムに存在するプログラム文を準共通要素として抽出し、準共通要素一覧データに保存する第三のステップ、及び非共通要素抽出部が、共通要素と準共通要素のどちらでもない表形式で保存されたプログラム文を非共通要素として抽出し、非共通要素一覧データに保存する第四のステップを含み、第二、第三及び第四の各ステップで抽出された各要素には、抽出された元のソースプログラムと、そのソースプログラムの中での位置を示す分類コードが付与されているものである。 In the program analysis method according to the present invention, the unit extraction unit extracts a program sentence that is a component of a program for each source program from a plurality of source programs, and saves it in a tabular file , common elements The extraction unit extracts a program sentence that is only one program sentence in each source program and exists in all of the plurality of source programs as a common element, and stores it in the common element list data . In the second step, the semi-common element extraction unit extracts program sentences existing in a plurality of source programs as quasi-common elements within the same range delimited by the common elements of each source program, and stores them in the quasi-common element list data . third step, and the non-common element extraction unit, it either common elements and quasi common elements The stored program statements in a table format extracted as non-common elements, including a fourth step of storing the non-common component list data, the second, each element extracted by the third and fourth steps of The extracted original source program and the classification code indicating the position in the source program are given.
この発明は、以上説明したように、単位抽出部が、複数のソースプログラムからソースプログラムごとにプログラムの構成要素であるプログラム文を抽出し、表形式のファイルに保存する第一のステップ、共通要素抽出部が、プログラム文のうち、各ソースプログラム内で一つしかないプログラム文であり、かつ複数のソースプログラムのすべてに存在するプログラム文を共通要素として抽出し、共通要素一覧データに保存する第二のステップ、準共通要素抽出部が、各ソースプログラムの共通要素で区切られた同じ範囲において、複数のソースプログラムに存在するプログラム文を準共通要素として抽出し、準共通要素一覧データに保存する第三のステップ、及び非共通要素抽出部が、共通要素と準共通要素のどちらでもない表形式で保存されたプログラム文を非共通要素として抽出し、非共通要素一覧データに保存する第四のステップを含み、第二、第三及び第四の各ステップで抽出された各要素には、抽出された元のソースプログラムと、そのソースプログラムの中での位置を示す分類コードが付与されているので、構造化プログラミングされていないプログラムでも、再利用可能な部品単位に分割することができる。 In the present invention, as described above, the unit extraction unit extracts a program sentence that is a component of a program for each source program from a plurality of source programs, and saves it in a tabular file , common elements The extraction unit extracts a program sentence that is only one program sentence in each source program and exists in all of the plurality of source programs as a common element, and stores it in the common element list data . In the second step, the semi-common element extraction unit extracts program sentences existing in a plurality of source programs as quasi-common elements within the same range delimited by the common elements of each source program, and stores them in the quasi-common element list data . third step, and the non-common element extracting section, stored in tabular form neither common elements and quasi common elements Extract the program statement as a non-common elements, including a fourth step of storing the non-common component list data, the second, each element extracted by the third and fourth steps of the extracted Since the original source program and the classification code indicating the position in the source program are assigned, even a program that is not structured programming can be divided into reusable component units.
実施の形態1.
図1は、この発明の実施の形態1によるプログラム分析方法を示す概念図である。
図1において、プログラム分析方法は、5つの抽出部と3つの一覧データを有している。
3つの一覧データは、以下に示すプログラム文の3分類のそれぞれに対応するものである。
共通要素:1つのソースプログラム内で唯一無二のプログラム文であり、すべてのソースプログラムに存在しているもの。プログラムにより順番が入れ替わっているものは、共通要素とはしない。
準共通要素:複数のソースプログラムに存在する文であって、共通要素でないもの。ただし、共通要素により区切られた同じ範囲にあるものに限る。複数の連続するプログラム文が準共通要素に該当する場合は、まとめて1個の準共通要素とする。なお、他の準共通要素との前後関係も考慮するが、それについては後で説明する。
非共通要素:共通要素でも準共通要素でもないもの。
単語/記号/数字の単位抽出部2は、ソースプログラム1が入力され、単語/記号/数字の単位で区切ったプログラムの断片を抽出して、1個のプログラム文が1行に対応するように表形式で保存する。(図2のステップS01参照)。共通要素抽出部3は、1つのプログラム内で唯一無二のプログラム文で、すべてのソースプログラムに存在しているものを共通要素として抽出し、発見された順番に共通要素一覧データ7に保存する。(図2のステップS02、ステップS03参照)。
FIG. 1 is a conceptual diagram showing a program analysis method according to
In FIG. 1, the program analysis method has five extraction units and three list data.
The three list data correspond to each of the following three classifications of program sentences.
Common element: A unique program statement in one source program, which exists in all source programs. Those whose order has been changed by the program is not a common element.
Quasi-common element: A sentence that exists in multiple source programs and is not a common element. However, it must be within the same range delimited by common elements. When a plurality of continuous program statements correspond to quasi-common elements, they are collectively set as one quasi-common element. In addition, although the context with other quasi-common elements is also considered, this will be described later.
Non-common element: An element that is neither a common element nor a quasi-common element.
The word / symbol / number
共通要素間プログラム文抽出部4は、一つのソースプログラム内で連続する共通要素の間に存在しているプログラム文を抽出する。準共通要素抽出部5は、複数のソースプログラムについて共通要素間プログラム文抽出部4によって抽出された、同じ共通要素の間に存在していたプログラム文同士を比較することを繰り返して、発見した準共通要素を準共通要素一覧データ8に登録する。(図2のステップS04参照)。
非共通要素抽出部6は、共通要素一覧データ7および準共通要素一覧データ8に登録されている各要素を、単語/記号/数字の単位で区切った表形式のデータから削除し、残ったプログラム文を、発見された順番に非共通要素一覧データ9に登録する。(図2のステップS05参照)。
なお、共通要素、準共通要素、非共通要素をまとめてプログラム要素ということもある。
The inter-common element program sentence extraction unit 4 extracts program sentences existing between consecutive common elements in one source program. The quasi-common element extraction unit 5 repeatedly compares the program sentences existing between the same common elements extracted by the inter-common element program sentence extraction unit 4 for a plurality of source programs, and found the quasi-common The common element is registered in the semi-common element list data 8. (See step S04 in FIG. 2).
The non-common
Common elements, semi-common elements, and non-common elements may be collectively referred to as program elements.
図2は、この発明の実施の形態1によるプログラム分析方法の処理を示すフローチャートである。
FIG. 2 is a flowchart showing processing of the program analysis method according to
図3は、この発明の実施の形態1によるプログラム分析方法において表形式のデータであるプログラム文を作成する処理を説明するフローチャートである。
図3(a)はフローチャートであり、図3(b)はステップS12の処理内容を示す図である。
FIG. 3 is a flowchart for explaining processing for creating a program sentence that is tabular data in the program analysis method according to the first embodiment of the present invention.
FIG. 3A is a flowchart, and FIG. 3B is a diagram showing the processing content of step S12.
図4は、この発明の実施の形態1によるプログラム分析方法においてプログラム中で唯一無二のプログラム文を抽出する処理を説明するフローチャートである。 FIG. 4 is a flowchart for explaining processing for extracting a unique program sentence in a program in the program analysis method according to the first embodiment of the present invention.
図5は、この発明の実施の形態1によるプログラム分析方法において共通要素を抽出する処理を説明するフローチャートである。 FIG. 5 is a flowchart for explaining processing for extracting common elements in the program analysis method according to the first embodiment of the present invention.
図6は、この発明の実施の形態1によるプログラム分析方法において準共通要素を抽出する処理を説明するフローチャートである。
図7は、この発明の実施の形態1によるプログラム分析方法において準共通要素を抽出する処理での共通要素で区切られた範囲を説明する例を示す図である。
図8は、この発明の実施の形態1によるプログラム分析方法において準共通要素を抽出する処理を説明する例を示す図である。
図9は、この発明の実施の形態1によるプログラム分析方法において非共通要素を抽出する処理を説明するフローチャートである。
FIG. 6 is a flowchart for explaining the process of extracting the quasi-common element in the program analysis method according to the first embodiment of the present invention.
FIG. 7 is a diagram illustrating an example for explaining a range delimited by common elements in the process of extracting quasi-common elements in the program analysis method according to the first embodiment of the present invention.
FIG. 8 is a diagram showing an example for explaining the process of extracting the quasi-common element in the program analysis method according to the first embodiment of the present invention.
FIG. 9 is a flowchart illustrating processing for extracting non-common elements in the program analysis method according to the first embodiment of the present invention.
次に、動作について説明する。
プログラム分析方法を実現するプログラムによる制御動作は、図2のフローチャートのとおりである。
図2で、ステップS01(第一のステップ)は、ソースプログラム1から、単語/記号/数字の単位で区切った表形式により抽出する。次に、ステップS02にて、1つのプログラム内で1つしかないプログラム文を抽出し、次いで、ステップS03では、ステップS02で抽出したプログラム文がすべてのプログラム文に共通して存在しているプログラム文であれば、共通要素として、発見された順番に共通要素一覧データ7に保存する。(ステップS02、S03は、第二のステップを構成する。)
次に、ステップS04(第三のステップ)で、ソースプログラム内に存在する共通要素で区切られた範囲を前から順に処理して、その範囲に存在するプログラム文を各ソースプログラムから抜粋する。そして、異なるソースプログラムの同じ共通要素の間に存在していたプログラム文同士を比較し、少なくとも二つのプログラムで共通なプログラム文を、共通であるプログラム数ができるだけ多くなるようにして切り出し、順番に準共通要素一覧データ8に登録する。加えて、最初に一致する行と共通要素との相対行/列を記録する。
Next, the operation will be described.
The control operation by the program for realizing the program analysis method is as shown in the flowchart of FIG.
In FIG. 2, step S01 (first step) is extracted from the
Next, in step S04 (third step), the range delimited by the common elements existing in the source program is processed in order from the front, and the program statements existing in the range are extracted from each source program. Then, compare the program statements that existed between the same common elements of different source programs, cut out the program statements that are common to at least two programs so that the number of common programs is as large as possible, and Register in the quasi-common element list data 8. In addition, the relative row / column of the first matching row and common element is recorded.
最後に、ステップS05(第四のステップ)で、ステップS01で保存された表形式のデータから、共通要素一覧データ7および準共通要素一覧データ8に登録されている各要素を、単語/記号/数字の単位で削除し、空き行で挟まれたプログラム文を切り出し、発見された順番に非共通要素一覧データ9に登録する。加えて、プログラム内の非共通要素と共通要素との相対行/列を記録する。
ここで、登録とは、プログラム文がもつ分類コード(1)〜(9)を使い、ファイル名“(1)(2)(3)(4)(5)(6)(7)(8)(9)”としてTXTファイルで保存することをいう。なお、分類コード(1)〜(9)については後述する。
Finally, in step S05 (fourth step), each element registered in the common
Here, the registration uses the classification codes (1) to (9) of the program sentence, and the file names “(1) (2) (3) (4) (5) (6) (7) (8) (9) "" means saving as a TXT file. The classification codes (1) to (9) will be described later.
上述の手法を用いることにより、構造化されていないプログラム文においても、共通するプログラム文を機械的に抽出し、分類することができるようになっている。
なお、共通要素一覧データ7、準共通要素一覧データ8、非共通要素一覧データ9に保存されたプログラム文は、分類コードを付けて保存する。
By using the above-described method, common program sentences can be mechanically extracted and classified even in unstructured program sentences.
The program sentences stored in the common
ここで、分類コードとは、以下の情報を意味する。
(1):分析対象の複数のソースプログラムのすべてに含まれる共通要素か、2つ以上のソースプログラムに含まれる準共通要素か、1つだけ発見された非共通要素かという分類記号(共通要素:1、準共通要素:2、非共通要素:3)
(2):共通要素、準共通要素、非共通要素としてそれぞれ見つかった順番
(3):分析対象である複数のプログラムに含まれる要素であれば、要素を含んでいるプログラム数
(4): そのプログラム文よりも前にある共通要素の中で最も近くに存在する共通要素の番号。共通要素の場合は、自分の番号が入る。
(5):(4)に記録した共通要素との相対行数。共通要素の場合は、0になる。
(6):プログラム文の構成要素数。表形式における列の数。
(7):プログラムが作成された日付
(8):解析元プログラム番号
(9):解析元プログラム内の要素の行数
Here, the classification code means the following information.
(1): Classification symbol (common element) indicating whether it is a common element included in all of a plurality of source programs to be analyzed, a quasi-common element included in two or more source programs, or only one non-common element found : 1, Semi-common element: 2, Non-common element: 3)
(2): Order found as a common element, quasi-common element, and non-common element (3): If the element is included in a plurality of programs to be analyzed, the number of programs containing the element (4): The number of the closest common element among the common elements before the program statement. In the case of common elements, your number is entered.
(5): The relative number of rows with the common element recorded in (4). 0 for common elements.
(6): Number of program sentence components. Number of columns in tabular format.
(7): Date the program was created (8): Analysis source program number (9): Number of elements in the analysis source program
次に、分類コードの例について説明する。
「解析プログラムがソースプログラム内を解析している際に3番目に見つかった準共通要素で、5つのソースプログラムの中で2つのソースプログラムに含まれている準共通要素は、3列であり、ソースプログラムBにおいて10行目に存在し、最も近い共通要素は3行目にある2番目の共通要素であり、この共通要素からの相対行数は7行である。ソースプログラムB(番号2)は2007/08/03に作成されている。」
という場合、上記「」内の文章を分類コードが決まる毎に区切って説明すると、以下の通りである。
Next, examples of classification codes will be described.
“The quasi-common element found third when the analysis program is analyzing the inside of the source program, the quasi-common elements included in two of the five source programs are in three columns, The closest common element that exists in the 10th line in the source program B is the second common element in the 3rd line, and the relative number of lines from this common element is 7. Source program B (number 2) Was created on 2007/08/03. "
In this case, the sentence in the above “” is divided and explained every time the classification code is determined as follows.
解析プログラムがソースプログラム内を解析している際に、
3番目に見つかった・・・・・・(2)は3
準共通要素で、・・・・・・・・(1)は2
5つのソースプログラムの中で2つのソースプログラムに含まれている・・・(3)は2
準共通要素は3列であり、・・・・・・・・・・・・・・・・・・(6)は3
ソースプログラムBにおいて10行目に存在し、・・・・・・・・(9)は10
最も近い共通要素は3列目にある2番目の共通要素であり、・・・(4)は2
この共通要素からの相対行数は7行である。・・・・・・・・・・(5)は7
ソースプログラムB(番号2)は ・・・・・・・・・・・・・・(8)は2
2007/08/03に作成されている。・・・・・・・・(7)は2007/08/03
以上をまとめると、
(1)2 (2)3 (3)2 (4)2 (5)7 (6)3
(7)20070803 (8)2 (9)10
となる。
When the analysis program is analyzing the source program,
Found third ... (2) is 3
Quasi-common element ... (1) is 2
Included in 2 source programs among 5 source programs ... (3) is 2
The quasi-common elements are 3 rows, ... (6) is 3
It exists in the 10th line in the source program B .... (9) is 10
The closest common element is the second common element in the third column, and (4) is 2
The relative number of rows from this common element is seven. ... (5) is 7
Source program B (number 2) is ... (8) is 2.
It is created on 2007/08/03. ... (7) is 2007/08/03
In summary,
(1) 2 (2) 3 (3) 2 (4) 2 (5) 7 (6) 3
(7) 20070803 (8) 2 (9) 10
It becomes.
次に、図3により、図2のステップS01について詳細に説明する。
図3(a)で、まず、ステップS11で、比較対象となる複数のソースプログラムにプログラム番号(1〜N)を付ける。これにより、分類コード(7)(8)が取得される。次いで、ステップS12で、次のプログラム番号のソースプログラムを空白・カンマ・括弧で区切り、単語/記号/数字の単位で表形式のフォーマットに読み込む。これにより、図3(b)のように読み込まれる。
次いで、ステップS13で、プログラム行間の改行、プログラム文内の構成要素間のスペースを削除する。ステップS14で、要素の行列を取得する。これにより、分類コード(9)(6)が取得される。次いで、ステップS15で、未確定な分類コードは♯とし、(1)〜(9)の分類コードをファイル名としてソースプログラム文を“♯♯♯♯♯♯(6)(7)(8)(9)”という名前で保存する。
Next, with reference to FIG. 3, step S01 of FIG. 2 will be described in detail.
In FIG. 3A, first, in step S11, program numbers (1 to N) are assigned to a plurality of source programs to be compared. Thereby, the classification codes (7) and (8) are acquired. Next, in step S12, the source program of the next program number is separated by blanks, commas, and parentheses, and read into a tabular format in units of words / symbols / numbers. As a result, the data is read as shown in FIG.
Next, in step S13, a line feed between program lines and a space between components in the program sentence are deleted. In step S14, a matrix of elements is acquired. Thereby, classification codes (9) and (6) are acquired. Next, in step S15, the undetermined classification code is #, and the source program sentence is “###### (6) (7) (8) (with the classification codes (1) to (9) as file names). 9) Save the file as “”.
次に、図4により、図2のステップS02の処理について詳細説明する。
先ず、ステップS21で、プログラム番号N番の表形式のファイルを読み込む。ステップS22で、次の行に含まれている単語/記号/数字(プログラム文)を読み込む。次いで、ステップS23で、プログラム番号N番の表形式のファイルの全行を順に処理して、S22で読み込んだ行と同一の行が、1行以上あるかどうかを判定し、NOであれば、ステップS24で、読み込まれた単語/記号/数字を基準キーワードとして登録する。YESであれば、ステップS22に戻る。ステップS24に次いで、ステップS25で、プログラム番号N番の最後の行かどうかを判定し、YESであれば、終了し、NOであれば、ステップS22に戻る。
Next, the process of step S02 of FIG. 2 will be described in detail with reference to FIG.
First, in step S21, a tabular file of program number N is read. In step S22, the word / symbol / number (program sentence) included in the next line is read. Next, in step S23, all the rows of the table-format file of program number N are processed in order, and it is determined whether there are one or more rows that are the same as the rows read in S22. In step S24, the read word / symbol / number is registered as a reference keyword. If YES, the process returns to step S22. Following step S24, in step S25, it is determined whether or not it is the last line of program number N. If YES, the process ends. If NO, the process returns to step S22.
次に、図5により、図2のステップS03の処理について詳細に説明する。
まず、ステップS31で、次の基準キーワードを読み出す。ステップS32で、基準キーワードがすべてのソースプログラムにおいて、最も新しく見つかった共通要素よりも後の位置に含まれるかどうかを判定し、(これにより、分類コード(3)=N、(5)=0を取得する。)、NOであれば、ステップS31に戻り、YESであれば、ステップS33で、基準キーワードを行単位で共通要素として採番する。これにより、分類コード(1)(2)及び(4)=(2)を取得する。
次いで、ステップS34で、最後の基準キーワードかどうかを判定し、NOであれば、ステップS31に戻り、YESであれば、ステップS35で、(1)〜(9)の分類コードをファイル名としてソースプログラム文を“(1)(2)(3)(4)(5)(6)(7)(8)(9)”という名前に変更して保存する。
Next, the processing in step S03 in FIG. 2 will be described in detail with reference to FIG.
First, in step S31, the next reference keyword is read. In step S32, it is determined whether or not the reference keyword is included in a position after the most recently found common element in all the source programs (by this, the classification code (3) = N, (5) = 0. If NO, the process returns to step S31. If YES, the reference keyword is numbered as a common element line by line in step S33. Thereby, the classification codes (1) (2) and (4) = (2) are acquired.
Next, in step S34, it is determined whether or not it is the last reference keyword. If NO, the process returns to step S31. If YES, the classification code of (1) to (9) is used as the file name in step S35. The program sentence is renamed and saved as “(1) (2) (3) (4) (5) (6) (7) (8) (9)”.
次に、図6ないし図8により、準共通要素を抽出するステップS04の処理について例を用いて説明する。
まず、図6に示すフローチャートにおけるステップS41で、共通要素で区切られた範囲の先頭を処理対象とする。具体的には、ソースプログラムの先頭から1個目の共通要素までの範囲を処理対象とする。図7が処理対象の範囲の例である。
ステップS42では、各ソースプログラムについて処理対象の範囲を取り出す。ステップS43では、すべての2個のソースプログラムの組み合わせについて、同じプログラム文が存在するかどうか検索し、同じプログラム文を1行単位で準共通要素の候補として抽出する。ステップS44では、連続した行が準共通要素の候補として抽出されている場合に、それらをまとめられるかどうかチェックし、まとめられる場合はまとめる。ステップS45では、準共通要素のデータを作成する。ステップS46では、未処理の範囲があるかチェックする。未処理の範囲があれば、ステップS47で次の範囲を処理対象として、ステップS42に戻る。未処理の範囲がなければ、処理を終了する。
Next, with reference to FIGS. 6 to 8, the process of step S04 for extracting the quasi-common element will be described by using an example.
First, in step S41 in the flowchart shown in FIG. 6, the beginning of the range delimited by the common elements is set as the processing target. Specifically, the range from the beginning of the source program to the first common element is the processing target. FIG. 7 shows an example of the range to be processed.
In step S42, a processing target range is extracted for each source program. In step S43, it is searched whether or not the same program sentence exists for all the combinations of two source programs, and the same program sentence is extracted as a quasi-common element candidate in units of one line. In step S44, when continuous lines are extracted as quasi-common element candidates, it is checked whether they can be combined, and if they are combined, they are combined. In step S45, quasi-common element data is created. In step S46, it is checked whether there is an unprocessed range. If there is an unprocessed range, the next range is set as a processing target in step S47, and the process returns to step S42. If there is no unprocessed range, the process ends.
ステップS43の処理を、図8により説明する。図8(a)はプログラム1とプログラム2の間でのチェックが終了した段階であり、図8(b)はステップS43が終了した段階であり、図8(c)はステップS44が終了した段階である。2個のソースプログラムの組を処理する順番は、図8(a)の上部に示した順番とする。2個のソースプログラムの組は、1個のソースプログラム(基準プログラムと呼ぶ)について他のソースプログラムとのまだ処理していないすべての組み合わせをチェックすることを繰り返していくものとする。最初に、プログラム1と他のプログラムとの組み合わせを処理し、次にプログラム2に関する未処理の組み合わせを処理して、最後にプログラム3とプログラム4の組についてチェックする。
The process of step S43 will be described with reference to FIG. 8A is a stage where the check between the
2個のソースプログラムの間でのチェックでは、基準プログラムのプログラム文を前から順番に処理対象のプログラム文(基準プログラム文と呼ぶ)に決め、もう1個のソースプログラム(対象プログラムと呼ぶ)のプログラム文(対象プログラム文と呼ぶ)を前から順番に処理して、対象プログラム文が基準プログラム文と同じかどうかをチェックする。同じ場合には、基準プログラム文と対象プログラム文を準共通要素の候補として抽出する。準共通要素の候補が抽出できれば、基準プログラム文および対象プログラム文を、抽出した準共通要素の候補の次の行に移動させる。準共通要素の候補を抽出する際には、基準プログラム文が既に抽出された準共通要素の候補に含まれる場合は、対象プログラム文をその準共通要素の候補に追加する。
対象プログラム文が基準プログラム文と異なれば、次のプログラム文を対象プログラム文とし、対象プログラムにおいて最後のプログラム文を処理しても基準プログラム文と同じプログラム文が無い場合は、基準プログラム文を次のプログラム文に移動させる。こうして、すべての基準プログラム文に対して対象プログラム文とのチェックが終了すれば、2個のソースプログラムの間でのチェックを終了する。
In the check between two source programs, the program statement of the reference program is determined as the program statement to be processed (referred to as the reference program statement) in order from the front, and the other source program (referred to as the target program) is determined. Program statements (called target program statements) are processed in order from the front, and it is checked whether the target program statement is the same as the reference program statement. If they are the same, the reference program sentence and the target program sentence are extracted as quasi-common element candidates. If the semi-common element candidate can be extracted, the reference program sentence and the target program sentence are moved to the next line of the extracted semi-common element candidate. When extracting a quasi-common element candidate, if the reference program sentence is included in the already extracted quasi-common element candidates, the target program sentence is added to the quasi-common element candidate.
If the target program statement is different from the reference program statement, the next program statement is set as the target program statement, and if there is no program statement that is the same as the reference program statement even if the last program statement is processed in the target program, the reference program statement is Move to the program statement. In this way, when the check with the target program sentence is completed for all the reference program sentences, the check between the two source programs is finished.
図8(a)は、プログラム1を基準プログラムとし、プログラム2を対象プログラムとしてのチェックが終了した後の状態である。検出された準共通要素の候補を、枠で囲んで示す。また、すべての2個のソースプログラムの組み合わせについてチェックが終了した後の状態を図8(b)に示す。最初は、プログラム1とプログラム2の間で抽出された”AAA”という準共通要素の候補に、プログラム3のものも追加されている。”BBB”と”CCC”は、プログラム1とプログラム2において連続して配置されており、1個の準共通要素になるべきであるが、この段階では別の候補として抽出されている。
FIG. 8A shows a state after the check with the
ステップS44では、以下のような処理を行う。準共通要素の候補を順に処理対象(基準候補)に決め、基準候補を有するどれかのソースプログラムで、基準候補であるプログラム文の次の位置にあるプログラム文が準共通要素の候補であるかどうかをチェックする。準共通要素の候補(対象候補と呼ぶ)の場合は、基準候補を有するソースプログラムの集合と対象候補を有するソースプログラムの集合が同じ(要素に過不足が無いこと)であるかどうかチェックする。同じ場合には、対象候補と基準候補をまとめて1個の準共通要素とし、元の対象候補のプログラム文を次の基準候補とする。
準準共通要素の候補でないか、準準共通要素の候補であっても基準候補を有するソースプログラムの集合が同じでない場合は、基準候補をそのまま準共通要素にし、次の準共通要素の候補を基準候補にする。こうして、すべての準準共通要素の候補を処理して、図8(c)に示すように、”BBB”と”CCC”が1個の準共通要素になる。なお、例えば、プログラム4の2行目の”MMM”が仮に”BBB”というプログラム文であれば、”BBB”はプログラム1、プログラム2およびプログラム4に共通な準共通要素として抽出され、”CCC”がプログラム1とプログラム2に共通な準共通要素として抽出されたままである。
In step S44, the following processing is performed. The candidates for the quasi-common element are determined as processing targets (candidate candidates) in order, and in any source program that has the reference candidate, whether the program sentence at the next position of the program sentence that is the reference candidate is a candidate for the quasi-common element Check if. In the case of a quasi-common element candidate (referred to as a target candidate), it is checked whether the set of source programs having the reference candidate and the set of source programs having the target candidate are the same (the element has no excess or deficiency). If they are the same, the target candidate and the reference candidate are combined into one quasi-common element, and the program sentence of the original target candidate is set as the next reference candidate.
If it is not a quasi-common element candidate or if it is a quasi-semi-common element candidate but the set of source programs having the reference candidate is not the same, the reference candidate is used as a quasi-common element and the next quasi-common element candidate is selected. Make a reference candidate. In this way, all quasi-common element candidates are processed, and as shown in FIG. 8C, “BBB” and “CCC” become one quasi-common element. For example, if “MMM” on the second line of program 4 is a program sentence “BBB”, “BBB” is extracted as a quasi-common element common to
ステップS45では、分類コードの(1)には準共通要素であることを意味する2を、(2)に準共通要素として作成した順番を、(3)には準共通候補を有するプログラム数を、(4)には共通要素で区切られた範囲の前にある共通要素の番号を設定する。なお、1個目の共通要素よりも前の範囲では、ソースプログラムの先頭を仮想的な共通要素として、番号”0”を設定する。(5)には、各ソースプログラムにおける共通要素で区切られた範囲内での行数を設定する。(6)から(9)までは、ステップS11で決まっているので、このようにして求めた(1)から(5)までになるようにプログラム文のファイル名を修正して保存する。 In step S45, the classification code (1) indicates 2 indicating a quasi-common element, (2) indicates the order of creation as a quasi-common element, and (3) indicates the number of programs having quasi-common candidates. , (4), the number of the common element before the range delimited by the common element is set. In the range before the first common element, the number “0” is set with the head of the source program as the virtual common element. In (5), the number of lines within a range delimited by common elements in each source program is set. Since (6) to (9) are determined in step S11, the file name of the program sentence is corrected and saved so as to be obtained from (1) to (5).
図8(c)において、プログラム1の2行目とプログラム2の4行目はともに”GGG”であるが、準共通要素として抽出されていない。これは”BBB,CCC”という準共通要素を抽出したためである。”GGG”がプログラム1では、”BBB,CCC”よりも前にあり、プログラム2では後にあるので、準共通要素の前後関係が同じであることから、”GGG”と”BBB,CCC”のどちらかしか、準共通要素として抽出できない。このような状況を交差が発生していると呼ぶことにする。前に説明した準共通要素を抽出する処理方法は、準共通要素の候補を抽出すると、その次の行から検索をするので、交差する準共通要素を抽出することは無い。
In FIG. 8C, the second line of
なお、交差するものも含めて準共通要素の候補を抽出して、交差のために同時には準共通要素にできないものがある場合には、準共通要素の数が最大になるように選択するようにしてもよい。また、プログラム文があり準共通要素の候補となるプログラム文が、1個のソースプログラムにおいて同じものが複数ある場合は、どちらを準共通要素とするかも、準共通要素の数が最大になる方を選択するようにしてもよい。
共通要素に関して交差が発生する場合には、前に説明した処理方法では、先に発見したものを共通要素とし、交差するものは共通要素として抽出しない。共通要素と準共通要素のどちらかまたは両方の合計が大きくなる方を選択するようにしてもよいし、交差が発生するものは、どちらも共通要素としないようにしてもよい。
In addition, if quasi-common element candidates, including those that intersect, are extracted and there are things that cannot be made quasi-common elements at the same time due to intersections, select so that the number of quasi-common elements is maximized. It may be. Also, if there are multiple program statements that have program statements and are candidates for quasi-common elements, the source code that has the same number of quasi-common elements is the one that has the same number of quasi-common elements. May be selected.
In the case where an intersection occurs with respect to a common element, in the processing method described above, a previously discovered element is regarded as a common element, and an intersecting element is not extracted as a common element. Either the common element or the quasi-common element or the sum of both may be selected, or the one where the intersection occurs may not be the common element.
次いで、図9により、図2のステップS05の処理について詳細に説明する。
まず、ステップS61で、B=B+1を演算する。ステップS62で、C=C+1を演算する。
次いで、ステップS63で、“♯♯♯♯♯♯(6)(7)(8)(9)”という分類コードを持つ非共通要素の行番号(9)と、(8)が同じ数字の分類コードを持つ(1)=1でC番目の共通要素の行番号(9)との相対行(5)を取得し、最も小さな正数の相対行を持つ“♯♯♯♯♯♯(6)(7)(8)(9)”というファイル名を探す。
ステップS64で、発見されたファイルの行番号(9)は、C+1番目の共通要素の行番号(9)より小さいかどうかを判定し、NOであれば、ステップS62に戻り、YESであれば、ステップS65で、非共通要素である(1)=3、(3)=1とし、見つかった順番Bから(2)=B、関連する共通要素がCであることから、(4)=Cとして“(1)(2)(3)(4)(5)(6)(7)(8)(9)”という分類コードをつけて保存する。次いで、ステップS66で、“♯♯♯♯♯♯(6)(7)(8)(9)”が存在するかどうかを判定し、NOであれば、ステップS61に戻り、YESであれば、終了する。
Next, the processing in step S05 in FIG. 2 will be described in detail with reference to FIG.
First, in step S61, B = B + 1 is calculated. In step S62, C = C + 1 is calculated.
Next, in step S63, the line number (9) of the non-common element having the classification code “###### (6) (7) (8) (9)” and (8) have the same number classification. Get the relative row (5) with the row number (9) of the C-th common element with code (1) = 1 and have the smallest positive relative row “###### (6) Search for the file name (7) (8) (9) ".
In step S64, it is determined whether the line number (9) of the found file is smaller than the line number (9) of the C + 1th common element. If NO, the process returns to step S62. If YES, In step S65, (1) = 3, (3) = 1, which are non-common elements, and (2) = B from the found order B, and since the related common element is C, (4) = C A classification code “(1) (2) (3) (4) (5) (6) (7) (8) (9)” is attached and saved. Next, in step S66, it is determined whether or not “###### (6) (7) (8) (9)” exists. If NO, the process returns to step S61, and if YES, finish.
実施の形態1によれば、このように、複数のプログラムから共通部分を特定し、共通部分のプログラム上のロケーションを基点に他のプログラム文の位置関係を取得して、さらに分類していくという本手法により、プログラム内部に機能名やセクション名が入っていないような構造化されていないプログラムにおいても、プログラムを構成するプログラム文の分類が機械的に可能となる効果がある。 According to the first embodiment, in this way, a common part is identified from a plurality of programs, and the positional relationship of other program sentences is acquired based on the location of the common part on the program, and further classified. With this method, there is an effect that the program statements constituting the program can be classified mechanically even in an unstructured program in which no function name or section name is included in the program.
実施の形態2.
実施の形態1では、プログラム文を分析して類似度を3つの要素に分類してデータを保存する方法について述べたが、実施の形態2は、分類コードを使って、図10に示すように、表示順序を採番していき、分類コードの共通要素と準共通要素と非共通要素のコードを読み取って、列毎に分けて表示するようにした。これにより、一つのプログラムの構成を一目で分かるように表示することができる。
In the first embodiment, the method of analyzing the program sentence and classifying the similarity into three elements and storing the data has been described, but in the second embodiment, the classification code is used as shown in FIG. The display order was numbered, and the codes of common elements, semi-common elements, and non-common elements of the classification code were read and displayed separately for each column. As a result, the configuration of one program can be displayed so as to be understood at a glance.
図10は、この発明の実施の形態2によるプログラム分析方法の表示順序を決定するフローチャートである。
図11は、この発明の実施の形態2によるプログラム分析方法の単一プログラムのプログラム要素の状態の画面例を示す図である。
図11において、横軸の分類コード(1)の共通要素11、準共通要素12、非共通要素13について、それぞれ縦軸で見つかった順番にプログラム文を示している。
FIG. 10 is a flowchart for determining the display order of the program analysis method according to the second embodiment of the present invention.
FIG. 11 is a diagram showing a screen example of a program element state of a single program in the program analysis method according to the second embodiment of the present invention.
In FIG. 11, the program statements are shown in the order found on the vertical axis for the
次に、図10により、表示順序を決定するフローについて説明する。
ステップS70で、共通要素(n)に対して表示順を採番する。次いで、ステップS71で、共通要素(n)を分類コードに持っている要素の中で相対行の小さい順に上段から各要素に対して表示順を採番する。ステップS72で、n=n+1を演算する。ステップS73で、n>共通要素の最大数かどうかを判定し、NOであれば、ステップS70に戻り、YESであれば、終了する。
Next, a flow for determining the display order will be described with reference to FIG.
In step S70, the display order is assigned to the common element (n). Next, in step S71, the display order is assigned to each element from the top in the order of decreasing relative rows among the elements having the common element (n) in the classification code. In step S72, n = n + 1 is calculated. In step S73, it is determined whether n> the maximum number of common elements. If NO, the process returns to step S70, and if YES, the process ends.
分類コードから、プログラム文をソースプログラムに組み込まれた順序で表示する方法は、次のとおりである。
”分断したプログラム文の内で最も近くに存在している共通要素の分類コード”と“最も近くに存在している共通要素との相対距離にあたる行と文字数”から共通要素および非共通要素の表示行を決定する。
表示する要素は、図10に示すように、同プログラムの各要素に対して次の規則に従って採番する。
動作例を以下にあげる。
共通要素の1番を採番したのち、2番目の共通要素との間にある準共通要素および非共通要素を採番していく。1番目の共通要素を分類コードに持つ準共通要素および非共通要素について、1番目の共通要素との相対行の小さいものから順番に下段の行に表示する。
次に、2番の共通要素を採番し、その共通要素に属する準共通要素および非共通要素を2番目の共通要素との相対行の小さいものから順番に下段の行に表示する・・・といったサイクルで、順次、表示順序を決めて、図11のように表示する。
The method for displaying the program statements in the order in which they are incorporated in the source program from the classification code is as follows.
Display of common elements and non-common elements from "the classification code of the nearest common element in the divided program statements" and "the number of lines and characters corresponding to the relative distance from the nearest common element" Determine the line.
As shown in FIG. 10, the displayed elements are numbered according to the following rules for each element of the program.
An example of operation is given below.
After numbering the common element No. 1, the quasi-common element and the non-common element between the second common element are numbered. The quasi-common element and the non-common element having the first common element in the classification code are displayed in the lower row in order from the smallest relative row to the first common element.
Next, the second common element is numbered, and the quasi-common element and non-common element belonging to the common element are displayed in the lower row in order from the smallest relative row to the second common element ... In such a cycle, the display order is sequentially determined and displayed as shown in FIG.
実施の形態2によれば、このように、表示対象の分類コードを元に、表示する要素の表示順序を採番する手法を用いることで、すべてのプログラム文を、共通要素に対する相対行で表示することが可能となる効果がある。 According to the second embodiment, as described above, by using the method of assigning the display order of the elements to be displayed based on the classification code to be displayed, all program sentences are displayed in relative lines to the common elements. There is an effect that can be done.
実施の形態3.
実施の形態2では、ソースプログラムの構成を一目で識別出来るような方法について述べたが、それぞれの要素が分析対象である複数のソースプログラム内にどの程度含まれていたかを確認することが出来ない。そこで、実施の形態3では、複数のソースプログラムの中で存在していたすべての要素について、ソースプログラム内での有無を表形式で表示するようにした。
In the second embodiment, a method has been described in which the configuration of the source program can be identified at a glance. However, it cannot be confirmed how much each element is included in the plurality of source programs to be analyzed. . Therefore, in the third embodiment, the presence or absence in the source program is displayed in a table format for all elements existing in the plurality of source programs.
図12は、この発明の実施の形態3によるプログラム分析方法のプログラム要素の全プログラムの含有状態の画面例を示す図である。
図12において、分類コードをもとに、プログラム名と作成日付を横軸、複数のソースプログラムの中で存在していたすべての要素(同一行のものは1つの要素として扱う)を縦軸にして、プログラム内での有無を表形式で表示している
FIG. 12 is a diagram showing a screen example of the inclusion status of all programs in the program elements of the program analysis method according to the third embodiment of the present invention.
In FIG. 12, based on the classification code, the horizontal axis represents the program name and creation date, and the vertical axis represents all the elements existing in multiple source programs (the same line is treated as one element). The presence or absence in the program is displayed in a table format.
実施の形態3によれば、このように、分類コードを使って、各要素のプログラム内の含有状況を一目で確認することが出来るように、表形式で表示可能としたため、バグや特化プログラムを分析する際に、調査すべきプログラムのロケーションを抽出することが容易となる効果がある。 According to the third embodiment, bugs and specialized programs can be displayed in a tabular format so that the content of each element in the program can be confirmed at a glance using the classification code. When analyzing, it is easy to extract the location of the program to be investigated.
実施の形態4.
実施の形態3では、複数のプログラムで使用されている状態が一目で確認出来るようにしたが、実施の形態4は、この実施の形態3のような表示形式を使用して、縦軸に記載されているプログラム要素を複数選択し、選択されたプログラム要素を保存されている一覧データから読み込んで、選択された順に組み合せてプログラムを構築するようにしたものである。
Embodiment 4 FIG.
In the third embodiment, the state of being used in a plurality of programs can be confirmed at a glance. However, the fourth embodiment uses the display format as in the third embodiment and is described on the vertical axis. A plurality of selected program elements are selected, the selected program elements are read from stored list data, and a program is constructed by combining them in the selected order.
図13は、この発明の実施の形態4によるプログラム分析方法の生成するプログラムの含有要素を設定する画面例を示す図である。
図13において、図12の画面例にチェック欄を設け、プログラム要素を選択できるようにした。
図14は、この発明の実施の形態4によるプログラム分析方法のプログラム再構築の処理を示すフローチャートである。
FIG. 13 is a diagram showing an example of a screen for setting the inclusion elements of the program generated by the program analysis method according to the fourth embodiment of the present invention.
In FIG. 13, a check field is provided in the screen example of FIG. 12 so that program elements can be selected.
FIG. 14 is a flowchart showing program reconstruction processing of the program analysis method according to the fourth embodiment of the present invention.
実施の形態4は、図13に示すチェック欄にプログラム要素を選択するためのチェックマークを入れることで、図14に示すような、該当するデータの取得と、選択された順にプログラム要素を組み合せてプログラムを表形式で生成し、テキスト形式で出力することで、プログラムを再構築する。 In the fourth embodiment, a check mark for selecting a program element is put in the check column shown in FIG. 13 to obtain the corresponding data as shown in FIG. 14 and combine the program elements in the selected order. The program is reconstructed by generating the program in tabular format and outputting it in text format.
次いで、図14に基づき、このときのフローについて説明する。
まず、ステップS81で、分類コードのリストのn番目(ただし、初回はn=1)のデータを読み込む。次いで、ステップS82で、プログラム生成用の表のn行目にデータを書き込む。ステップS83で、n=n+1を演算する。次いで、ステップS84で、nが分類コードのリストの最大数を超えているかどうかを判定し、超えていると、終了し、超えていなければ、ステップS81に戻る。
Next, the flow at this time will be described with reference to FIG.
First, in step S81, the nth data (however, n = 1 at the first time) in the list of classification codes is read. In step S82, data is written in the nth row of the program generation table. In step S83, n = n + 1 is calculated. Next, in step S84, it is determined whether n exceeds the maximum number of classification code lists. If it exceeds, the process ends. If not, the process returns to step S81.
実施の形態4によれば、この手法により、準共通要素や非共通要素にバグや不要なプログラムが含まれていることが分かった場合、使用者が実施の形態3で示した表を見ながら、問題の箇所を入れ替えたり、削除してプログラムを生成し直すことができる。
また、リスト形式で編集することで容易にプログラム再構築を行える効果がある。
According to the fourth embodiment, when it is found that a quasi-common element or a non-common element contains a bug or an unnecessary program by this method, the user looks at the table shown in the third embodiment. The program can be regenerated by replacing or deleting the problem part.
In addition, the program can be easily reconstructed by editing the list format.
実施の形態5.
実施の形態5は、分類コードにおいて、分析対象である複数のソースプログラムに含まれる要素で2つ以上のプログラムに含まれているが、その要素が作られた日付より後のソースプログラム内に含まれていない要素である場合には、該当のソースプログラムとその要素を検出するプログラムである。
Embodiment 5 FIG.
In Embodiment 5, in the classification code, the elements included in the plurality of source programs to be analyzed are included in two or more programs, but are included in the source program after the date when the elements were created. In the case of an element that is not included, the corresponding source program and a program for detecting the element are included.
図15は、この発明の実施の形態5によるプログラム分析方法の問題要素を抽出する処理を示すフローチャートである。
非共通要素については、分類コードに含まれる日付データを取得し、その日付データがもっとも新しいソースプログラムの作成日付のものをリストアップする。
FIG. 15 is a flowchart showing processing for extracting problem elements in the program analysis method according to the fifth embodiment of the present invention.
For non-common elements, the date data included in the classification code is acquired, and the date data with the most recent source program creation date is listed.
実施の形態5は、図15に示すとおり、すべての準共通要素の分類コードに含まれる日付データを取得し、その日付データが最も新しいプログラムの作成日付でない分類コードをリストアップする。
すなわち、ステップS91で、分析に使用したすべてのソースプログラムの作成日時をソースプログラムからそれぞれ取得する。次いで、ステップS92で、すべてのソースプログラムの作成日時の中で最新の日時を選定する。次いで、ステップS93で、分析して得られたすべての準共通要素の分類コードの中で、最新の日時が含まれていない分類コードをリスト形式で記録する。
In the fifth embodiment, as shown in FIG. 15, the date data included in the classification codes of all the quasi-common elements is acquired, and the classification code whose date data is not the creation date of the newest program is listed.
That is, in step S91, the creation dates and times of all source programs used for analysis are acquired from the source programs. Next, in step S92, the latest date / time is selected from the creation dates / times of all source programs. Next, in step S93, among all the quasi-common element classification codes obtained by analysis, the classification codes that do not include the latest date and time are recorded in a list format.
実施の形態5によれば、このように、分類コードに含まれているプログラム要素の製作された日付や、プログラム要素が含まれたプログラム数から、同一機能のソースプログラムの中で記述に差異のある準共通要素や非共通要素を機械的に推定することが可能となる効果がある。
最新の日付でない準共通要素と最新の日付の非共通要素を抽出する場合で説明したが、日付としては最新でなくてもよく、いずれかのソースプログラムの作成日付でもよい。抽出する対象も指定した日付のもの、指定した日付よりも新しいもの、指定し日付の前後の所定期間のものなど、所定の時間関係にあるソースプログラムに含まれる準共通要素と非共通要素のどちらかまたは両方をリスト形式で表示するようにしてもよい。
According to the fifth embodiment, there is a difference in the description in the source program having the same function from the date when the program element included in the classification code was produced and the number of programs including the program element. There is an effect that a certain quasi-common element and non-common element can be estimated mechanically.
Although the case where the semi-common element that is not the latest date and the non-common element of the latest date are extracted has been described, the date may not be the latest, and the creation date of any source program may be used. The target to be extracted is either a specified date, a newer than the specified date, a specified period before or after the specified date, such as a quasi-common element or non-common element included in the source program that has a predetermined time relationship Alternatively, both may be displayed in a list format.
1 ソースプログラム
2 単語/記号/数字の単位抽出部
3 共通要素抽出部
4 共通要素間プログラム文抽出部
5 準共通要素抽出部
6 非共通要素抽出部
7 共通要素一覧データ
8 準共通要素一覧データ
9 非共通要素一覧データ
11 共通要素
12 準共通要素
13 非共通要素
DESCRIPTION OF
Claims (6)
共通要素抽出部が、上記プログラム文のうち、各ソースプログラム内で一つしかないプログラム文であり、かつ複数のソースプログラムのすべてに存在する上記プログラム文を共通要素として抽出し、共通要素一覧データに保存する第二のステップ、
準共通要素抽出部が、各ソースプログラムの上記共通要素で区切られた同じ範囲において、複数のソースプログラムに存在するプログラム文を準共通要素として抽出し、準共通要素一覧データに保存する第三のステップ、
及び非共通要素抽出部が、上記共通要素と上記準共通要素のどちらでもない上記表形式で保存されたプログラム文を非共通要素として抽出し、非共通要素一覧データに保存する第四のステップを含み、
上記第二、第三及び第四の各ステップで抽出された上記各要素には、抽出された元のソースプログラムと、そのソースプログラムの中での位置を示す分類コードが付与されていることを特徴とするプログラム分析方法。 A first step in which a unit extraction unit extracts a program sentence that is a component of a program for each source program from a plurality of source programs, and stores the program sentence in a tabular file ;
The common element extraction unit extracts, as a common element, a program sentence that is only one program sentence in each source program and exists in all of the plurality of source programs, and common element list data The second step to save ,
A quasi-common element extraction unit extracts program sentences existing in a plurality of source programs as quasi-common elements within the same range delimited by the common elements of each source program, and stores them in quasi-common element list data Step,
And a non-common element extraction unit extracts, as a non-common element, a program sentence stored in the table format that is neither the common element nor the quasi-common element, and stores the non-common element list data in a fourth step . Including
Each element extracted in each of the second, third and fourth steps is assigned with an original source program extracted and a classification code indicating a position in the source program. A characteristic program analysis method.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2008193652A JP5020184B2 (en) | 2008-07-28 | 2008-07-28 | Program analysis method and program creation method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2008193652A JP5020184B2 (en) | 2008-07-28 | 2008-07-28 | Program analysis method and program creation method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2010033249A JP2010033249A (en) | 2010-02-12 |
| JP5020184B2 true JP5020184B2 (en) | 2012-09-05 |
Family
ID=41737664
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2008193652A Expired - Fee Related JP5020184B2 (en) | 2008-07-28 | 2008-07-28 | Program analysis method and program creation method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP5020184B2 (en) |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH0588863A (en) * | 1991-09-27 | 1993-04-09 | Kyoraku Co Ltd | Program development supporting system |
| JPH10149301A (en) * | 1996-11-19 | 1998-06-02 | Hitachi Ltd | Script creation device |
| JP2007115155A (en) * | 2005-10-24 | 2007-05-10 | Hitachi Software Eng Co Ltd | Program structure management device and program structure management program |
-
2008
- 2008-07-28 JP JP2008193652A patent/JP5020184B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2010033249A (en) | 2010-02-12 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP6542612B2 (en) | Test scenario generation support apparatus and test scenario generation support method | |
| JP2012248050A (en) | Static analysis support device, static analysis support method, and program | |
| JP5898584B2 (en) | Hexahedral mesh generator | |
| CN104797993B (en) | System Build Auxiliary Device | |
| JP5282522B2 (en) | Information management apparatus, information management method, and information management program | |
| WO2020170401A1 (en) | Information processing device, information processing method, and information processing program | |
| JP5020184B2 (en) | Program analysis method and program creation method | |
| JPWO2009011057A1 (en) | Application analysis program, application analysis method, and application analysis apparatus | |
| JP2015036876A (en) | Screen automatic generation apparatus, screen automatic generation program, and screen automatic generation method | |
| JP6737063B2 (en) | Software asset management device, software asset management method, and software asset management program | |
| JP7345446B2 (en) | Data display program and programmable display | |
| JP5504212B2 (en) | Test case automatic generation system, test case automatic generation method, and test case automatic generation program | |
| JP4958848B2 (en) | Costing calculation device and costing calculation method | |
| KR20090005684A (en) | Shape trademark search providing system and method, Shape trademark database, Shape database creation method and system, Client shape trademark search system and method on client side, Storage medium with built-in client shape trademark retrieval program | |
| JP2018022433A (en) | Control program, apparatus, and method | |
| JP2007026389A (en) | Data input device | |
| JP6322291B2 (en) | Document processing apparatus and item extraction method | |
| JP5535270B2 (en) | Document component analysis apparatus and program | |
| JP2010244439A (en) | Apparatus, method and program for preparing check list | |
| JP5315890B2 (en) | Evaluation system and evaluation method | |
| JP2020101898A (en) | Design drawing support method, design drawing support device, and design drawing support program | |
| JP6741045B2 (en) | Data input device, data input method and program | |
| JP5581894B2 (en) | Data processing program automatic generation system | |
| JP2019016201A (en) | Program comparison method, program comparison device, and program comparison program | |
| JP6699433B2 (en) | Data management program, device, and method |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20091208 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20110119 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20120208 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20120221 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20120329 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20120515 |
|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20120612 |
|
| R151 | Written notification of patent or utility model registration |
Ref document number: 5020184 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20150622 Year of fee payment: 3 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| LAPS | Cancellation because of no payment of annual fees |