JP3881103B2 - Variable classification apparatus and storage medium storing the program - Google Patents

Variable classification apparatus and storage medium storing the program Download PDF

Info

Publication number
JP3881103B2
JP3881103B2 JP00575098A JP575098A JP3881103B2 JP 3881103 B2 JP3881103 B2 JP 3881103B2 JP 00575098 A JP00575098 A JP 00575098A JP 575098 A JP575098 A JP 575098A JP 3881103 B2 JP3881103 B2 JP 3881103B2
Authority
JP
Japan
Prior art keywords
variable
information
type
program
rule table
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
Application number
JP00575098A
Other languages
Japanese (ja)
Other versions
JPH11203116A (en
Inventor
賢児 長橋
昭彦 松尾
美奈子 木村
敬子 川辺
三八 上原
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP00575098A priority Critical patent/JP3881103B2/en
Publication of JPH11203116A publication Critical patent/JPH11203116A/en
Application granted granted Critical
Publication of JP3881103B2 publication Critical patent/JP3881103B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Description

【0001】
【発明の属する技術分野】
コンピュータプログラムの作成および変更を支援するプログラム変数分類装置に関するものであり,コンピュータシステムで使用されているコンピュータプログラム(以後,プログラムと称する)の変数の変数の内容もしくは用途の種類を分類して出力する装置に関するものである。
【0002】
金融システム,医療システム等のコンピュータシステムのプログラムは膨大な大きさであり,多数の変数が使用されている。しかし,その変数の定め方はプログラマーによりまちまちであり,プログラムの変更,拡張等を行うためには,それらの変数についての情報を必要とするが,プログラム作成者でないプログラマーがプログラムを見てもその変数の表す内容もしくは用途(例えば,金額,郵便番号等)を簡単に見分けることが困難である。
【0003】
【従来の技術】
従来のコンピュータプログラム作成・変更支援装置では,プログラムで使用されている変数に対して変数の型を問い合わせる機能,変数の使用箇所を問い合わせる機能を備えるだけである。そして,プログラムの変更・保守等をする時は,プログラマは既存のプログラムを解析しながらプログラムで使用されている変数の意味(内容,用途等)を理解しプログラムの変更,保守等を行っていた。
【0004】
【発明が解決しようとする課題】
前述したように,金融システム,医療システム等のプログラムは膨大な大きさであり,多種多様の変数が使用されている。そして,例えば,金融システムの場合,数量,金額,住所,郵便番号等に対してプログラム作成者はその変数名を設定するが,通常はそのように決めた変数名に対してその内容がわかるようにはプログラムに明記しない。一方,プログラムの変更,保守等を行う場合にはこれらの変数の内容ないし用途(金額,日付等)を知ることが必要である。
【0005】
現状の技術ではプログラムを保守するプログラマーがプログラムを調査して推測するしか方法がないため,多数の変数をもつプログラムに対する作業量は非常に大きく,誤りも生じ易かった。
【0006】
本発明は,プログラム中の変数を分類して保存し,オペレータの問い合わせにより,変数の種類,用途を判定し,出力するプログラムの分類予測装置を提供することを目的とする。
【0007】
【課題を解決するための手段】
プログラムで使用されている変数の内容や用途は変数に施されている演算や含まれる文字によってある程度分類できる。例えば,金額では加減乗除の演算が行われたり,「¥」や「$」などの通貨記号文字が含まれるので,演算での変数の使われ方を解析することにより変数の内容,用途を推定できる。また,郵便番号は通常加減乗除などの演算は行われないので,そのことから推定できる。このようにプログラムで使用されている変数についての情報を収集し,解析することにより変数を分類することができる。
【0008】
本発明は,プログラムで使用される変数の用途を推定する変数分類装置において,変数に関する情報と変数の内容もしくは用途の関係を定めた変数分類規則表を備え,プログラムで変数に適用される演算の種類もしくは変数に関する情報を収集し,収集された変数情報について変数分類規則表を参照し,プログラムで使用されている変数の内容もしくは用途を推定して分類するようにした。
更に詳しくは、本発明の構成は次の通りである。
(1) :変数に適用される演算の種類に関する情報と、前記演算の種類から推定される用途とを対応させた変数分類規則表を記憶する変数分類規則表記憶手段と、プログラムで使用されている処理命令から変数に適用される演算の種類に関する情報を収集する変数情報収集手段と、前記変数情報収集手段で収集した情報について前記変数分類規則表記憶手段に記憶された変数分類規則表を参照し、前記収集された演算の種類に関する情報と一致する前記変数分類規則表の演算の種類に対応する用途を、前記プログラムで使用されている変数の用途として推定して分類する変数分類手段とを備えることを特徴とするプログラムの変数分類装置。
(2) :変数に適用される演算の種類に関する情報もしくは変数の型に関する情報と、前記演算の種類もしくは変数の型から推定される用途とを対応させた変数分類規則表を記憶する変数分類規則表記憶手段と、プログラムで使用されている処理命令から変数に適用される演算の種類を、もしくは変数の定義から変数の型に関する情報を収集する変数情報収集手段と、前記変数情報収集手段で収集した情報について前記変数分類規則表記憶手段に記憶された変数分類規則表を参照し、前記収集された演算の種類もしくは変数の型に関する情報と一致する前記変数分類規則表の演算の種類もしくは変数の型と対応する用途を、前記プログラムで使用されている変数の用途として推定して分類する変数分類手段とを備え、前記プログラムで使用されている変数において、その変数とデータの受渡しのある変数を列挙したデータ授受グループがある場合に、前記変数分類手段は、データ授受グループに列挙されている変数に対して推定された用途に共通の用途のみを残し、それ以外の用途はその変数から削除する方法で前記推定した用途を限定することを特徴とするプログラムの変数分類装置。
(3) :前記(2) のプログラムの変数分類装置において、前記変数分類手段は、変数に適用される演算の種類に関する情報と用途とを対応させた変数分類規則表と、変数の型に関する情報と用途とを対応させた変数分類規則表の異なる変数分類規則表により推定された変数の用途についての複数の推定結果に基づいて、共通の用途のみを残し、それ以外の用途はその変数の用途から削除する方法で変数の用途を限定することを特徴とするプログラムの変数分類装置。
(4) :コンピュータを、変数に適用される演算の種類に関する情報と、前記演算の種類から推定される用途とを対応させた変数分類規則表を記憶する変数分類規則表記憶手段と、プログラムで使用されている処理命令から変数に適用される演算の種類に関する情報を収集する変数情報収集手段と、前記変数情報収集手段で収集した情報について前記変数分類規則表記憶手段に記憶された変数分類規則表を参照し、前記収集された演算の種類に関する情報と一致する前記変数分類規則表の演算の種類に対応する用途を、前記プログラムで使用されている変数の用途として推定して分類する変数分類手段として機能させるためのプログラムを格納したコンピュータ読み取り可能な記憶媒体。
【0009】
図1は,本発明の基本構成を示すものである。
図1において,
1は変数分類装置である。
【0010】
11はソースプログラムであって,変数を分類する対象のプログラムである。12は変数情報収集手段であって,ソースプログラムで使用されている変数についての情報を収集するものであり,プログラムで使用されている変数の型や名前などの変数の定義に関する情報,変数に対して行われる演算,操作,代入されている定数値,変数などの情報を収集するものである。
【0011】
13は変数情報保持手段であって,変数情報を保持するものである。
14は変数分類手段であって,変数情報保持手段に保持されている変数情報を利用者が利用し易いように内容,用途を分類するものである。
【0012】
141は変数分類規則表であって,変数に関する情報と変数の内容もしくは用途の関係を定めたものである。
15は検索手段であって,変数分類装置1に登録されている変数の内容,用途等を問い合わせる手段である。
【0013】
図1の本発明の基本構成の動作を説明する。
変数情報収集手段12は,ソースプログラム11で使用されているすべての変数を列挙し,それらの変数の各々について,その定義内容(変数の型などの情報),変数を参照している処理命令,多岐変数とのデータの授受関係などの情報を収集する。そして,収集した変数情報を変数情報保持手段13に保持する。そして変数分類手段14はそのようにして収集された変数情報について,変数分類規則表141を参照し,変数の内容もしくは用途を推定する。
【0014】
変数の内容もしくは用途の推定は以下のような方法で行う。
▲1▼ 変数を参照している全ての処理命令から変数に代入されている値と,変数に直接適用されている演算の種別を収集し,その情報に基づいて変数の用途として推定されるものを列挙する。
【0015】
▲2▼ あるいは,変数の定義から,変数の型に関する情報を収集し,それに基づいて変数の用途として推定されるものを列挙する。
▲3▼ ▲1▼もしくは▲2▼で求められた推定結果に対して,変数間のデータの授受関係の情報を元に同一種のデータを授受している変数のグループを求め,それらの間で共通している用途だけを残して他を削除することにより,列挙された変数の用途を限定する。
【0016】
▲4▼ 同一の演算式の中で参照されている変数の間の関係を調べ,変数の用途が満たすべき関係を計算し,それを満たすことのできる各変数の用途だけを残して他を削除することにより,列挙された変数の用途を限定する。
【0017】
利用者は検索手段15に検索内容を指示する。そして,検索手段15は変数情報保持手段13を検索し,問い合わせのあった変数の内容,用途をディスプレイ等に出力する。
【0018】
本発明によれば,大規模なコンピュータシステムのプログラムであっても,膨大な変数について容易にその内容,用途を知ることができる。そのため,プログラムの変更,拡張,保守等の能率が大幅に向上する。
【0019】
【発明の実施の形態】
以下の説明においては,本発明の実施の形態をCOBOL言語を使用して記述されたプログラムを例として説明するが,本発明の対象とするプログラム言語は必ずしもCOBOL言語に限られるわけではない。
【0020】
COBOL言語では変数に対して演算を行う処理命令としては,ADD文,SUBTRACT文,DIVIDE文,MULTIPLY文,COMPUTE文,MOVE文,ACCEPT文などの更新文が該当する。またIF文,EVALUATE文,PERFORM文,SEARCH文などの条件分岐文も分岐条件計算の中で変数に対する演算を行うことがある。変数に適用される演算としては,加減乗除の四則演算およびべき乗の演算が分類に利用可能である他,特殊な演算としては,端末画面への表示装置や,組み込み函数の引数として使用している場合や,数字の下2桁のみを取り出す等の部分参照の操作なども利用可能である。ここでは四則演算のみによる場合を例として説明する。
【0021】
図2は本発明の実施の形態の装置構成を示す。
図2において,
1は変数分類装置である。
【0022】
11はソースプログラムである。
12は変数情報収集手段である。
131は変数情報データベースであって,収集された変数情報を保持するものである(図1の変数情報保持手段13に相当する)。
【0023】
14は変数分類手段である。
141は変数分類規則表であって,変数の用途の集合と変数の型,適用演算式等の変数についての情報に対応してもつものであり,変数についての情報を指定することによりそれらの用途として推定される用途の集合を返す処理手続の集まりとして実現される。用途の候補は対象とするプログラムが扱う分野を考慮してあらかじめ利用者が用意する。
【0024】
15は検索手段である。
21は構文解析装置であって,ソースプログラムの構文解析をするものである。
【0025】
22はデータフロー解析装置であって,構文解析されたプログラムのデータフローを解析するものである。
23はプログラム解析情報データベースであって,プログラムの解析情報をもつものである。
【0026】
24は端末装置である。
図2の構成の動作を説明する。
変数情報収集手段12は,プログラム解析情報データベースから変数情報を収集し,変数情報データベース131に格納する(変数情報の具体例については図4参照)。この変数情報の収集はデータフロー分析,ドメイン分析等の既存技術により可能である(特願平8−99745号等参照)。解析の対象は一つのCOBOLプログラムに限定されることはなく,複数のプログラムに属する変数に対して一括して処理を行うことができる。変数分類手段14は変数分類規則表141を参照し,変数情報データベース131の変数情報を分類する。変数分類手段14の動作の詳細は後述する。利用者は,端末装置24を使用して検索手段15に検索項目を入力し,変数についての必要な情報を検索する。
【0027】
図3は本発明のシステム構成の実施の形態の形態である。
図3において,
111はコンピュータである。
【0028】
112はCPUである。
113はメモリである。
114は入出力インタフェースである。
【0029】
115はドライブ装置であって,記憶媒体151のドライブ装置である。
116はディスプレイである。
117はプリンタである。
【0030】
121は外部記憶装置1であって,システムプログラムを保持するものである。
122はシステムプログラム(ソースプログラム)である。
【0031】
125は外部記憶装置2であって,システムデータベースを保持するものである。
126はシステムデータべースであって,システムのデータべースである。
【0032】
130は外部記憶装置3であって,構文解析プログラム,データフロー解析プログラム,プログラム解析情報データべースを保持するものである。
132は構文解析プログラムである。
【0033】
134はデータフロー解析プログラムである。
136はプログラム解析情報データべースである。
138は外部記憶装置4であって,変数情報データべース,変数分類規則表を保持するものである。
【0034】
140は変数情報データべースである。
142は変数分類規則表である。
151は記憶媒体であって,本発明の変数分類装置に必要なプログラムを保持するものである。
【0035】
153は変数情報収集プログラムであり,CPU,メモリ等とにより変数収集手段を構成するものである。
155は変数分類プログラムであり,CPU,メモリ等とにより変数分類手段を構成するものである。
【0036】
157は変数分類規則作成プログラムである。
159は検索プログラムであり,CPU,メモリ等とにより検索手段を構成するものである。
【0037】
図4はソースプログラムの例であり,COBOL言語のプログラムである。
ステップ732のFREC.は上位変数であり,以下の変数PR,DT,AMT,TXR,I−CNTの上位変数である。
【0038】
ステップ733は変数PRの定義であり,8桁の数値であることを表す。
ステップ734は変数DTの定義であり,6桁の数値であることを表す。
ステップ735は変数AMTの定義であり,4桁の数値であることを表す。
【0039】
ステップ736は変数TXRの定義であり,少数点以下に2桁の数値があることを表す。
ステップ737は変数I−CNTの定義であり,4桁の数値があることを表す。
【0040】
ステップ738のDSP.は上位変数であり,変数PP,YMD,TTL,PSTNOの上位変数である。
ステップ739は変数PPの定義であり,6桁の数値であって,3桁毎にカンマ(,)が挿入される負の数値であることを表す。
【0041】
ステップ740は変数YMDの定義であり,6桁の数値であって,3桁毎にスラッシュ(/)が挿入される数値であることを表す。
ステップ741は変数TTLの定義であり,4桁の数値であって,3桁目にカンマ(,)が挿入される数値であることを表す。
【0042】
ステップ742は変数PSTNOの定義であり,5桁の数値であることを表す。
ステップ742は変数TPPの定義であり,9桁の数値であることを表す。
【0043】
ステップ1325は命令であり,TPPにゼロを代入することを命令するものである。
ステップ1555は演算命令であり,TPP=TPP+PR*(TXR+1)を演算することを命令するものである。
【0044】
ステップ1556は命令であり,PPにTPPの値を代入することを命令するものである。
ステップ1557は加算命令であり,TTLにAMTの値を代入することを命令するものである。
【0045】
ステップ1558は命令であり,YMDにDTの値を代入することを命令するものである。
ステップ1559は加算命令であり,I−CNTに1を加算することを命令するものである。
【0046】
図5は収集された変数情報の例である。
31は変数情報であって,図4のプログラムの変数についての変数情報である。
【0047】
データ授受グループは図4のプログラムにおいて任意の変数においてその変数とデータの受渡しのある変数を列挙したものである。
例えば,変数DTの型はPIC9(6)(6桁の数値)であり,ステップ1558の命令“MOVE DT TO YMD”で使用され,そこで変数YMDとデータの授受があることを表している。
【0048】
図6は本発明の用途推定方法1である。
図6 (a)は用途推定規則1で使用する変数分類規則表である。
41は変数分類規則表1である。
【0049】
変数が適用されている演算(適用演算)により変数を推定する表である。例えば,郵便番号,性別,氏名,日付は加減乗除の演算の対象にならないので,四則演算で使用されていない変数は郵便番号,性別,氏名,日付に用途を分類する。また,年度は加減算のみで使用されると推定され,個数も加減算のみで使用されることがあるので,加減算のみに使用されている変数は用途を表のように分類する。さらに,年数,税率,利率,金額,個数は,加減算と乗算に使用されると推定されるので用途を表のように分類する。
【0050】
変数分類規則表1はユーザが作成するか,デフォルト値として予め製品を出荷する時に予め作成しておき,ユーザが変更するようにしておいても良い。
図6 (b)は用途の変数分類規則表1(41)に基づいて求めた推定結果の例である。図5の変数情報データベースに対して,図6 (a)の変数分類規則表1(41)を適用して求めた各変数の用途の推定結果である。
【0051】
図5の変数情報データべースにおいて,変数PRは加減算と乗算に使用されているので変数PRの用途は年数,税率,利率,金額,個数のいずれかであると推定する。また,変数DTは加減乗除が一切ないので,郵便番号,性別,氏名,日付の変数であると推定される。
【0052】
このように,各変数の用途を推定して,図6 (b)の推定結果を求めることができる。
図7は本発明の用途推定方法1のフローチャートである。
【0053】
図7のプログラムステップに従ってフローチャートを説明する。
S1 変数Vの使用箇所Lの処理命令から,変数Vの前後の演算子を得る。
S2 変数Vの前後に演算子があるか判定する。
【0054】
S3 S2の判定において,Vの前後になく唯一個だけであればその唯一の演算子をOPとする。
S4 S2の判定において,Vの前後に演算子があればその優先度の高い方(優先度は予め決めておく)の演算子をOPとする。
【0055】
S5 求めたOPを変数Vに対応付けて変数データベースに追加記録する。
S6 全ての使用箇所Lについて繰り返し,変数Vに対応する演算子OPを求め,変数データべースに記録する。
【0056】
S7 変数分類規則表1より,変数Vに対応付けられている演算子の組み合わせに該当する用途を取り出し,変数Vに対応付けて,変数データベースに記録する。
【0057】
S8 全ての変数Vに対して以上の処理を繰り返す。
図8は本発明の用途の推定方法2を示す図である。
COBOL言語の場合,変数の型の情報としてデータ項目記述のPICTURE句,USAGE句の記述を用いて,変数の用途を推定できる。これらの型情報から少数点の有無,編集文字(変数に値が代入された時に常に特定の位置に自動的に配置される文字),桁数,値として許される文字種などの情報が得られる。これらの情報をもとに用途を推定し,変数分類規則表を作成する。
【0058】
図8 (a)は,本発明の変数分類規則表2であって,変数の型の情報と用途の関係を推定して用途を定めるための表である。
51は変数分類規則表2である。
【0059】
型の特徴として少数点を含む変数は,税率,利率と推定できるのでそのように用途を分類する。また,通貨記号や“CD”,“DB”など通貨に関連する特定の文字列を含む変数は金額に推定できるので,その金額に用途を分類する。以下同様に図8 (a)の変数分類規則表2を作成しておく。
【0060】
なお,図8 (a)の変数分類規則表2では表されていないが,変数を代入した結果の値(数値,文字列等)により用途を推定できるので,その対応をつけるようにしても良い。
【0061】
図8 (b)は変数分類規則表2に基づいて求めた用途の推定結果の例である。
図5の変数情報データべースの各変数について,図8 (a)の変数分類規則表2を適用して求めた変数の用途の推定結果である。
【0062】
TXRは小数点を含む数値の変数であるので,変数分類規則表2に従って,税率,利率に分類する。
PPはカンマ(,)を含み,通貨記号をもつので金額に分類する。
【0063】
YMDは‘/’が挿入されるで,年月日に分類する。
TTLはカンマ(,)を含むので金額,個数に分類する。
PSTNOは5桁の数字なので郵便番号に分類する。
【0064】
図9は本発明の用途の推定方法2のフローチャートである。
S1 型に基づく用途の変数分類規則表2により,変数Vに対応付けられている演算子の組み合わせに該当する用途を取り出す。
【0065】
S2 変数Vに対等付けて変数情報データべースに記録する。
S3 全ての変数Vに対して以上の処理を繰り返す。
図10は本発明の用途の推定方法3を示す。
【0066】
本発明の用途の推定方法3は,前述の方法で各変数に対して推定された用途と任意の変数のデータ授受グループに列挙されている変数に対して推定された用途に共通の用途のみを残し,それ以外の用途はその変数の用途から削除する方法である。
【0067】
図5の変数情報データべースの変数について,図8 (b)の用途の推定結果に対して,本発明の用途の推定方法3を適用すると次のようになる。
変数DTのデータ授受グループの変数はYMDである。推定結果2において,変数DTの用途は未定であり,変数YMDの用途は日付である。従って,変数DTの用途を日付に分類する。
【0068】
同様に,変数AMTのデータ授受グループの変数はYMDであり,用途の推定結果2のAMTは未定であり,TTLの用途は金額,個数であるので,TTLの用途を金額,個数に分類する。
【0069】
以下同様にして,図10の (b)の用途の推定結果の例を得ることができる。
図10 (a)は,本発明の用途の推定方法3のフローチャートである。
S1 用途集合Sに変数Vの用途集合を設定する。
【0070】
S2 データ授受グループに列挙されている変数Wの用途の集合をTとする。
S3 SとTの各集合(共通部分)をSに設定する。
S4 データ授受グループに列挙された全ての変数Wについて以上の処理を繰り返す。
【0071】
S5 すべての変数Wに対して以上の処理を繰り返す。
図11は本発明の用途の推定方法4を示す。
上記の推定方法1,2もしくは3で求められていない変数については,それらを元に,以下に説明する推定方法で求めることができる。
【0072】
演算式とそこで使用されている変数の用途の間には一定の関係があると推定できるので,本発明の推定方法4は,演算式と変数用途の関係を変数分類規則表として求めておく。そして,変数情報データべースの演算式についてその変数分類規則表を当てはめて変数の用途を推定する。
【0073】
図11 (a)は用途の推定方法4の変数分類規則の例である。
61は変数分類規則表4である。
金額と税率には金額=金額*税率の関係があるので,その関係を規則とする。同様にカウンタ=カウンタ+定数,カウンタ=カウンタ−定数,金額=金額*税率等の関係をもとに変数分類規則表4を作成しておく。
【0074】
図11 (b)は変数分類規則表4に基づく推定結果の例である。
図5の変数情報データべースの照合対象の式62について説明する。
照合対象の式62の1+TXRに照合規則7を適用し,TXRが税率もしくはカウンタであると推定する(カウンタは制御に必要な数値であって,実際の業務で使用する項目を表す変数ではない)。次にTXRが税率であることから(1+TXR)も税率であり,照合対象の式PR*(1+TXR)に照合規則1を適用し,PRが金額であることを推定する。さらに,PR*(1+TXT)が金額であることから,TPP+PR*(1+TXT)に照合規則9を適用し,TPPが金額であることを推定する。カウンタには乗算の演算は含まれていないので適用規則1,9の過程では除外される。
【0075】
図12は本発明の用途の推定方法4のフローチャートである。
S1 用途の集合Sを空集合とする。
S2 既に処理した処理文か判定する。処理文でなければS3の処理を行う。すでに処理した文であれば,次の使用箇所LについてS9の処理を行う。
【0076】
S3 処理文から演算式Eを得る。
S4 式Eに適合する演算規則の集合Rを演算規則表から検索する。
S5 Rは発見されたか判定し,あれば,S6の処理を行う。なければ次の使用箇所LについてS9の処理を行う。
【0077】
S6 Rの中で変数Vに照合した部分の用途Uを得る。
S7 用途Uは変数Vの用途に含まれているか判定し,含まれていればS8の処理をする。なければ次の使用箇所LについてS9の処理をする。
【0078】
S8 Sに用途Uを加える。
S9 すべての使用箇所LについてS2〜S8の処理を繰り返す。
S10 用途集合Sは空か判定し,空でなければS11の処理をする。空集合であればS12で次の変数VについてS12の処理を繰り返す。
【0079】
S12 全ての変数Vについて上記の処理を繰り返す。
なお,このフローチャートにおいて,S4の式の照合は,パターンマッチングアルゴリズムなどの既存技術を用いることができる。
【0080】
【発明の効果】
本発明によれば,プログラムで使用されている全ての変数に対して自動的に行うことができる。そのため,従来の変数の用途の調査に費やされた膨大な作業時間を削減でき,大規模ソフトウェアシステムの調査,維持等の効率を大幅に引き上げることができる。
【図面の簡単な説明】
【図1】本発明の基本構成を示す図である。
【図2】本発明の実施の形態を示す図である。
【図3】本発明のシステム構成の実施の形態を示す図である。
【図4】ソースプログラムの例である。
【図5】本発明の収集された変数情報の例である。
【図6】本発明の用途推定方法1を示す図である。
【図7】本発明の用途推定方法1のフローチャートである。
【図8】本発明の用途推定方法2を示す図である。
【図9】本発明の用途の推定方法2のフローチャートである。
【図10】本発明の用途の推定方法3を示す図である。
【図11】本発明の用途の推定方法4を示す図である。
【図12】本発明の用途の推定方法4のフローチャートを示す図である。
【符号の説明】
1:変数分類装置
11:ソースプログラム
12:変数情報収集手段
13:変数保持手段
14:変数分類手段
141:変数分類規則表
15:検索手段
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a program variable classification device that supports the creation and modification of computer programs, and classifies and outputs the contents of variable variables or types of uses of computer programs used in computer systems (hereinafter referred to as programs). It relates to the device.
[0002]
Computer system programs such as financial systems and medical systems are enormous in size and use many variables. However, the method of defining the variable varies depending on the programmer. To change or extend the program, information about those variables is required. Even if a programmer who is not the program creator views the program, It is difficult to easily distinguish the contents or uses (for example, money amount, zip code, etc.) represented by a variable.
[0003]
[Prior art]
A conventional computer program creation / change support apparatus only has a function for inquiring a variable type for a variable used in the program and a function for inquiring a variable usage location. And when changing or maintaining a program, the programmer understood the meaning (contents, usage, etc.) of the variables used in the program while analyzing the existing program, and changed or maintained the program. .
[0004]
[Problems to be solved by the invention]
As described above, programs such as financial systems and medical systems are enormous in size, and a wide variety of variables are used. For example, in the case of a financial system, the program creator sets the variable name for the quantity, amount, address, postal code, etc., but usually the contents of the variable name so determined can be understood. Is not specified in the program. On the other hand, when changing or maintaining a program, it is necessary to know the contents and usage (amount, date, etc.) of these variables.
[0005]
With the current technology, programmers who maintain the program have no choice but to investigate and guess the program, so the amount of work for the program with a large number of variables is very large and errors are likely to occur.
[0006]
An object of the present invention is to provide a program classifying and predicting apparatus for classifying and storing variables in a program, determining the type and use of the variable by an operator's inquiry, and outputting the program.
[0007]
[Means for Solving the Problems]
The contents and uses of variables used in the program can be classified to some extent by the operations performed on the variables and the characters included. For example, addition / subtraction / multiplication / division calculations are performed on monetary amounts, and currency symbol characters such as “¥” and “$” are included, so the contents and usage of variables can be estimated by analyzing how variables are used in calculations. it can. In addition, postal codes are usually not subject to calculations such as addition, subtraction, division, and division, and can be estimated from that. Thus, it is possible to classify variables by collecting and analyzing information on variables used in the program.
[0008]
  The present invention provides a variable classification apparatus for estimating the use of a variable used in a program, comprising a variable classification rule table that defines the relationship between the information about the variable and the content of the variable or the use of the variable. Information about types or variables was collected, and the variable information collected was referred to the variable classification rule table, and the contents or uses of variables used in the program were estimated and classified.
  More specifically, the configuration of the present invention is as follows.
  (1):From variable classification rule table storage means for storing a variable classification rule table in which information related to the type of operation applied to a variable is associated with a use estimated from the type of calculation, and processing instructions used in the program Variable information collection means for collecting information on the type of operation applied to the variable, and information collected by the variable information collection means with reference to the variable classification rule table stored in the variable classification rule table storage means, the collection Variable classification means for estimating and classifying the usage corresponding to the type of computation in the variable classification rule table that matches the information regarding the type of computation performed as the usage of the variable used in the program. A variable classification device for programs.
  (2):Variable classification rule table storage means for storing a variable classification rule table in which information on the type of operation applied to a variable or information on a variable type is associated with a use estimated from the type of operation or variable type; The variable information collecting means for collecting the type of operation applied to the variable from the processing instruction used in the program or the variable type from the variable definition, and the information collected by the variable information collecting means Refers to the variable classification rule table stored in the variable classification rule table storage means, and corresponds to the operation type or variable type of the variable classification rule table that matches the collected operation type or variable type information. Variable classification means for estimating and classifying a use as a use of a variable used in the program, and used in the program When there is a data transfer group that enumerates the variables and variables with data transfer, the variable classifying means only uses common to the applications estimated for the variables listed in the data transfer group The variable classification apparatus for a program is characterized in that the estimated use is limited by a method of deleting the other uses from the variables.
  (3): (2)In the variable classification apparatus for a program, the variable classification means includes a variable classification rule table that associates information about types of operations applied to variables and uses, and variable classification that associates information about types of variables and uses. Based on multiple estimation results for variable uses estimated by different variable classification rule tables in the rule table, only common uses are left, and other uses are excluded from the variable uses. A variable classification device for programs characterized by limiting.
  (Four) :A computer uses a variable classification rule table storage means for storing a variable classification rule table that associates information about the type of operation applied to a variable with a use estimated from the type of operation, and is used in a program Refer to the variable classification rule table stored in the variable classification rule table storage means for the information collected by the variable information collection means for collecting information on the type of operation applied to the variable from the processing instruction. , Function as variable classification means for estimating and classifying the usage corresponding to the type of operation of the variable classification rule table that matches the information regarding the type of the collected operation as the usage of the variable used in the program A computer-readable storage medium storing a program for storing the program.
[0009]
FIG. 1 shows the basic configuration of the present invention.
In FIG.
1 is a variable classification device.
[0010]
Reference numeral 11 denotes a source program, which is a target program for classifying variables. 12 is a variable information collecting means for collecting information about variables used in the source program. For variable information such as variable type and name used in the program, It collects information about operations, operations, constant values assigned, variables, etc.
[0011]
Reference numeral 13 denotes variable information holding means for holding variable information.
Reference numeral 14 denotes variable classification means for classifying the contents and uses so that the user can easily use the variable information held in the variable information holding means.
[0012]
Reference numeral 141 denotes a variable classification rule table that defines the relationship between information about variables and the contents or uses of variables.
A search means 15 is a means for inquiring about the contents, uses, etc. of the variables registered in the variable classification device 1.
[0013]
The operation of the basic configuration of the present invention shown in FIG. 1 will be described.
The variable information collecting means 12 enumerates all variables used in the source program 11, and for each of those variables, the definition content (information such as variable type), the processing instruction referring to the variable, Collect information such as data exchange relations with various variables. The collected variable information is held in the variable information holding means 13. Then, the variable classification unit 14 refers to the variable classification rule table 141 for the variable information collected in this way, and estimates the content or use of the variable.
[0014]
The contents or usage of variables are estimated by the following method.
(1) Collecting values assigned to variables from all processing instructions that refer to variables and types of operations that are directly applied to variables, and estimating the usage of variables based on that information Is enumerated.
[0015]
{Circle around (2)} Alternatively, information on variable types is collected from the variable definitions, and those estimated as variable uses based on the information are listed.
(3) For the estimation result obtained in (1) or (2), obtain a group of variables that are sending / receiving the same type of data based on the information on the data transfer relationship between variables, and Limit the usage of the enumerated variables by removing only those that are common to and deleting others.
[0016]
(4) Investigate the relationship between the variables referenced in the same arithmetic expression, calculate the relationship that the variable uses should satisfy, and delete all but the use of each variable that can satisfy it To limit the use of the enumerated variables.
[0017]
The user instructs the search means 15 about the search contents. Then, the search means 15 searches the variable information holding means 13 and outputs the contents and usage of the inquired variable to a display or the like.
[0018]
According to the present invention, even a program of a large-scale computer system can easily know the contents and uses of enormous variables. Therefore, the efficiency of program change, expansion, maintenance, etc. is greatly improved.
[0019]
DETAILED DESCRIPTION OF THE INVENTION
In the following description, the embodiment of the present invention will be described by taking a program described using the COBOL language as an example. However, the program language targeted by the present invention is not necessarily limited to the COBOL language.
[0020]
In the COBOL language, update statements such as an ADD statement, a SUBTRACT statement, a DIVIDE statement, a MULTIPLY statement, a COMPUTE statement, a MOVE statement, and an ACCEPT statement correspond to processing instructions for performing operations on variables. In addition, conditional branch statements such as IF statement, EVALUATE statement, PERFORM statement, SEARCH statement, and the like may perform operations on variables in the branch condition calculation. Arithmetic operations of addition, subtraction, multiplication, division, and exponentiation can be used for classification as operations applied to variables, and special operations are used as display devices on terminal screens and arguments of built-in functions. In some cases, a partial reference operation such as extracting only the last two digits of the number can also be used. Here, a case using only four arithmetic operations will be described as an example.
[0021]
FIG. 2 shows an apparatus configuration according to the embodiment of the present invention.
In FIG.
1 is a variable classification device.
[0022]
Reference numeral 11 denotes a source program.
Reference numeral 12 denotes variable information collection means.
Reference numeral 131 denotes a variable information database which holds collected variable information (corresponding to the variable information holding means 13 in FIG. 1).
[0023]
Reference numeral 14 denotes variable classification means.
141 is a variable classification rule table corresponding to information about variables such as a set of variable uses, variable types, and applicable arithmetic expressions. It is realized as a collection of processing procedures that return a set of uses estimated as. The users are prepared in advance in consideration of the fields handled by the target program.
[0024]
Reference numeral 15 denotes search means.
Reference numeral 21 denotes a syntax analysis device that analyzes the syntax of a source program.
[0025]
Reference numeral 22 denotes a data flow analyzing apparatus for analyzing the data flow of a program whose syntax has been analyzed.
Reference numeral 23 denotes a program analysis information database having program analysis information.
[0026]
Reference numeral 24 denotes a terminal device.
The operation of the configuration of FIG. 2 will be described.
The variable information collection unit 12 collects variable information from the program analysis information database and stores it in the variable information database 131 (see FIG. 4 for a specific example of variable information). This variable information can be collected by existing techniques such as data flow analysis and domain analysis (see Japanese Patent Application No. Hei 8-99745). The object of analysis is not limited to one COBOL program, and processing can be performed on variables belonging to a plurality of programs in a lump. The variable classification unit 14 refers to the variable classification rule table 141 and classifies the variable information in the variable information database 131. Details of the operation of the variable classification means 14 will be described later. The user uses the terminal device 24 to input a search item to the search means 15 and searches for necessary information about the variable.
[0027]
FIG. 3 shows an embodiment of the system configuration of the present invention.
In FIG.
Reference numeral 111 denotes a computer.
[0028]
Reference numeral 112 denotes a CPU.
Reference numeral 113 denotes a memory.
Reference numeral 114 denotes an input / output interface.
[0029]
Reference numeral 115 denotes a drive device, which is a drive device for the storage medium 151.
Reference numeral 116 denotes a display.
Reference numeral 117 denotes a printer.
[0030]
Reference numeral 121 denotes an external storage device 1 that holds a system program.
Reference numeral 122 denotes a system program (source program).
[0031]
Reference numeral 125 denotes an external storage device 2 that holds a system database.
A system database 126 is a system database.
[0032]
Reference numeral 130 denotes an external storage device 3, which holds a syntax analysis program, a data flow analysis program, and a program analysis information database.
Reference numeral 132 denotes a syntax analysis program.
[0033]
Reference numeral 134 denotes a data flow analysis program.
Reference numeral 136 denotes a program analysis information database.
Reference numeral 138 denotes an external storage device 4 which holds a variable information database and a variable classification rule table.
[0034]
Reference numeral 140 denotes a variable information database.
142 is a variable classification rule table.
Reference numeral 151 denotes a storage medium that holds a program necessary for the variable classification apparatus of the present invention.
[0035]
Reference numeral 153 denotes a variable information collection program, which constitutes variable collection means with a CPU, memory, and the like.
Reference numeral 155 denotes a variable classification program, which constitutes variable classification means with a CPU, memory, and the like.
[0036]
Reference numeral 157 denotes a variable classification rule creation program.
Reference numeral 159 denotes a search program, which constitutes search means with a CPU, memory, and the like.
[0037]
FIG. 4 shows an example of a source program, which is a COBOL language program.
In step 732, FREC. Is an upper variable, and is an upper variable of the following variables PR, DT, AMT, TXR, and I-CNT.
[0038]
Step 733 is a definition of the variable PR and represents an 8-digit numerical value.
Step 734 is a definition of the variable DT, which represents a 6-digit numerical value.
Step 735 is a definition of the variable AMT and represents a 4-digit numerical value.
[0039]
Step 736 is a definition of the variable TXR and represents that there are two-digit numerical values below the decimal point.
Step 737 is a definition of the variable I-CNT and represents that there is a 4-digit numerical value.
[0040]
The DSP. Is an upper variable, and is an upper variable of the variables PP, YMD, TTL, and PSTNO.
Step 739 is a definition of the variable PP, which is a 6-digit numerical value and represents a negative numerical value in which a comma (,) is inserted every 3 digits.
[0041]
Step 740 is a definition of the variable YMD, which indicates that the value is a 6-digit numerical value and a slash (/) is inserted every 3 digits.
Step 741 is a definition of the variable TTL, which represents a 4-digit numerical value with a comma (,) inserted in the third digit.
[0042]
Step 742 is a definition of the variable PSTNO and represents a 5-digit numerical value.
Step 742 is a definition of the variable TPP and represents a 9-digit numerical value.
[0043]
Step 1325 is an instruction for instructing substitution of zero for TPP.
Step 1555 is an operation instruction that instructs to calculate TPP = TPP + PR * (TXR + 1).
[0044]
Step 1556 is an instruction for instructing to substitute the value of TPP into PP.
Step 1557 is an addition instruction for instructing to substitute the value of AMT into TTL.
[0045]
Step 1558 is an instruction that instructs to substitute the value of DT into YMD.
Step 1559 is an addition instruction for instructing to add 1 to I-CNT.
[0046]
FIG. 5 is an example of collected variable information.
Reference numeral 31 denotes variable information, which is variable information regarding the variables of the program shown in FIG.
[0047]
The data transfer group is an enumeration of variables in the program shown in FIG.
For example, the type of the variable DT is PIC9 (6) (6-digit numerical value), which is used in the instruction “MOVE DT TO YMD” in step 1558, and indicates that there is data exchange with the variable YMD.
[0048]
FIG. 6 shows an application estimation method 1 of the present invention.
FIG. 6A is a variable classification rule table used in the usage estimation rule 1.
41 is a variable classification rule table 1.
[0049]
It is a table | surface which estimates a variable by the calculation (application calculation) to which the variable is applied. For example, since zip code, gender, name, and date are not subject to addition, subtraction, multiplication, and division operations, variables not used in the four arithmetic operations are classified into zip code, gender, name, and date. Also, since the year is estimated to be used only for addition and subtraction, and the number may be used only for addition and subtraction, variables used only for addition and subtraction are classified as shown in the table. In addition, the years, tax rates, interest rates, amounts, and numbers are estimated to be used for addition, subtraction, and multiplication.
[0050]
The variable classification rule table 1 may be created by the user, or may be created in advance when the product is shipped as a default value, and may be changed by the user.
FIG. 6B is an example of an estimation result obtained based on the variable classification rule table 1 (41) for use. FIG. 6 is an estimation result of the usage of each variable obtained by applying the variable classification rule table 1 (41) of FIG. 6 (a) to the variable information database of FIG.
[0051]
In the variable information database of FIG. 5, since the variable PR is used for addition / subtraction and multiplication, it is estimated that the use of the variable PR is any of years, tax rates, interest rates, amounts, and numbers. Further, since the variable DT has no addition / subtraction / division, it is presumed to be a postal code, gender, name, and date.
[0052]
In this way, it is possible to estimate the use of each variable and obtain the estimation result of FIG. 6 (b).
FIG. 7 is a flowchart of the usage estimation method 1 of the present invention.
[0053]
The flowchart will be described according to the program steps of FIG.
S1 Operators before and after the variable V are obtained from the processing instruction at the location L where the variable V is used.
S2: It is determined whether there are operators before and after the variable V.
[0054]
S3 In the determination of S2, if there is only one and not before and after V, the only operator is OP.
S4 In the determination of S2, if there is an operator before and after V, the operator with the higher priority (the priority is determined in advance) is set to OP.
[0055]
S5: The obtained OP is additionally recorded in the variable database in association with the variable V.
S6 Iterates for all the used locations L, finds the operator OP corresponding to the variable V, and records it in the variable database.
[0056]
S7: From the variable classification rule table 1, the usage corresponding to the combination of operators associated with the variable V is extracted, recorded in the variable database in association with the variable V.
[0057]
S8 The above process is repeated for all variables V.
FIG. 8 is a diagram showing an application estimation method 2 of the present invention.
In the case of the COBOL language, the use of the variable can be estimated by using the description of the PICTURE clause and the USAGE clause of the data item description as the variable type information. From this type information, information such as the presence or absence of decimal points, editing characters (characters that are always automatically placed at a specific position when a value is assigned to a variable), the number of digits, and the character types allowed as values are obtained. Based on this information, the usage is estimated and a variable classification rule table is created.
[0058]
FIG. 8 (a) is a variable classification rule table 2 according to the present invention, which is a table for estimating the relationship between the variable type information and the usage to determine the usage.
51 is a variable classification rule table 2.
[0059]
Variables that include a decimal point as a characteristic of the type can be estimated as a tax rate or interest rate, so use is classified as such. In addition, a variable including a specific character string related to currency such as a currency symbol, “CD”, “DB”, etc. can be estimated as an amount of money. Similarly, the variable classification rule table 2 of FIG.
[0060]
Although not shown in the variable classification rule table 2 in FIG. 8 (a), the usage can be estimated by the value (number, character string, etc.) as a result of substituting the variable. .
[0061]
FIG. 8B is an example of a use estimation result obtained based on the variable classification rule table 2.
FIG. 8 is an estimation result of the usage of a variable obtained by applying the variable classification rule table 2 of FIG. 8A for each variable in the variable information database of FIG.
[0062]
Since TXR is a numerical variable including a decimal point, it is classified into a tax rate and an interest rate according to the variable classification rule table 2.
Since PP includes a comma (,) and has a currency symbol, it is classified as a monetary amount.
[0063]
YMD is categorized as year / month / day with '/' inserted.
Since TTL includes a comma (,), it is classified into an amount and a number.
Since PSTNO is a five-digit number, it is classified as a postal code.
[0064]
FIG. 9 is a flowchart of the application estimation method 2 of the present invention.
The usage corresponding to the combination of operators associated with the variable V is extracted from the variable classification rule table 2 for usage based on the S1 type.
[0065]
S2 The variable V is recorded in the variable information database in equality.
S3 The above process is repeated for all variables V.
FIG. 10 shows the estimation method 3 of the application of the present invention.
[0066]
The usage estimation method 3 of the present invention is limited to the usage common to the usage estimated for each variable by the above-described method and the usage estimated for the variables listed in the data transfer group of any variable. The remaining usage is a method of deleting from the usage of the variable.
[0067]
When the usage estimation method 3 of the present invention is applied to the usage estimation results of FIG. 8B for the variables in the variable information database of FIG. 5, the following results.
The variable of the data exchange group of variable DT is YMD. In the estimation result 2, the usage of the variable DT is undetermined, and the usage of the variable YMD is date. Therefore, the usage of the variable DT is classified into dates.
[0068]
Similarly, since the variable of the data exchange group of variable AMT is YMD, the AMT of the usage estimation result 2 is undecided, and the usage of TTL is the amount and the number, the TTL usage is classified into the amount and the number.
[0069]
In the same manner, an example of the estimation result of the application shown in FIG. 10B can be obtained.
FIG. 10 (a) is a flowchart of the method 3 for estimating the application of the present invention.
S1 The usage set of the variable V is set in the usage set S.
[0070]
S2 Let T be the set of uses of the variable W listed in the data transfer group.
S3 Set each set (common part) of S and T to S.
S4 The above process is repeated for all variables W listed in the data transfer group.
[0071]
S5 The above process is repeated for all variables W.
FIG. 11 shows the estimation method 4 of the application of the present invention.
Variables not obtained by the above estimation methods 1, 2, or 3 can be obtained by the estimation method described below based on them.
[0072]
Since it can be estimated that there is a certain relationship between the arithmetic expression and the use of the variable used therein, the estimation method 4 of the present invention obtains the relation between the arithmetic expression and the variable use as a variable classification rule table. Then, the variable classification rule table is applied to the arithmetic expression of the variable information database to estimate the use of the variable.
[0073]
FIG. 11A shows an example of a variable classification rule of the usage estimation method 4.
61 is a variable classification rule table 4.
Since there is a relationship of money amount = money amount * tax rate between the amount of money and the tax rate, that relationship is a rule. Similarly, the variable classification rule table 4 is created based on the relationship of counter = counter + constant, counter = counter-constant, amount = amount * tax rate, and the like.
[0074]
FIG. 11B is an example of an estimation result based on the variable classification rule table 4.
The expression 62 to be collated in the variable information database in FIG. 5 will be described.
Applying collation rule 7 to 1 + TXR of the expression 62 to be collated, it is estimated that TXR is a tax rate or a counter (the counter is a numerical value necessary for control, not a variable representing an item used in actual work) . Next, since TXR is a tax rate, (1 + TXR) is also a tax rate, and collation rule 1 is applied to the expression PR * (1 + TXR) to be collated to estimate that PR is a monetary amount. Further, since PR * (1 + TXT) is a monetary amount, the collation rule 9 is applied to TPP + PR * (1 + TXT) to estimate that TPP is a monetary amount. Since the counter does not include multiplication, it is excluded in the process of application rules 1 and 9.
[0075]
FIG. 12 is a flowchart of the application estimation method 4 of the present invention.
S1 The use set S is an empty set.
S2 Judge whether the processed sentence has already been processed. If it is not a process statement, the process of S3 is performed. If the sentence has already been processed, the process of S9 is performed for the next use location L.
[0076]
S3 Obtain an arithmetic expression E from the processed statement.
S4: Search the operation rule table for a set R of operation rules conforming to the expression E.
S5 R determines whether it has been found, and if so, performs the process of S6. If not, the process of S9 is performed for the next use location L.
[0077]
In S6 R, the usage U of the part that is collated with the variable V is obtained.
S7 It is determined whether the usage U is included in the usage of the variable V. If it is included, the processing of S8 is performed. If not, the process of S9 is performed for the next use location L.
[0078]
S8 Use U is added to S.
S9: Repeat the process of S2 to S8 for all the used locations L.
S10 It is determined whether the usage set S is empty. If it is not empty, the process of S11 is performed. If it is an empty set, the process of S12 is repeated for the next variable V in S12.
[0079]
S12: The above process is repeated for all variables V.
In this flowchart, existing techniques such as a pattern matching algorithm can be used for matching the expression of S4.
[0080]
【The invention's effect】
According to the present invention, all variables used in the program can be automatically performed. As a result, the enormous amount of work time spent investigating the use of conventional variables can be reduced, and the efficiency of investigation and maintenance of large-scale software systems can be greatly increased.
[Brief description of the drawings]
FIG. 1 is a diagram showing a basic configuration of the present invention.
FIG. 2 is a diagram showing an embodiment of the present invention.
FIG. 3 is a diagram showing an embodiment of a system configuration of the present invention.
FIG. 4 is an example of a source program.
FIG. 5 is an example of collected variable information of the present invention.
FIG. 6 is a diagram showing an application estimation method 1 of the present invention.
FIG. 7 is a flowchart of an application estimation method 1 of the present invention.
FIG. 8 is a diagram showing an application estimation method 2 of the present invention.
FIG. 9 is a flowchart of an application estimation method 2 of the present invention.
FIG. 10 is a diagram showing an estimation method 3 of an application of the present invention.
FIG. 11 is a diagram showing an estimation method 4 of an application of the present invention.
FIG. 12 is a diagram showing a flowchart of an application estimation method 4 of the present invention.
[Explanation of symbols]
1: Variable classification device
11: Source program
12: Variable information collection means
13: Variable holding means
14: Variable classification means
141: Variable classification rule table
15: Search means

Claims (4)

変数に適用される演算の種類に関する情報と、前記演算の種類から推定される用途とを対応させた変数分類規則表を記憶する変数分類規則表記憶手段と、
プログラムで使用されている処理命令から変数に適用される演算の種類に関する情報を収集する変数情報収集手段と、
前記変数情報収集手段で収集した情報について前記変数分類規則表記憶手段に記憶された変数分類規則表を参照し、前記収集された演算の種類に関する情報と一致する前記変数分類規則表の演算の種類に対応する用途を、前記プログラムで使用されている変数の用途として推定して分類する変数分類手段と、
を備えることを特徴とするプログラムの変数分類装置。
Variable classification rule table storage means for storing a variable classification rule table in which information on the type of operation applied to a variable is associated with a use estimated from the type of operation;
Variable information collecting means for collecting information on the types of operations applied to variables from processing instructions used in the program;
Refer to the variable classification rule table stored in the variable classification rule table storage means for information collected by the variable information collection means, and the type of operation of the variable classification rule table that matches the information about the type of operation collected Variable classification means for estimating and classifying the use corresponding to the use of the variable used in the program;
Variable classifier program, characterized in that it comprises a.
変数に適用される演算の種類に関する情報もしくは変数の型に関する情報と、前記演算の種類もしくは変数の型から推定される用途とを対応させた変数分類規則表を記憶する変数分類規則表記憶手段と、
プログラムで使用されている処理命令から変数に適用される演算の種類を、もしくは変数の定義から変数の型に関する情報を収集する変数情報収集手段と、
前記変数情報収集手段で収集した情報について前記変数分類規則表記憶手段に記憶された変数分類規則表を参照し、前記収集された演算の種類もしくは変数の型に関する情報と一致する前記変数分類規則表の演算の種類もしくは変数の型と対応する用途を、前記プログラムで使用されている変数の用途として推定して分類する変数分類手段とを備え、
前記プログラムで使用されている変数において、その変数とデータの受渡しのある変数を列挙したデータ授受グループがある場合に、前記変数分類手段は、データ授受グループに列挙されている変数に対して推定された用途に共通の用途のみを残し、それ以外の用途はその変数から削除する方法で前記推定した用途を限定する
ことを特徴とするプログラムの変数分類装置。
Variable classification rule table storage means for storing a variable classification rule table in which information on the type of operation applied to a variable or information on a variable type is associated with a use estimated from the type of operation or variable type; ,
Variable information collection means for collecting information on the type of operation applied to the variable from the processing instruction used in the program, or information on the type of the variable from the definition of the variable;
Refer to the variable classification rule table stored in the variable classification rule table storage means for information collected by the variable information collection means, and the variable classification rule table that matches the information on the type of operation or variable type collected. Variable classification means for estimating and classifying the usage corresponding to the type of operation or the type of the variable as the usage of the variable used in the program,
In the variables used in the program, when there is a data transfer group that enumerates variables that are passed between the variables and the data, the variable classification means is estimated for the variables listed in the data transfer group. A variable classification apparatus for a program , wherein only the common uses are left in the other uses and the estimated uses are limited by a method of deleting other uses from the variables.
前記変数分類手段は、変数に適用される演算の種類に関する情報と用途とを対応させた変数分類規則表と、変数の型に関する情報と用途とを対応させた変数分類規則表の異なる変数分類規則表により推定された変数の用途についての複数の推定結果に基づいて、共通の用途のみを残し、それ以外の用途はその変数の用途から削除する方法で変数の用途を限定することを特徴とする請求項に記載のプログラムの変数分類装置。 The variable classification means includes different variable classification rules in a variable classification rule table in which information on the type of operation applied to a variable is associated with a use, and in a variable classification rule table in which information on a variable type is associated with a use Based on multiple estimation results of variable usage estimated from the table, only common usage is left, and other usages are limited from the usage of the variable. The program variable classification apparatus according to claim 2 . コンピュータを、
変数に適用される演算の種類に関する情報と、前記演算の種類から推定される用途とを対応させた変数分類規則表を記憶する変数分類規則表記憶手段と、
プログラムで使用されている処理命令から変数に適用される演算の種類に関する情報を収集する変数情報収集手段と、
前記変数情報収集手段で収集した情報について前記変数分類規則表記憶手段に記憶された変数分類規則表を参照し、前記収集された演算の種類に関する情報と一致する前記変数分類規則表の演算の種類に対応する用途を、前記プログラムで使用されている変数の用途として推定して分類する変数分類手段
として機能させるためのプログラムを格納したコンピュータ読み取り可能な記憶媒体。
Computer
Variable classification rule table storage means for storing a variable classification rule table in which information on the type of operation applied to a variable is associated with a use estimated from the type of operation;
Variable information collecting means for collecting information on the types of operations applied to variables from processing instructions used in the program;
Refer to the variable classification rule table stored in the variable classification rule table storage means for information collected by the variable information collection means, and the type of operation of the variable classification rule table that matches the information about the type of operation collected Classification means for estimating and classifying the usage corresponding to the usage as the usage of the variable used in the program
A computer-readable storage medium storing a program for functioning as a computer .
JP00575098A 1998-01-14 1998-01-14 Variable classification apparatus and storage medium storing the program Expired - Fee Related JP3881103B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP00575098A JP3881103B2 (en) 1998-01-14 1998-01-14 Variable classification apparatus and storage medium storing the program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP00575098A JP3881103B2 (en) 1998-01-14 1998-01-14 Variable classification apparatus and storage medium storing the program

Publications (2)

Publication Number Publication Date
JPH11203116A JPH11203116A (en) 1999-07-30
JP3881103B2 true JP3881103B2 (en) 2007-02-14

Family

ID=11619798

Family Applications (1)

Application Number Title Priority Date Filing Date
JP00575098A Expired - Fee Related JP3881103B2 (en) 1998-01-14 1998-01-14 Variable classification apparatus and storage medium storing the program

Country Status (1)

Country Link
JP (1) JP3881103B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9069892B2 (en) 2013-05-10 2015-06-30 International Business Machines Corporation Reducing false-positive errors in a software change-impact analysis
JP6002507B2 (en) * 2012-08-31 2016-10-05 日立オートモティブシステムズ株式会社 Software verification program and software verification system
JP6081144B2 (en) * 2012-10-30 2017-02-15 株式会社東芝 Source code analyzer

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0423038A (en) * 1990-05-17 1992-01-27 Nec Corp Automatic generating device for program document
JP3390471B2 (en) * 1992-11-02 2003-03-24 富士通株式会社 Specification generator
JPH06149551A (en) * 1992-11-06 1994-05-27 Fujitsu Ltd Automatic program specification generating method
JPH09101879A (en) * 1995-10-04 1997-04-15 Fujitsu Ltd Program analyzer
JP3305949B2 (en) * 1996-02-08 2002-07-24 富士通株式会社 Program analyzer
JP3631602B2 (en) * 1997-02-26 2005-03-23 富士通株式会社 Program analysis apparatus and program storage medium

Also Published As

Publication number Publication date
JPH11203116A (en) 1999-07-30

Similar Documents

Publication Publication Date Title
Bangsow Tecnomatix plant simulation
EP2668725B1 (en) Generating data pattern information
AU780565B2 (en) Method and apparatus for selecting aggregate levels and cross product levels for a data warehouse
US6339775B1 (en) Apparatus and method for performing data transformations in data warehousing
JP5368665B2 (en) Expert database forwarded back to link weighted association rules
US5479344A (en) Insurance computation display
US8671084B2 (en) Updating a data warehouse schema based on changes in an observation model
EP0856802A2 (en) Method and apparatus for performing an aggregate query in a database system
US4967348A (en) Data name standardizing system
CN111242318B (en) Service model training method and device based on heterogeneous feature library
EP0508308A2 (en) Automatic manufacturability evaluation method and system
JP3881103B2 (en) Variable classification apparatus and storage medium storing the program
JP2001175724A (en) System for analyzing medical fee bill
CN112214557A (en) Data matching classification method and device
CN112631889A (en) Portrayal method, device and equipment for application system and readable storage medium
JP3679639B2 (en) Recycling support system
CN114547231A (en) Data tracing method and system
Tesoriero et al. The Web Measurement Environment (WebME): A Tool for Combining and Modeling Distributed Data
JPH08234977A (en) Manifold progress management system for software project
Pushak et al. Empirical scaling analyzer: An automated system for empirical analysis of performance scaling
Shah et al. Software Requirement Change Effort Estimation Model Prototype Tool for Software Development Phase
JP2566587B2 (en) Database search method
CN118036059A (en) PTD cloud-based industrial data collaborative anonymization method and system
JP2000227932A (en) Device or system for managing pension by using computer, and medium recording program for the device or system
CN115115241A (en) Trust project full-flow digital management method

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060725

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060808

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20061010

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20061010

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: 20061107

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20061109

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101117

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101117

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111117

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111117

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121117

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121117

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131117

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees