[go: up one dir, main page]

JP3418544B2 - Automatic test data generator for programs - Google Patents

Automatic test data generator for programs

Info

Publication number
JP3418544B2
JP3418544B2 JP07555398A JP7555398A JP3418544B2 JP 3418544 B2 JP3418544 B2 JP 3418544B2 JP 07555398 A JP07555398 A JP 07555398A JP 7555398 A JP7555398 A JP 7555398A JP 3418544 B2 JP3418544 B2 JP 3418544B2
Authority
JP
Japan
Prior art keywords
program
variable
program path
path
routine
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
JP07555398A
Other languages
Japanese (ja)
Other versions
JPH11272503A (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.)
Hitachi Software Engineering Co Ltd
Original Assignee
Hitachi Software Engineering Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Software Engineering Co Ltd filed Critical Hitachi Software Engineering Co Ltd
Priority to JP07555398A priority Critical patent/JP3418544B2/en
Publication of JPH11272503A publication Critical patent/JPH11272503A/en
Application granted granted Critical
Publication of JP3418544B2 publication Critical patent/JP3418544B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、プログラムの開発
支援に使用するテストデータ自動生成装置に関し、特
に、ソースプログラムのテスト、デバッグ、流用開発に
適用して有効な技術に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an automatic test data generator used for program development support, and more particularly to a technique effectively applied to testing, debugging and diversion development of a source program.

【0002】[0002]

【従来の技術】プログラムのテストデータ自動生成技術
については、本出願人が先に提案した特願平8−216
328号(発明の名称;プログラム開発支援装置および
プログラム開発支援方法およびプログラム開発支援用記
憶媒体)がある。これは、再テストの効率化とプログラ
ム中の有効命令・無効命令の判定と無効命令の破棄を目
的としたものであり、再テストの効率化という点でテス
トデータの自動生成機能を有している。
2. Description of the Related Art A technique for automatically generating test data of a program is disclosed in Japanese Patent Application No. 8-216 previously proposed by the applicant.
No. 328 (title of the invention; program development support device, program development support method, and program development support storage medium). This is for the purpose of improving the efficiency of retesting, determining valid / invalid instructions in a program, and discarding invalid instructions. It has an automatic test data generation function in terms of improving the efficiency of retesting. There is.

【0003】[0003]

【発明が解決しようとする課題】しかしながら、特願平
8−216328号に記載の技術は、テストデータ取得
を自動化し、テストに要するプログラマの負担を大幅に
軽減するものではあるが、対象となるプログラムの規模
が大きくなると生成されるプログラムパスの数が急激に
増加するという問題がある。
However, although the technique described in Japanese Patent Application No. 8-216328 automates the acquisition of test data and significantly reduces the load on the programmer required for the test, it is a target. There is a problem that the number of generated program paths increases rapidly as the size of the program increases.

【0004】この問題に対しては、C言語の関数のよう
な独立性の高い意味のまとまりを持つ言語であれば、そ
のまとまり毎にテストデータ生成を行うことにより、同
時に生成されるプログラムパス数を軽減できるが、対象
となるプログラム言語が、COBOL言語の外PERF
ORMで呼ばれる手続きなどのように独立性の低いサブ
ルーチンを記述できる言語である場合には、サブルーチ
ン毎に分割したとしても有意なテストデータ生成が行え
るかはなはだ疑問であり、そのような手段は使えない。
To solve this problem, in the case of a language having a highly independent group of meanings such as a C language function, the test data is generated for each group, and the number of program paths simultaneously generated. Can be reduced, but the target programming language is PERF outside the COBOL language.
In the case of a language that can describe subroutines with low independence such as procedures called by ORM, it is questionable whether significant test data can be generated even if divided into each subroutine, and such means cannot be used. .

【0005】また、デバッグや流用開発でプログラマが
関心をもつのは、問題を起こしていると考えられる特定
の変数や処理の流れである場合が非常に多く、従来の技
術をデバッグや流用開発に応用しようとした場合、プロ
グラム全体の膨大な数のプログラムパスやそのドメイン
の中から自分の関心のあるパスを探すという作業を行わ
なければならない。
In addition, programmers are often interested in debugging and diversion development in particular variables and processing flows that are considered to cause a problem, and conventional techniques are used for debugging and diversion development. If you try to apply it, you have to find the path of your interest in the huge number of program paths of the whole program and its domains.

【0006】また、COBOL言語のように、変数が別
名を持っていたり、変数が構造を持ち、下位の変数への
更新が上位の変数の値に影響するような場合には、変数
名の置き換えによるプログラムドメインの取得方法で
は、対応できないという問題がある。
Also, in the COBOL language, when a variable has an alias, or when the variable has a structure and an update to a lower variable affects the value of the upper variable, the variable name is replaced. There is a problem that the method of acquiring the program domain by does not support.

【0007】本発明の目的は、上記の問題を解決し、プ
ログラムのデバッグや流用開発を行う場合に、ユーザが
指定した変数について、変数が満たすべき条件とその処
理の流れを自動的に算出し、また、それに基づいてテス
トデータを自動生成することによってテストにかかる工
数を削減する技術を提供することにある。
An object of the present invention is to solve the above problems and automatically calculate the conditions to be satisfied by a variable and the flow of its processing for a variable designated by the user when debugging or diversion developing a program. Another object of the present invention is to provide a technique for reducing the number of test steps by automatically generating test data based on the test data.

【0008】[0008]

【課題を解決するための手段】上記目的を達成するため
に、本発明は、テストデータ生成対象のソースプログラ
ムを解析し、構文木を作り、変数の階層構造と大きさと
別名、再定義、サブルーチンの情報を収集する構文解析
処理を行う構文解析手段と、ユーザによって指定された
変数の値の影響がソースプログラム内で波及する範囲を
特定し、その部分を取り出すための波及効果解析処理を
行う波及効果解析手段と、前記波及効果解析処理によっ
て得られた解析結果を用い、ユーザによって指定された
変数について、その変数が満たすべき条件を算出する条
件算出手段と、算出された条件に当てはまる変数のテス
トデータを自動生成する手段と、を有することを特徴と
する。
In order to achieve the above object, the present invention analyzes a source program of a test data generation object, creates a syntax tree, and has a hierarchical structure and size of variables, aliases, redefinition and subroutines. The parsing means that performs the parsing process that collects the information of the above, and the ripple effect analysis process that specifies the range in which the influence of the value of the variable specified by the user spreads in the source program and extracts the part. Using the effect analysis means and the analysis result obtained by the ripple effect analysis processing, for the variable designated by the user, the condition calculation means for calculating the condition that the variable should satisfy, and the test of the variable applicable to the calculated condition And means for automatically generating data.

【0009】また、前記波及効果解析処理によって得ら
れた解析結果を用い、ルーチン毎にプログラムネットワ
ークを作成するプログラムネットワーク作成処理を行う
プログラムネットワーク作成手段と、前記プログラムネ
ットワークからプログラムパス式を生成するプログラム
パス式生成処理を実行するプログラムパス式生成手段
と、サブルーチンコールが検出された場合、それをコー
ル先のサブルーチンのプログラムパス式で置き換えるサ
ブルーチン置換処理を実行するサブルーチン置換手段
と、生成されたプログラムパス式を展開するプログラム
パス式展開処理を実行するプログラムパス式展開手段
と、分割して求められたプログラムパスをプログラムの
処理の流れにしたがって連結するプログラムパス連結処
理を実行するプログラムパス連結手段とを備え、前記条
件算出手段は、連結されたプログラムパスからそのプロ
グラムパスが実行されるための変数の条件を算出するこ
とを特徴とする。
Further, using the analysis result obtained by the ripple effect analysis process, a program network creating means for creating a program network for each routine, and a program for creating a program path expression from the program network. Program path expression generation means for executing path expression generation processing, subroutine replacement means for executing subroutine replacement processing for replacing a subroutine call with the program path expression of the called subroutine when the subroutine call is detected, and generated program path Program path expression expanding means for executing expression expansion processing, and program path connection processing for connecting the program paths obtained by division according to the processing flow of the program And a scan connecting means, the condition calculation means, and calculates the condition of the variables for that program passes are performed from the connection program path.

【0010】さらに、プログラムパスの条件算出時に、
変数名を、データ領域の先頭からのオフセットと、その
変数が占有する領域の大きさの2つの数値を使ったシン
ボル名に変換することで、複数の変数が任意の記憶領域
を共有している場合でも変数が満たすべき条件を算出す
る手段を有することを特徴とする。
Further, when calculating the condition of the program path,
By converting a variable name into a symbol name using an offset from the beginning of the data area and two numerical values of the size of the area occupied by that variable, multiple variables share an arbitrary storage area. It is characterized in that it has means for calculating the condition that the variable should satisfy even in the case.

【0011】[0011]

【発明の実施の形態】以下、本発明によるプログラムの
テストデータ自動生成装置の一実施の形態について図面
を参照しながら具体的に説明する。
BEST MODE FOR CARRYING OUT THE INVENTION An embodiment of a program test data automatic generation device according to the present invention will be specifically described below with reference to the drawings.

【0012】図1は、本発明の一実施形態を示す機能構
成図である。本実施形態のテストデータ自動生成装置
は、処理要求の受け付けや結果の表示を行う端末101
と、処理対象となるソースファイル102と、ソースフ
ァイル102の構文解析を行う構文解析部103と、前
記構文解析部103の処理結果を用い、ユーザによって
指定された変数の値の影響がソースプログラム内で波及
する範囲を特定する波及効果解析を行う波及効果解析部
104と、前記波及効果解析部104の処理結果を用い
てプログラムネットワークを生成するプログラムネット
ワーク作成部105と、前記プログラムネットワーク作
成部105の処理結果を用いてプログラムパス式を作成
するプログラムパス式作成部106と、前記プログラム
パス式作成部106の処理結果に含まれるサブルーチン
呼び出しをサブルーチンの内容に置き換えるサブルーチ
ン置換部107と、前記サブルーチン置換部107の処
理結果を用いてプログラムパス式をプログラムパスに展
開するプログラムパス式展開部108と、ルーチンごと
に求まったプログラムパス式を処理順序を考慮して連結
し、プログラムとしてのプログラムパスを生成するプロ
グラムパス連結部109と、前記プログラムパス連結部
109によって求められたプログラムパスからプログラ
ムのドメインを求めるプログラムパスドメイン取得部1
10と、前記プログラムパスドメイン取得部110によ
って求められたドメインからテストデータを生成するテ
ストデータ取得部111から構成されている。
FIG. 1 is a functional block diagram showing an embodiment of the present invention. The test data automatic generation device according to the present exemplary embodiment is a terminal 101 that receives a processing request and displays a result.
The source file 102 to be processed, the syntax analysis unit 103 that performs syntax analysis of the source file 102, and the processing result of the syntax analysis unit 103 are used, and the influence of the value of the variable designated by the user is within the source program. Of the ripple effect analysis unit 104 that performs a ripple effect analysis that specifies the range to be propagated in, a program network creation unit 105 that creates a program network using the processing result of the ripple effect analysis unit 104, and a program network creation unit 105. A program path expression creating unit 106 that creates a program path expression using the processing result, a subroutine replacement unit 107 that replaces a subroutine call included in the processing result of the program path expression creating unit 106 with the contents of the subroutine, and the subroutine replacement unit. Using the processing result of 107, A program path expression expanding unit 108 for expanding a Gram path expression into a program path; a program path connecting unit 109 for connecting the program path expressions found for each routine in consideration of the processing order to generate a program path as a program; Program path domain acquisition unit 1 for obtaining the domain of a program from the program path obtained by the program path connection unit 109
10 and a test data acquisition unit 111 that generates test data from the domain obtained by the program path domain acquisition unit 110.

【0013】この実施形態のテストデータ自動生成装置
は、具体的にはコンピュータで構成することができ、構
解析部103等の各部は対応する機能を実現するプロ
グラムによって構成することができるものである。ま
た、各部は、1つのコンピュータの内部に設ける構成だ
けでなく、複数台のコンピュータで作業を分担してテス
トデータを生成するように構成することもできる。
The test data automatic generation device of this embodiment can be specifically configured by a computer, and each unit such as the syntax analysis unit 103 can be configured by a program that realizes a corresponding function. . Further, each unit may be configured not only to be provided inside one computer, but also to divide the work among a plurality of computers to generate test data.

【0014】図2は、図1の実施形態の処理を説明する
ためのフローチャートである。本発明は、図2に示され
るように以下の処理から構成される。
FIG. 2 is a flow chart for explaining the processing of the embodiment shown in FIG. The present invention comprises the following processes as shown in FIG.

【0015】ステップ201;構文解析処理112構文
解析部103が実行する処理である。端末101から処
理要求が出されると、構文解析部103によって、ソー
スファイル102(例えばCOBOLソースファイル)
が読み込まれ、図3に示すように、構文木121が生成
され、同時にプログラム中に含まれる各変数ごとの情報
を持つ変数情報124とそれを表にしたデータ項目情報
テーブル122と、プログラム中に現れる各ルーチンご
との情報を持つルーチン情報125とそれを表にしたル
ーチン情報テーブル123が生成される。このとき、必
要により、インクルードファイルが展開される。
Step 201: Parsing process 112 This process is executed by the parsing unit 103. When a processing request is issued from the terminal 101, the syntax analysis unit 103 causes the source file 102 (for example, COBOL source file).
3, a syntax tree 121 is generated as shown in FIG. 3, and at the same time, variable information 124 having information for each variable included in the program, a data item information table 122 that represents the variable information 124, and Routine information 125 having information for each appearing routine and a routine information table 123 that represents the routine information 125 are generated. At this time, the include file is expanded if necessary.

【0016】ステップ202;波及効果解析処理113
構文木121とデータ項目情報テーブル122を使って
ユーザによって指定された変数についての波及効果解析
が行なわれる。この処理を行なうことにより、最終的に
得られるプログラムパスの数を軽減することができる。
Step 202: Ripple effect analysis processing 113
Using the syntax tree 121 and the data item information table 122, the ripple effect analysis is performed on the variable designated by the user. By performing this processing, the number of program paths finally obtained can be reduced.

【0017】ステップ203;プログラムネットワーク
作成処理114 上記波及効果解析処理113までに生成された構文木1
21を先行順で辿り、すべてのルーチン(メインルーチ
ンおよびサブルーチン)の単位でプログラムネットワー
クを生成する。ネットワーク生成の処理自体は、特願平
8−216328号に記載の技術を用いて行う。プログ
ラムネットワークにはルーチン識別番号が付けられ、こ
のルーチン識別番号とルーチン名との対応を記憶するル
ーチン識別テーブルが生成される。
Step 203: Program network creation process 114 Syntax tree 1 generated up to the ripple effect analysis process 113
21 is followed in the order of precedence, and the program network is generated in units of all routines (main routine and subroutine). The process of network generation itself is performed using the technique described in Japanese Patent Application No. 8-216328. A routine identification number is attached to the program network, and a routine identification table storing the correspondence between the routine identification number and the routine name is generated.

【0018】ステップ204;プログラムパス式作成処
理115 プログラムネットワークからプログラム連結行列を取得
し、プログラム連結行列からプログラムパス式作成処理
を用いてルーチン毎のプログラムパス式を生成する。生
成の処理は、特願平8−216328号に記載の技術を
用いて行う。
Step 204: Program path formula creating process 115: A program concatenation matrix is acquired from the program network, and a program path formula for each routine is generated from the program concatenation matrix using the program path formula creating process. The generation process is performed using the technique described in Japanese Patent Application No. 8-216328.

【0019】ステップ205;サブルーチン置換処理1
16 プログラムパス式中にサブルーチン呼び出しがあるか調
べ、存在すれば、対応するサブルーチンのサブルーチン
名からルーチン識別番号を検索し、対応するプログラム
パス式で置き換える。
Step 205: Subroutine replacement processing 1
16 It is checked whether or not there is a subroutine call in the program path expression, and if there is, a routine identification number is retrieved from the subroutine name of the corresponding subroutine, and the routine identification number is replaced with the corresponding program path expression.

【0020】ステップ206;プログラムパス式展開処
理117 サブルーチン置換手段で処理されたプログラムパス式を
展開し、ルーチンごとのプログラムパスのリストに変換
する。
Step 206: Program path expression expansion processing 117 The program path expression processed by the subroutine replacing means is expanded and converted into a program path list for each routine.

【0021】ステップ207;プログラムパス連結処理
118上記の処理で生成されたルーチンごとのプログラ
ムパスを処理の順序を考慮して連結し、プログラムに含
まれるプログラムパスをすべて算出する。
Step 207: Program path concatenation processing 118 The program paths for each routine generated in the above processing are concatenated in consideration of the processing order, and all the program paths included in the program are calculated.

【0022】ステップ208;プログラムドメイン取得
処理119プログラムパスリストからプログラムパスを
1つ取り出し、そのプログラムパスについてのプログラ
ムドメインを取得する。
Step 208: Program domain acquisition processing 119 Program path is selected from the program path list.
Take one and get the program domain for that program path.

【0023】ステップ209;テストデータ取得処理1
20 プログラムドメインからそのドメインに含まれるテスト
データを生成する。
Step 209: Test data acquisition process 1
20. Generate test data contained in the program domain from the program domain.

【0024】すべてのプログラムパスを処理するまで、
プログラムドメイン取得処理、テストデータ取得処理を
繰り返す。テストデータ生成の処理は、特願平8−21
6328号に記載の技術を用いて行う。
Until all program paths have been processed
The program domain acquisition process and the test data acquisition process are repeated. The test data generation process is described in Japanese Patent Application No. 8-21.
The technique described in No. 6328 is used.

【0025】次に、本発明の特徴となる技術について図
面を用いて説明する。なお、ここで詳述しない処理につ
いては、特願平8−216328号に記載の技術を用い
て行う。
Next, a technique which characterizes the present invention will be described with reference to the drawings. Note that the processing not described in detail here is performed using the technique described in Japanese Patent Application No. 8-216328.

【0026】図4は、波及効果解析手段104の構成と
データの流れを示したものである。図5および図6に波
及効果解析手段104の実行手順のフローチャートを示
す。
FIG. 4 shows the structure of the ripple effect analysis means 104 and the flow of data. 5 and 6 show flowcharts of the execution procedure of the ripple effect analysis means 104.

【0027】まず、端末101より指定された波及効果
解析対象とする変数を変数エリア230に設定する(ス
テップ501)。構文木解析部103において構文木解
析処理を実行し、自分が利用する構文木121とデータ
項目情報テーブル122を取得する(ステップ50
2)。構文木121には、プログラム中に現れる変数に
対応するノードに、その変数が参照されているのか、更
新されているのかを示すフラグが設定されている。ま
た、構文木121の葉のノードには、ノードが持つトー
クンのソースファイル上での位置が設定されている。
First, a variable designated by the terminal 101 and to be a ripple effect analysis target is set in the variable area 230 (step 501). The syntax tree analysis unit 103 executes the syntax tree analysis process, and the syntax tree 121 and data used by the user.
Acquires the item information table 122 (step 50)
2). In the syntax tree 121, a flag indicating whether the variable is referenced or updated is set in the node corresponding to the variable appearing in the program. Further, in the leaf node of the syntax tree 121, the position of the token possessed by the node on the source file is set.

【0028】データ項目情報テーブル122は、各変数
についての変数情報124の表で、図3に示したように
変数名、変数の大きさ、レベル番号、上位の変数情報、
下位の変数情報、再定義情報、別名情報、出現位置情報
等の情報を含んでいる。
The data item information table 122 is a table of variable information 124 for each variable. As shown in FIG. 3, the variable name, the size of the variable, the level number, the upper variable information,
It includes information such as lower-level variable information, redefinition information, alias information, and appearance position information.

【0029】変数の大きさとは、その変数が値を記憶す
るのに使用する記憶領域の大きさのことであり、レベル
番号とは、変数間の上位下位の関係を判断するための番
号で、レベル番号の大きな変数は、より小さなレベル番
号の変数に従属する下位の変数となる。上位の変数情報
とは、ある変数が直接に従属している上位の変数の変数
情報124を指すポインタのことであり、下位の変数情
報とは、ある変数が直接に包含している下位の変数の変
数情報124を指すポインタのことである。再定義情報
とは、ある変数が占有している領域を別の変数が別の階
層構造をもって再定義しているとき、その再定義してい
る変数の変数情報124を指すポインタのことである。
The size of a variable is the size of the storage area used to store the value of the variable, and the level number is a number for judging the upper and lower relations between variables. A variable with a large level number becomes a lower variable dependent on a variable with a lower level number. The high-order variable information is a pointer that points to the variable information 124 of the high-order variable on which a certain variable is directly dependent, and the low-order variable information is the low-order variable directly included by the certain variable. Is a pointer that points to the variable information 124. The redefinition information is a pointer that points to the variable information 124 of the redefined variable when another variable redefines the area occupied by the variable with another hierarchical structure.

【0030】別名情報とは、占有している記憶領域が隣
接している複数の変数をひとまとめにして別名が定義さ
れているときに、別名として定義された変数が直接に包
含している下位の変数の変数情報124を指すポインタ
のことである。
The alias information is a subordinate variable which is directly included in a variable defined as an alias when a plurality of variables adjacent to each other in the occupied storage area are collectively defined as the alias. A pointer that points to variable information 124 of a variable.

【0031】次に、波及効果解析手段が、生成された構
文木121を処理順に辿って、図7に示すような制御構
造の木231を生成する(ステップ503)。この木2
31の各ノードには探索順に文識別番号232が付けら
れ、分岐命令によって入れ子になっている文には、その
文が属する分岐を識別する分岐識別番号233も付けら
れる。
Next, the ripple effect analysis means traces the generated syntax tree 121 in the processing order to generate a control structure tree 231 as shown in FIG. 7 (step 503). This tree 2
A sentence identification number 232 is attached to each node of 31 in the search order, and a branch identification number 233 for identifying a branch to which the sentence belongs is attached to a statement nested by a branch instruction.

【0032】次に、データ項目情報テーブル122を使
って、変数エリア230に登録されている変数と、記憶
領域のすべてまたは一部を共有している変数をすべて取
得し、得られた変数を変数エリア230に登録されてい
る変数とあわせて変数リスト234に登録する(ステッ
プ504)。
Next, using the data item information table 122, all the variables registered in the variable area 230 and the variables sharing all or part of the storage area are acquired, and the obtained variables are used as variables. The variables are registered in the variable list 234 together with the variables registered in the area 230 (step 504).

【0033】また、次に、リストの要素が空である、文
リスト235を用意する(ステップ505)。次に、リ
ストの要素が空である、文リスト236を用意する(ス
テップ506)。次に、変数リスト234より、変数を
1つ取り出し、変数エリア237に設定する(ステップ
507)。
Then, a sentence list 235 in which the elements of the list are empty is prepared (step 505). Next, the sentence list 236 in which the elements of the list are empty is prepared (step 506). Next, one variable is taken out from the variable list 234 and set in the variable area 237 (step 507).

【0034】変数エリア237に登録されている変数が
使用されているすべての文を、変数情報122の出現位
置情報を参照して取得し、文リスト236へ登録する
(ステップ508)。
All the sentences in which the variables registered in the variable area 237 are used are acquired by referring to the appearance position information of the variable information 122 and registered in the sentence list 236 (step 508).

【0035】変数リスト234に含まれるすべての変数
に対してステップ507,508の処理を行い、文リス
ト236に、変数エリア230に登録されている変数に
関連する変数が使用されている文を取得する。
All the variables included in the variable list 234 are processed in steps 507 and 508, and the sentence list 236 obtains the sentence in which the variables related to the variables registered in the variable area 230 are used. To do.

【0036】次に、変数エリア230に登録されている
変数の記憶領域全体を共有しているすべての変数を取得
し、変数リスト238に登録する(ステップ509)。
Next, all variables sharing the entire storage area of the variables registered in the variable area 230 are acquired and registered in the variable list 238 (step 509).

【0037】次に、文リスト236に含まれる文を、文
識別番号の昇順にソートする(ステップ510)。次
に、空の文リスト239を用意する(ステップ51
1)。次に、変数リスト238中に登録されている変数
が新規に代入される文を文リスト236の先頭から検索
する(ステップ512,513)。
Next, the sentences contained in the sentence list 236 are sorted in ascending order of sentence identification numbers (step 510). Next, an empty sentence list 239 is prepared (step 51).
1). Next, a sentence to which a variable registered in the variable list 238 is newly assigned is searched from the beginning of the sentence list 236 (steps 512 and 513).

【0038】検索の結果、そのような文が見つかれば、
見つかった文のうちで、最も若い識別番号の文の識別番
号を取得する。分岐が存在していれば、分岐識別番号も
参照して、各分岐毎に最も若い識別番号の文の識別番号
を取得し、それより若い文識別番号を持つ文を抜き出
す。抜き出した文は文リスト236の中から破棄し、文
リスト239に登録する(ステップ514)。
If such a sentence is found as a result of the search,
Among the found sentences, the identification number of the sentence with the smallest identification number is acquired. If there is a branch, the branch identification number is also referred to acquire the identification number of the sentence with the smallest identification number for each branch, and the sentence having the sentence identification number smaller than that is extracted. The extracted sentence is discarded from the sentence list 236 and registered in the sentence list 239 (step 514).

【0039】もし、検索の結果、変数リスト238中の
変数が新規に代入される文が文リスト236の中に見つ
からなければ、リストの終わりまでの文をすべて抜き出
す。抜き出した文はリスト236の中から破棄し、文リ
スト239に登録する(ステップ515)。
If, as a result of the search, no sentence in which the variable in the variable list 238 is newly assigned is found in the sentence list 236, all the sentences up to the end of the list are extracted. The extracted sentence is discarded from the list 236 and registered in the sentence list 239 (step 515).

【0040】次に、リストの要素が空である、変数リス
ト240を用意する(ステップ516)。
Next, the variable list 240 in which the elements of the list are empty is prepared (step 516).

【0041】次に、文リスト239から文を1つ読む
(図6のステップ517)。変数リスト234に登録さ
れている変数を1つずつ取り出して、変数エリア237
に設定する。そして、ステップ516で取り出した文の
中に、変数エリア237に格納されている変数が影響を
与える変数がないか調べる。変数リスト234に登録さ
れている変数が影響を与える変数としては、変数237
に登録されている変数によって直接更新される変数だけ
でなく、その変数と記憶領域の一部分でも共有している
変数も含まれる(ステップ518,519)。
Next, one sentence is read from the sentence list 239 (step 517 in FIG. 6). The variables registered in the variable list 234 are taken out one by one, and the variable area 237
Set to. Then, it is checked whether or not the statement stored in step 516 influences the variables stored in the variable area 237. Variables that are registered in the variable list 234 have an influence on the variables 237.
This includes not only variables that are directly updated by the variables registered in, but also variables that are shared with a part of the storage area with the variables (steps 518 and 519).

【0042】そのような変数が、抜き出した文の中に含
まれていれば、該当する変数を変数リスト240に登録
する(ステップ520)。
If such a variable is included in the extracted sentence, the corresponding variable is registered in the variable list 240 (step 520).

【0043】上記のステップ517,518,519,
520の処理を文リスト239中の文すべてについて行
う。
The above steps 517, 518, 519,
The processing of 520 is performed for all the sentences in the sentence list 239.

【0044】次に、文リスト239の内容を文リスト2
35に追加登録して、文リスト239を破棄する(ステ
ップ521)。
Next, the contents of the sentence list 239 are changed to the sentence list 2
35 is additionally registered, and the sentence list 239 is discarded (step 521).

【0045】次に、変数リスト240が空でないかを調
べる。空であれば、ソースファイル102中の波及効果
のある変数をすべて検索したとして次のステップ52
3,524の処理を行う。
Next, it is checked whether the variable list 240 is empty. If it is empty, it is assumed that all variables having a ripple effect in the source file 102 have been searched, and the next step 52
The processing of 3,524 is performed.

【0046】まず、文リスト235中の文のダブりを取
り除く(ステップ523)。次に、文リスト235中に
存在していない文に相当する構文木121の部分木を削
除し、文リスト235を破棄し(ステップ524)、波
及効果解析処理を終了する。
First, duplication of sentences in the sentence list 235 is removed (step 523). Next, the subtree of the syntax tree 121 corresponding to the sentence that does not exist in the sentence list 235 is deleted, the sentence list 235 is discarded (step 524), and the ripple effect analysis process is terminated.

【0047】もし、変数リスト240が空でなければ、
文リスト236が空かどうか調べる(ステップ52
5)。
If the variable list 240 is not empty,
It is checked whether the statement list 236 is empty (step 52).
5).

【0048】空でなければ、ステップ511に戻って、
文リスト236中の残りの文についても、波及範囲の検
索を続ける。
If it is not empty, return to step 511 and
For the remaining sentences in the sentence list 236, the search of the spread range is continued.

【0049】空であれば、1次の波及効果解析が終了し
たとして、さらに高次の波及効果解析処理の準備をす
る。すなわち、変数リスト240の内容を変数リスト2
34に複写し、変数リスト240を破棄して、処理20
7,208のループの先頭に戻る(ステップ526)。
If it is empty, it is considered that the first-order ripple effect analysis is completed, and preparation is made for the higher-order ripple effect analysis processing. That is, the contents of the variable list 240 are changed to the variable list 2
34, the variable list 240 is discarded, and the process 20
Return to the beginning of the loop of 7,208 (step 526).

【0050】このようにしてプログラムネットワーク作
成処理で使用する、波及効果解析済みの構文木を生成す
る。
In this way, the ripple effect-analyzed syntax tree used in the program network creation processing is generated.

【0051】次に、サブルーチン置換部107の処理を
説明する。
Next, the processing of the subroutine replacing unit 107 will be described.

【0052】本実施形態で対象としているCOBOL言
語の場合、段落という手続きのまとまりが存在するが、
データ項目がグローバルであるなど、C言語の関数など
に比べて独立性が高くなく、それだけで意味のあるまと
まりとしてしまうのは無理があり、C言語の関数のよう
にそこだけを取り出してテストの対象とすることは出来
ない。
In the case of the COBOL language which is the object of this embodiment, there is a procedure unit called a paragraph.
Since data items are global, they are not highly independent as compared to C language functions, etc., and it would be impossible to make a meaningful group by themselves, so just extract them like a C language function for testing. It cannot be targeted.

【0053】そこで、そのような言語にも対応できるよ
うに、サブルーチン毎にプログラムパス式を取得してお
いて、必要に応じて連結してプログラムとしてのプログ
ラムパス式を生成するようにする。このため、サブルー
チン毎に生成されるプログラムパス式は、特願平8−2
16328号のように文字列形式にした後に、Lisp
言語で処理するのではなく、置き換えに便利なように図
8(a)のようなプログラムパス式の木302として取
得する。
Therefore, in order to support such a language, a program path expression is acquired for each subroutine and connected as needed to generate a program path expression as a program. Therefore, the program path formula generated for each subroutine is
After converting to a character string format like 16328, Lisp
Instead of processing by language, it is obtained as a program path expression tree 302 as shown in FIG. 8A for convenience of replacement.

【0054】この式の木302は2分木であり、各ノー
ドは、そのノードが何を表すかを示す値(ラベル)と、
左右の子どものノードへのリンクを持つ。図8(a)中
で、プログラムパス式の木302の葉のノードは、ソー
スファイル中の処理を示しており、そのノードの値は、
それぞれ対象ソースファイル中の対応している処理に付
けられたラベルである。中間節で、ノードのラベルとし
て「*」(アスタリスク)を持つノードは、連接の制御構
造があることを表し、左の子のノードのラベルに対応す
る処理の後に続いて、右の子のノードのラベルに対応す
る処理が実行されることを表す。また、ノードのラベル
として、「+」(プラス記号)を持つノードは、選択の制
御構造があることを示し、左の子のノードのラベルが示
す処理か、右の子のノードのラベルが示す処理のどちら
かが実行されることを示す。なお、ループの制御構造に
ついては、繰り返し回数が直接数値としてソースファイ
ル上に与えられている場合は、その回数分、ループの中
身を展開する。そうでない場合は、ユーザによって指定
された回数をループの繰り返しの上限としてループの内
容を展開する。例えば、ユーザによって、最大繰り返し
回数が2回と指定された場合、ループの内容が1回も実
行されない処理と、1回実行される処理と、2回実行さ
れる処理の選択の制御構造として展開する。
The expression tree 302 is a binary tree, and each node has a value (label) indicating what the node represents,
It has links to left and right child nodes. In FIG. 8A, the leaf node of the program path expression tree 302 indicates the processing in the source file, and the value of that node is
Each is a label attached to the corresponding process in the target source file. In the intermediate section, a node that has "*" (asterisk) as a node label indicates that there is a concatenation control structure. After the process corresponding to the label of the left child node, the node of the right child node Represents that the process corresponding to the label is executed. In addition, a node having "+" (plus sign) as a node label indicates that there is a control structure for selection, and the process indicated by the label of the left child node or the label of the right child node is indicated. Indicates that either of the processing is executed. Regarding the control structure of the loop, if the number of repetitions is directly given as a numerical value on the source file, the contents of the loop are expanded by the number of times. Otherwise, the contents of the loop are expanded with the number of times specified by the user as the upper limit of loop repetition. For example, when the user specifies the maximum number of iterations as 2, the content of the loop is expanded as a control structure for selecting a process that is never executed, a process that is executed once, and a process that is executed twice. To do.

【0055】サブルーチン置換処理は、再帰呼び出しを
無限に展開するのを防ぐための再帰呼び出し管理スタッ
クを持つ。
The subroutine replacement process has a recursive call management stack for preventing infinite expansion of recursive calls.

【0056】図8および図9に、サブルーチンの置き換
えの様子を示す。図8(a)はサブルーチン呼び出しを
含むプログラムパス式の木302で、図中のプログラム
パス式301に対応するプログラムパス式の木である。
ノード303はサブルーチンコールに対応するノードで
ある。図8(b)は、ノード303で呼ばれるサブルー
チンのプログラムパス式の木304である。図9のプロ
グラムパス式の木305は、サブルーチンが置き換えら
れた後のプログラムパス式の木302である。
8 and 9 show how the subroutine is replaced. FIG. 8A shows a program path expression tree 302 including a subroutine call, which corresponds to the program path expression 301 in the figure.
The node 303 is a node corresponding to a subroutine call. FIG. 8B is a program path expression tree 304 of a subroutine called by the node 303. The program path expression tree 305 in FIG. 9 is the program path expression tree 302 after the subroutine has been replaced.

【0057】図10は、サブルーチン置換処理のフロー
チャートである。
FIG. 10 is a flowchart of the subroutine replacement process.

【0058】まず、サブルーチンごとに求められたプロ
グラムパス式の木302をポストオーダーに検索し(す
なわち、逆の順序で検索し)、サブルーチン呼び出しの
ノードを検索する。次に、探索中のノード303のラベ
ル306を取得し、ラベルの表す内容がサブルーチンコ
ールか調べる(ステップ801,802)。
First, the program path expression tree 302 obtained for each subroutine is searched for in post order .
That is, search in the reverse order) and search for the node of the subroutine call. Next, the label 306 of the node 303 being searched is acquired, and it is checked whether the content represented by the label is a subroutine call (steps 801 and 802).

【0059】ラベルの表す内容がサブルーチンコールで
あった場合、まず、再帰呼び出し管理スタックの中身を
調べて、ラベル306の登録されている回数を調べる
(ステップ803)。ここで、登録回数がユーザの指定
した回数以下であれば、再帰呼び出し管理スタックにラ
ベル306をプッシュする(ステップ804,80
5)。
When the content represented by the label is a subroutine call, first, the contents of the recursive call management stack are examined to check the number of times the label 306 is registered (step 803). If the number of registrations is less than or equal to the number specified by the user, the label 306 is pushed onto the recursive call management stack (steps 804 and 80).
5).

【0060】次に、ルーチン情報テーブル123とルー
チン識別テーブルから、置き換え先のサブルーチンのプ
ログラムパス式の木304(図8(b))を特定し、そ
れを複製したプログラムパス式の木A(図示しない)を
用意して、ノード303と置き換える(ステップ80
6)。
Next, from the routine information table 123 and the routine identification table, the program path expression tree 304 (FIG. 8B) of the sub-routine to be replaced is specified, and a duplicated program path expression tree A (illustration is shown). Prepare) to replace the node 303 (step 80)
6).

【0061】ルーチン情報テーブル123は、各ルーチ
ンのルーチン情報125の表であり、ルーチン情報12
5は、図3に示したようにルーチン名、ルーチンの種
別、定義位置情報、所属ルーチン情報、包含ルーチン情
報、呼び出し先ルーチン情報、呼び出し元ルーチン情報
等の情報を含んでいる。
The routine information table 123 is a table of the routine information 125 of each routine.
As shown in FIG. 3, 5 includes information such as routine name, routine type, definition position information, belonging routine information, inclusion routine information, callee routine information, and caller routine information.

【0062】ルーチンの種別は、COBOL言語のよう
にルーチンが節、段落という階層構造を持つ場合、ルー
チンが節であるのか、段落であるのかというルーチンの
種別を表す。定義位置情報は、ルーチンが定義されてい
る位置の情報である。所属ルーチン情報は、自ルーチン
が属している、上の階層のルーチンのルーチン情報への
ポインタであり、包含ルーチン情報は、自ルーチンの下
位の階層のルーチンのルーチン情報へのポインタであ
る。呼び出し先ルーチン情報は、自ルーチンが呼び出す
ルーチンのルーチン情報へのポインタであり、呼び出し
元ルーチン情報は、自ルーチンを呼び出すルーチンのル
ーチン情報へのポインタである。
When the routine has a hierarchical structure of sections and paragraphs as in the COBOL language, the type of routine represents the type of routine whether the routine is a section or a paragraph. The defined position information is information on the position where the routine is defined. The belonging routine information is a pointer to the routine information of a routine in the upper hierarchy to which the own routine belongs, and the included routine information is a pointer to the routine information of a routine in a lower hierarchy of the own routine. The callee routine information is a pointer to the routine information of the routine called by the self routine, and the caller routine information is a pointer to the routine information of the routine that calls the self routine.

【0063】ルーチン識別テーブルは、各ルーチン毎
に、そのルーチンのプログラムネットワークの番号と、
ルーチン名を要素に持つテーブルで、サブルーチン呼び
出し命令に記述されているサブルーチン名から対応する
ルーチン単位のプログラムネットワークの識別番号を検
索して、対応するルーチンのプログラムネットワークを
識別する。
The routine identification table contains, for each routine, the program network number of that routine, and
The table having the routine name as an element is searched for the identification number of the program network of the corresponding routine unit from the subroutine name described in the subroutine call instruction, and the program network of the corresponding routine is identified.

【0064】次に、ノード303の代わりに置き換えら
れたプログラムパス式の木A(図示しない)の内部を検
索し、展開を続ける(ステップ807)。プログラムパ
ス式の木A(図示しない)のノードをすべて検索、展開
し終えたら、ノード303に関する展開は終了したとし
て、処理315で、再帰呼び出し管理スタックから要素
を1つポップして、ノード303の展開を終了する(ス
テップ808)。
Next, the inside of the replaced program path expression tree A (not shown) is searched in place of the node 303, and expansion is continued (step 807). When all the nodes of the tree A (not shown) in the program path expression have been searched and expanded, it is determined that the expansion related to the node 303 is completed, and in processing 315, one element is popped from the recursive call management stack and the node 303 The expansion is completed (step 808).

【0065】もし、ノード303のラベル306の登録
されている回数が、ユーザの指定した回数を超えていれ
ば、ノード303に無効なノードであることを示すマー
クを付け、ノード303についての処理の終わりとする
(ステップ809)。
If the number of times the label 306 of the node 303 is registered exceeds the number of times specified by the user, the node 303 is marked as an invalid node, and the process for the node 303 is performed. This is the end (step 809).

【0066】このようにして、図8(a),図8
(b),図9のように呼び出し先のサブルーチンに該当
するプログラムパス式の木を、サブルーチン呼び出しを
示すプログラムパス式の木のノードと置き換える。プロ
グラムパス式を文字列の式で得るのではなく、式の木に
することで、置き換えは、単純な2分木のつなぎ替えと
することができる。
In this way, FIG. 8 (a) and FIG.
(B) As shown in FIG. 9, the program path expression tree corresponding to the called subroutine is replaced with a node of the program path expression tree indicating the subroutine call. Instead of obtaining the program path expression as a character string expression, by using an expression tree, the replacement can be a simple binary tree reconnection.

【0067】次に、プログラムパス式展開部108の処
理について説明する。
Next, the processing of the program path type expansion unit 108 will be described.

【0068】サブルーチン置換部107によって取得さ
れたプログラムパス式は、式の木の形をしているので、
プログラムパス式展開部108では、これを展開し、ル
ーチン内のすべてのプログラムパスを取得してリストに
する。展開は、2分木の探索を基本にして再帰的に行
う。
Since the program path expression obtained by the subroutine replacing unit 107 has the shape of an expression tree,
The program path type expansion unit 108 expands this and acquires all the program paths in the routine to form a list. The expansion is recursively performed based on the search of the binary tree.

【0069】プログラムパス式展開部108は、分岐位
置を記憶する分岐スタックと、展開中のプログラムパス
を保持する展開バッファを持つ。分岐スタックには、処
理の分岐のノードの位置を表す分岐位置情報と、進んだ
方向を現す分岐選択情報が保存される。
The program path type expansion unit 108 has a branch stack for storing branch positions and a expansion buffer for holding the program path being expanded. In the branch stack, branch position information indicating the position of the node of the branch of the process and branch selection information indicating the proceeding direction are stored.

【0070】プログラムパス式展開処理のフローチャー
トを図11〜図13に示す。展開の方法を図8(b)の
プログラムパス式の木を例にとって説明する。
Flowcharts of the program path type expansion processing are shown in FIGS. The expansion method will be described by taking the program path expression tree of FIG. 8B as an example.

【0071】展開は、式の木を左の子のノードを先にし
て先行順で探索することで行う。探索しながら、ノード
のラベルを読み(ステップ901)、無効マークのない
葉のノードのラベルを展開バッファに書き込む(ステッ
プ905)。もし、探索中のノードのラベルが「*」
(アスタリスク)である場合には(ステップ903)、
処理の連接をあらわすので、そのノードの左の部分木の
後に、右の部分木の展開処理を行う(ステップ906,
907)。また、探索中のノードに無効マークが設定さ
れていれば、そのノードは無視する(ステップ90
4)。図8(b)中のノード331まで探索したところ
で、選択の制御構造を表すノードに出会う(ステップ9
02)。ここで、分岐スタックに、ノード331の情報
が登録されていないか調べる(ステップ908)。しか
し、まだ分岐スタックは空なので、ノード331の情報
は未登録である。そこで、次に探索すべきノードを、左
右の子のノードの中から選択し、このノードのラベル
と、選択された向きを分岐スタックに格納する(図13
のステップ913)。分岐のノードでは、最初の探索で
は、左の子のノードの方へ探索を進め、2度目の探索で
は右の子のノードの方へ進むようする。ここでは、ノー
ド331からは左のノード、すなわち、ノード332の
方に進んで、ノード332を根とする部分木の展開処理
を続ける(ステップ914)。同様にして、1回目のプ
ログラムパス式の木の探索を終えると、探索経路は、3
21→322→323→324→325→326→32
7→328→329→330→331→332→334
→335→336となり、分岐スタックには(331,
‘L’)−(335,‘L’)と格納される。展開バッ
ファには、[s/][t/][u/][v/][w/]
[y/][z/]というプログラムパスが生成されてい
る。こうして、1つめの展開されたプログラムパスを得
る(図12のステップ915)。
The expansion is performed by searching the expression tree in the order of precedence with the left child node first. While searching, the label of the node is read (step 901), and the label of the leaf node having no invalid mark is written in the expansion buffer (step 905). If the label of the node being searched is "*"
If it is (asterisk) (step 903),
Since this represents the concatenation of processes, the expansion process of the right subtree is performed after the left subtree of the node (step 906).
907). If the node under search has an invalid mark, that node is ignored (step 90).
4). Upon searching up to the node 331 in FIG. 8B, a node representing the control structure for selection is encountered (step 9).
02). Here, it is checked whether or not the information of the node 331 is registered in the branch stack (step 908). However, since the branch stack is still empty, the information of the node 331 has not been registered. Therefore, the node to be searched next is selected from the left and right child nodes, and the label of this node and the selected direction are stored in the branch stack (FIG. 13).
Step 913). In the branch node, the first search is advanced toward the left child node, and the second search is advanced toward the right child node. Here, the node 331 is advanced to the left node, that is, the node 332, and the expansion processing of the subtree having the node 332 as a root is continued (step 914). Similarly, when the first program path expression tree search is completed, the search path becomes 3
21 → 322 → 323 → 324 → 325 → 326 → 32
7 → 328 → 329 → 330 → 331 → 332 → 334
→ 335 → 336, and the branch stack has (331,
It is stored as'L ')-(335,' L '). In the expansion buffer, [s /] [t /] [u /] [v /] [w /]
A program path of [y /] [z /] is generated. Thus, the first expanded program path is obtained (step 915 in FIG. 12).

【0072】さらに、次のプログラムパスを求めるた
め、分岐スタックのトップの要素の分岐選択情報を読み
(ステップ916)、まだ進むべき方向が残っているか
調べる(ステップ917)。このとき、分岐バッファの
最後に登録された要素は、(335,‘L’)であるの
で、まだ右へ進むことが出来る。そこで、最初のプログ
ラムパスの展開と同様にして、式の木をルートから先行
順で探索する。
Further, in order to obtain the next program path, the branch selection information of the element at the top of the branch stack is read (step 916), and it is checked whether or not there is still a direction to go to (step 917). At this time, since the last registered element of the branch buffer is (335, 'L'), the element can still move to the right. Therefore, the expression tree is searched from the root in the same order as the first program path expansion.

【0073】ノード331まで探索したところで、選択
の制御構造を表すノードに出会う(ステップ902)。
ここで、分岐スタックに、ノード331の情報が登録さ
れていないか調べると、登録されているが、最後に登録
された要素ではないので、前回進んだ向き、すなわち、
左の子の部分木の展開を行う(図13のステップ90
8,909,910)。
After searching up to the node 331, the node representing the control structure for selection is encountered (step 902).
Here, when it is checked whether the information of the node 331 is registered in the branch stack, it is registered, but it is not the last registered element.
Expand the subtree of the left child (step 90 in FIG. 13).
8, 909, 910).

【0074】さらに、探索を続け、ノード335まで探
索したところで、選択の制御構造を表すノードに出会う
(ステップ902)。ここで、分岐スタックに、ノード
335の情報が登録されていないか調べると、ノード3
35の情報は分岐スタックに登録されていて、最後に登
録された要素であるので、その分岐選択情報を‘R’に
書き換えて、ノード335からは右のノード、すなわち
ノード337へ進む(ステップ908,909,91
1,912)。同様にして、2回目のプログラムパス式
の木の探索を終えると、探索経路は、321→322→
323→324→325→326→327→328→3
29→330→331→332→334→335→33
7となり、分岐スタックには、(331,‘L’)−
(335,‘R’)と格納されている。展開バッファに
は、プログラムパス[s/][t/][u/][v/]
[w/][y/][0.]を得る(図12のステップ9
15)。
Further, the search is continued, and when the search is performed up to the node 335, a node representing the control structure of selection is encountered (step 902). Here, when it is checked whether the information of the node 335 is registered in the branch stack, the node 3
Since the information of No. 35 is registered in the branch stack and is the last registered element, the branch selection information is rewritten to “R”, and the node 335 proceeds to the right node, that is, the node 337 (step 908). , 909, 91
1,912). Similarly, when the second search of the program path expression tree is completed, the search path is 321 → 322 →
323 → 324 → 325 → 326 → 327 → 328 → 3
29 → 330 → 331 → 332 → 334 → 335 → 33
7, and the branch stack has (331, 'L')-
It is stored as (335, 'R'). In the expansion buffer, the program path [s /] [t /] [u /] [v /]
[W /] [y /] [0. ] Is obtained (step 9 in FIG. 12)
15).

【0075】さらに、次のプログラムパスを求めるた
め、分岐スタックの最後に登録された要素の分岐選択情
報を読み(ステップ916)、まだ進むべき方向が残っ
ているか調べる(ステップ917)。このとき、分岐バ
ッファの最後に登録された要素は、(335,‘R’)
であるが、ノード335については、すでに両方とも進
んでしまっている。そこで、この要素をポップ(ステッ
プ918)して、分岐スタックから取り除く。次に、分
岐スタックが空か調べる(ステップ919)と、まだ空
でないので、最初のプログラムパスの展開と同様にし
て、式の木をルートから先行順で探索する。
Further, in order to obtain the next program path, the branch selection information of the element registered at the end of the branch stack is read (step 916), and it is checked whether there is a direction to go to (step 917). At this time, the last registered element of the branch buffer is (335, 'R').
However, both of the nodes 335 have already advanced. Therefore, this element is popped (step 918) and removed from the branch stack. Next, when it is checked whether or not the branch stack is empty (step 919), since it is not empty yet, the expression tree is searched from the root in the preceding order in the same manner as the expansion of the first program path.

【0076】ノード331まで探索したところで、選択
の制御構造を表すノードに出会う(ステップ902)。
After searching up to the node 331, a node representing the control structure for selection is encountered (step 902).

【0077】そこで、分岐スタックに、ノード331の
情報が登録されていないか調べると、分岐スタックの最
後の登録された要素であるので、その分岐選択情報を
‘R’に書き換えて、ノード331からは右のノード、
すなわちノード333へ進む(ステップ908,90
9,911,912)。同様にして、3回目のプログラ
ムパス式の木の探索を終えると、探索経路は、321→
322→323→324→325→326→327→3
28→329→330→331→333→334→33
5→336となり、分岐スタックには、(331,
‘R’)−(335,‘L’)と格納される。展開バッ
ファには、プログラムパス[s/][t/][u/]
[v/][x/][y/][z/]を得る(ステップ9
15)。
Then, when it is checked whether or not the information of the node 331 is registered in the branch stack, it is the last registered element of the branch stack, so that the branch selection information is rewritten to'R ', and the node 331 sends it. Is the right node,
That is, the process proceeds to the node 333 (steps 908 and 90).
9, 911, 912). Similarly, when the third search of the program path expression tree is completed, the search path is 321 →
322 → 323 → 324 → 325 → 326 → 327 → 3
28 → 329 → 330 → 331 → 333 → 334 → 33
5 → 336, and the branch stack has (331,
It is stored as'R ')-(335,' L '). In the expansion buffer, the program path [s /] [t /] [u /]
Obtain [v /] [x /] [y /] [z /] (step 9
15).

【0078】さらに、次のプログラムパスを求めるた
め、分岐スタックのトップの要素の分岐選択情報を読み
(ステップ916)、まだ進むべき方向が残っているか
調べる(ステップ917)。このとき、分岐バッファの
トップの要素は、(335,‘L’)であるので、まだ
右へ進むことが出来る。そこで、最初のプログラムパス
の展開と同様にして、式の木をルートから先行順で探索
する。
Further, in order to obtain the next program path, the branch selection information of the top element of the branch stack is read (step 916), and it is checked whether or not there is still a direction to go to (step 917). At this time, since the top element of the branch buffer is (335, 'L'), it is still possible to move to the right. Therefore, the expression tree is searched from the root in the same order as the first program path expansion.

【0079】ノード331まで探索したところで、選択
の制御構造を表すノードに出会う(ステップ902)。
ここで、分岐スタックに、ノード331の位置が登録さ
れていないか調べると、ノード331は分岐スタックに
登録されているが、最後に登録された要素でないので、
前回進んだ向き、すなわち、左へに進む(図13のステ
ップ908,909,910)。
After searching up to the node 331, a node representing a control structure for selection is encountered (step 902).
Here, when it is checked whether the position of the node 331 is registered in the branch stack, the node 331 is registered in the branch stack, but since it is not the last registered element,
The direction in which the operation was performed last time, that is, the operation proceeds to the left (steps 908, 909, and 910 in FIG. 13).

【0080】さらに、探索を続け、ノード335まで探
索したところで、選択の制御構造を表すノードに出会
う。ここで、分岐スタックに、ノード335の位置が登
録されていないか調べる。このとき、ノード335は分
岐スタックのスタックトップに登録されているので、そ
の分岐選択情報を‘R’に書き換えて、ノード335か
らは右のノード、すなわちノード337へ進む(ステッ
プ908,909,911,912)。同様にして、4
回目のプログラムパス式の木の探索を終えると、探索経
路は、321→322→323→324→325→32
6→327→328→329→330→331→333
→334→335→337となり、分岐スタックには、
(331,‘R’)−(335,‘R’)と格納され
る。展開バッファには、プログラムパス[s/][t
/][u/][v/][x/][y/][0.]を得る
(ステップ915)。
Further, the search is continued, and when the search is performed up to the node 335, a node representing the control structure for selection is encountered. Here, it is checked whether the position of the node 335 is registered in the branch stack. At this time, since the node 335 is registered at the stack top of the branch stack, the branch selection information is rewritten to “R”, and the node 335 proceeds to the right node, that is, the node 337 (steps 908, 909, 911). , 912). Similarly, 4
When the search for the tree of the program path expression for the second time is completed, the search path is 321 → 322 → 323 → 324 → 325 → 32.
6 → 327 → 328 → 329 → 330 → 331 → 333
→ 334 → 335 → 337, and the branch stack contains
It is stored as (331, 'R')-(335, 'R'). In the expansion buffer, the program path [s /] [t
/] [U /] [v /] [x /] [y /] [0. ] Is obtained (step 915).

【0081】次に、分岐スタックのトップの分岐選択情
報を読み(ステップ916)、まだ進むべき方向が残っ
ているか調べる(ステップ917)と、ノード335の
子のノードは両方とも探索されたので、進むべきノード
がないとして、分岐スタックから要素を1つポップして
捨てる(ステップ918)。さらに、分岐スタックのト
ップの分岐選択情報をよみ、まだ進むべき方向が残って
いるか調べる。ノード331についても、すでに両方の
子のノードをたどっているので、進むべき方向はないと
して、分岐スタック401から要素を1つポップして捨
てる(ステップ918)。その結果、分岐スタックは空
になっているので、すべての分岐を探索し終えたと判断
して(ステップ919)、展開作業を終了する。
Next, the branch selection information at the top of the branch stack is read (step 916), and it is checked whether or not there is still a direction to proceed (step 917). Since both child nodes of the node 335 have been searched, Assuming there is no node to go to, pop one element from the branch stack and discard (step 918). Furthermore, the branch selection information at the top of the branch stack is read to see if there is still a direction to go. Also for the node 331, since both child nodes have already been traced, it is determined that there is no direction to proceed, and one element is popped from the branch stack 401 and discarded (step 918). As a result, since the branch stack is empty, it is judged that all the branches have been searched (step 919), and the expansion work is ended.

【0082】次に、プログラムパス連結部109の処理
について説明する。
Next, the processing of the program path connecting unit 109 will be described.

【0083】前記プログラムパス式展開部108によっ
て、ルーチンごとのプログラムパス式は展開されて、ル
ーチンごとのプログラムパスリストとして取得されてい
る。
The program path expression expanding unit 108 expands the program path expression for each routine and obtains it as a program path list for each routine.

【0084】プログラムパス式連結処理では、それらの
ルーチンごとのプログラムパスリストを、ジャンプ命令
を考慮しながら連結する。プログラムパス連結処理は、
連結中のプログラムパスを記憶するための連結バッファ
を持つ。連結の手順を以下に示す。
In the program path type linking process, the program path list for each routine is linked while considering the jump instruction. Program path connection processing is
It has a concatenation buffer for storing the program path being concatenated. The ligation procedure is shown below.

【0085】図14に示すように、ルーチンA501に
はl個のプログラムパス514があり、ルーチンB50
2にはm個のプログラムパス514があり、ルーチンC
504にはn個のプログラムパス514があるとする。
As shown in FIG. 14, the routine A 501 has l program paths 514, and the routine B 50
2 has m program paths 514 and routine C
It is assumed that there are n program paths 514 in 504.

【0086】このとき、これらのルーチン間にジャンプ
命令が存在しなければ、ルーチンA501のパス504
→ルーチンB502のパス507→ルーチンC503の
パス509、ルーチンA501のパス504→ルーチン
B502のパス507→ルーチンC503のパス51
0、という具合にすべての組み合わせを求めて連結され
たプログラムパスを求める。連結途中で、プログラムパ
ス514の最後のラベルがプログラムを終了させる命令
であった場合、そのパスの連結作業をそこで終わる。
At this time, if there is no jump instruction between these routines, the path 504 of the routine A501.
→ path 507 of routine B502 → path 509 of routine C503, path 504 of routine A501 → path 507 of routine B502 → path 51 of routine C503
The combined program paths are found by finding all combinations such as 0. If the last label of the program path 514 is an instruction to end the program in the middle of connection, the connection operation of the path is ended there.

【0087】ルーチンA501のプログラムパスのうち
で、パス505のようにプログラムパスの最後のラベル
がジャンプ命令である場合には、まず、その飛び先のル
ーチンのルーチン識別番号をルーチン情報テーブル12
3、ルーチン識別テーブルを用いて特定する。
In the program path of the routine A501, if the last label of the program path is a jump instruction like the path 505, first, the routine identification number of the routine of the jump destination is set to the routine information table 12.
3. Specify using the routine identification table.

【0088】そのルーチン識別番号513が、ルーチン
A501の識別番号511より大きいならば、前方ジャ
ンプであるので、ルーチンA501のパス505→ルー
チンC503のパス509、ルーチンA501のパス5
05→ルーチンC503のパス510という具合に連結
する。
If the routine identification number 513 is larger than the identification number 511 of the routine A501, it means that the jump is forward. Therefore, the path 505 of the routine A501 → the path 509 of the routine C503 and the path 5 of the routine A501.
05 → path 510 of routine C503 is connected.

【0089】もし、図14の下の図のように、特定され
たルーチン識別番号525がルーチンA517の識別番
号527より小さいなら、後方ジャンプと判定し、無限
に連結するのを防ぐために、以下のチェックを入れる。
すなわち、連結バッファの中に含まれる、いま検出した
ジャンプ命令のラベルが幾つあるか数え上げ、ユーザに
よって指定された繰り返しの上限値に達しているか調べ
る。
If the specified routine identification number 525 is smaller than the identification number 527 of the routine A 517 as shown in the lower part of FIG. 14, it is determined to be a backward jump, and in order to prevent infinite connection, Put a check.
That is, the number of labels of the jump instruction detected in the concatenation buffer is counted, and it is checked whether the upper limit value of the repetition specified by the user is reached.

【0090】上限値に達していれば、現在連結している
プログラムパスを破棄し、次のプログラムパスの展開に
移る。達していなければ、連結先のルーチンに戻って連
結を続ける。
If the upper limit value has been reached, the currently connected program path is discarded and the next program path is expanded. If not, the routine returns to the connection destination routine to continue the connection.

【0091】このようにして、すべてのルーチンのプロ
グラムパスを連結し、プログラムとしてのプログラムパ
スリストを得る。
In this way, the program paths of all routines are linked to obtain the program path list as a program.

【0092】次に、プログラムドメイン取得部110の
説明をする。
Next, the program domain acquisition unit 110 will be described.

【0093】プログラムドメイン取得処理では、プログ
ラムパス式連結処理で求められたプログラムパスリスト
の1つ1つのプログラムパス620それぞれについて、
図15および図16のフローチャートにしたがって、以
下の手順によってプログラムドメインを取得する。図1
7に簡単な実行例を示す。
In the program domain acquisition process, for each program path 620 in the program path list obtained in the program path type concatenation process,
The program domain is acquired by the following procedure according to the flowcharts of FIGS. 15 and 16. Figure 1
7 shows a simple execution example.

【0094】まず、式の木のキュー621を用意する
(ステップ1101)。そして、プログラムパスのラベ
ルをすべて読むまで、以下の処理を繰り返す。
First, an expression tree queue 621 is prepared (step 1101). Then, the following processing is repeated until all the program path labels are read.

【0095】まず、プログラムパスのラベルに対応する
処理を構文木121(図3)を参照して調べ、処理がデ
ータ転記、演算命令、条件判定式を処理内容かどうかを
判定する(ステップ1102,1103)。そうであれ
ば、図17に示すような処理に対応する代入式、条件式
の式の木622を作成する(ステップ1104)。この
とき、COBOL言語の命令のように、直接、代入式の
形で記述されていないものは、言語の文法にしたがって
解析し、単独の、あるいは複数の代入式に変換して式の
木を作成する。また、条件名を使って条件判定式が書か
れている場合も、実際に判定される条件式に変換してか
ら式の木を作成する。否定演算子が条件式中に含まれる
場合は、論理演算子や比較演算子を適当に変換して、否
定演算子を含まない条件式に変換する。また、列挙定数
名が使われていれば、それが示す定数値に変換する。
First, the processing corresponding to the label of the program path is examined with reference to the syntax tree 121 (FIG. 3), and it is determined whether the processing is a data transfer, a calculation instruction, or a conditional judgment expression (step 1102). 1103). If so, the expression tree 622 of the assignment expression and the conditional expression corresponding to the processing as shown in FIG. 17 is created (step 1104). At this time, an instruction that is not directly described in the form of an assignment expression, such as a COBOL language instruction, is analyzed according to the grammar of the language and converted into a single or multiple assignment expressions to create an expression tree. To do. In addition, even if the conditional judgment expression is written using the condition name, the expression tree is created after converting it into the conditional expression that is actually judged. If the negation operator is included in the conditional expression, the logical operator or the comparison operator is appropriately converted to a conditional expression that does not include the negation operator. If the enumeration constant name is used, it is converted to the constant value indicated by it.

【0096】さらに、生成された式の木622の中に変
数を使っている個所があるか検索し、変数を検出した場
合、その変数名をデータ項目情報テーブル122中の情
報を使って、変数が配置されるデータ領域の先頭からの
オフセットと、その変数が占有する記憶領域の大きさの
2つの数値を用いたシンボル名623に変換する(ステ
ップ1105)。
Further, if a variable is searched for in the generated expression tree 622 and a variable is detected, the variable name is used as a variable by using the information in the data item information table 122. Is converted into a symbol name 623 using an offset from the beginning of the data area in which is allocated and two numerical values of the size of the storage area occupied by the variable (step 1105).

【0097】その後、ステップ1104,1105で生
成された式の木を式の木のキュー621に格納する(ス
テップ1106)。
Thereafter, the expression tree generated in steps 1104 and 1105 is stored in the expression tree queue 621 (step 1106).

【0098】なお、データ転記、演算命令、条件判定式
を処理内容として表すラベルでないものは無視する。
It should be noted that items other than the labels representing the data transfer, the operation command, and the condition determination expression as the processing content are ignored.

【0099】次に、得られた式の木のキュー621か
ら、プログラムパスのドメインを取得する。
Next, the domain of the program path is acquired from the obtained expression tree queue 621.

【0100】まず、式の木のキュー621から式の木6
22を一つ取り出す(ステップ1107)。取り出した
式の木が代入文であった時に行う処理の手順を以下に示
す。
First, from the expression tree queue 621 to the expression tree 6
One 22 is taken out (step 1107). The procedure of the process performed when the extracted expression tree is an assignment statement is shown below.

【0101】まず、取り出した代入文の左辺にあるシン
ボル名623(図17)を取得する(ステップ110
9)。
First, the symbol name 623 (FIG. 17) on the left side of the fetched assignment statement is acquired (step 110).
9).

【0102】次に、式の木のキュー621をデキューせ
ずに先読みして、シンボル名623が表す変数の占有し
ている記憶領域の全部または一部を最初に更新している
式の木624(図17)を特定する(ステップ111
0,1111)。この際、式の木624の更新されてい
る変数が、シンボル名623が表す変数と記憶領域の全
部、あるいは、一部を共有しているかどうかの判定は、
更新されている変数のシンボル名中のオフセット値が、
シンボル名623の表す変数の占有する記憶領域に含ま
れるかどうかで判定する。
Next, the expression tree queue 621 is pre-read without dequeuing, and the expression tree 624 in which all or part of the storage area occupied by the variable represented by the symbol name 623 is updated first. (FIG. 17) is specified (step 111)
0, 1111). At this time, it is determined whether the updated variable in the expression tree 624 shares all or part of the storage area with the variable represented by the symbol name 623.
The offset value in the symbol name of the variable being updated is
It is determined whether or not it is included in the storage area occupied by the variable represented by the symbol name 623.

【0103】次に、キューの先頭から式の木624まで
の式の木を1つずつ読み、その式の木が表す代入式の右
辺、または条件判定式の中に、シンボル名623、また
はシンボル名623が表す変数の占有している記憶領域
全体を共有している変数のシンボル名がないか調べ、あ
れば、それを代入文の式の木624の右辺で置き換える
(ステップ1112)。
Next, the expression trees from the head of the queue to the expression tree 624 are read one by one, and the symbol name 623 or the symbol is inserted in the right side of the assignment expression or the conditional expression represented by the expression tree. It is checked whether there is a symbol name of a variable that shares the entire storage area occupied by the variable represented by the name 623, and if there is, it is replaced with the right side of the expression tree 624 of the assignment statement (step 1112).

【0104】もし、式の木624が見つからなければ、
処理611で、式の木のキュー621全体の式の木に対
して、先頭から順に上記の調査、置き換えを行う(ステ
ップ1113)。
If the expression tree 624 is not found,
In process 611, the above-described check and replacement are performed in order from the beginning for the expression trees of the entire expression tree queue 621 (step 1113).

【0105】置き換えを行った後、代入文の式の木62
2を破棄する(ステップ1114)。
After replacement, the expression tree 62 of the assignment statement
2 is discarded (step 1114).

【0106】次に、取り出した式の木が条件判定式であ
った場合は、ドメインの制約条件として、制約条件リス
ト625に加え、式の木のキュー621から破棄する
(ステップ1115)。
Next, if the extracted expression tree is a condition determination expression, it is discarded from the expression tree queue 621 as a domain restriction condition in addition to the restriction condition list 625 (step 1115).

【0107】以上のステップ1107〜1115を式の
木のキュー621が空になるまで繰り返したとき、制約
条件リスト625中に格納されている制約条件の組が、
注目しているプログラムのドメインの1つを与える。
When the above steps 1107 to 1115 are repeated until the queue 621 of the expression tree becomes empty, the constraint condition set stored in the constraint condition list 625 becomes
Give one of the domains of the program of interest.

【0108】さらに、制約条件リスト625から制約条
件式を1つ読み(図16のステップ1116)、取り出
した制約条件式を評価する(ステップ1117,111
8)。
Furthermore, one constraint condition expression is read from the constraint condition list 625 (step 1116 in FIG. 16), and the extracted constraint condition expression is evaluated (steps 1117 and 111).
8).

【0109】すべての制約条件について、評価結果が真
または評価不能であれば、有効なパスとして登録する
(ステップ1120)。評価した結果が1つでも、偽で
あった場合は、矛盾した制約条件を持つパスであるとし
て、パスを破棄する(ステップ1121)。
If the evaluation result is true or non-evaluable for all constraint conditions, it is registered as a valid path (step 1120). If even one evaluated result is false, the path is discarded as a path having a contradictory constraint condition (step 1121).

【0110】以上の処理をプログラムパスリストのプロ
グラムパス1つ1つについて行い、プログラムパスリス
トの1つ1つのプログラムパスそれぞれについてそのパ
スが実行されるための制約条件を求め、プログラムのド
メインを求める。
The above processing is performed for each program path in the program path list, and for each program path in the program path list, the constraint condition for executing the path is obtained, and the domain of the program is obtained. .

【0111】図18および図19は、解析前のソースプ
ログラムの例を示す図であり、図20は波及効果解析処
理後のソースプログラムの内容を示す図である。また、
図21〜図23は、波及効果解析処理後のソースプログ
ラムをある表計算ソフトに読み込ませて表形式にまとめ
た図であり、図21に矢印で示すようなプログラムパス
が存在することが表されている。
18 and 19 are diagrams showing examples of the source program before analysis, and FIG. 20 is a diagram showing the contents of the source program after the ripple effect analysis process. Also,
21 to 23 are diagrams in which the source program after the ripple effect analysis processing is read by a certain spreadsheet software and summarized in a table format, and it is shown that a program path as shown by an arrow in FIG. 21 exists. ing.

【0112】[0112]

【発明の効果】以上説明したように、本発明によれば、
ユーザが指定した変数に関する波及効果解析を行うこと
により、ユーザの関心のあるデータに関連する範囲を特
定することができ、そのデータの関連するプログラムパ
スについて、データと処理の面から解析し、ユーザが指
定した変数の条件に当てはまるテストデータを自動生成
することができる。これにより、デバッグや流用開発時
のプログラム理解の支援およびテストデータの決定を容
易にし、テストにかかる工数を削減できるといった優れ
た効果が得られる。
As described above, according to the present invention,
By performing the ripple effect analysis on the variables specified by the user, it is possible to identify the range related to the data of interest to the user, analyze the related program path of the data in terms of data and processing, and It is possible to automatically generate test data that meets the condition of the variable specified by. As a result, it is possible to obtain an excellent effect that it is possible to facilitate the understanding of the program at the time of debugging or diversion development, facilitate the determination of the test data, and reduce the man-hour required for the test.

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

【図1】本発明のテストデータ自動生成装置の一実施形
態を示す機能構成図である。
FIG. 1 is a functional configuration diagram showing an embodiment of a test data automatic generation device of the present invention.

【図2】本発明の処理の実行手順のフローチャートであ
る。
FIG. 2 is a flowchart of an execution procedure of processing of the present invention.

【図3】構文解析手段が生成するデータの概略を示す図
である。
FIG. 3 is a diagram showing an outline of data generated by a syntax analysis unit.

【図4】波及効果解析部104の構成図である。FIG. 4 is a configuration diagram of a ripple effect analysis unit 104.

【図5】波及効果解析処理のフローチャートである。FIG. 5 is a flowchart of a ripple effect analysis process.

【図6】図5の続きを示すフローチャートである。FIG. 6 is a flowchart showing a continuation of FIG.

【図7】波及効果解析手段で生成される制御構造の木の
例である。
FIG. 7 is an example of a control structure tree generated by the ripple effect analysis means.

【図8】プログラムパス式の木の例である。FIG. 8 is an example of a program path expression tree.

【図9】プログラムパス式の木の例である。FIG. 9 is an example of a program path expression tree.

【図10】サブルーチン置換処理のフローチャートであ
る。
FIG. 10 is a flowchart of a subroutine replacement process.

【図11】プログラムパス式展開処理のフローチャート
である。
FIG. 11 is a flowchart of a program path type expansion process.

【図12】図11の続きを示すフローチャートである。FIG. 12 is a flowchart showing a continuation of FIG. 11.

【図13】図12の続きを示すフローチャートである。FIG. 13 is a flowchart showing a sequel to FIG. 12;

【図14】プログラムパス連結処理の説明の図である。FIG. 14 is a diagram illustrating a program path linking process.

【図15】プログラムパスドメイン取得処理のフローチ
ャートである。
FIG. 15 is a flowchart of a program path domain acquisition process.

【図16】図15の続きを示すフローチャートである。16 is a flowchart showing a continuation of FIG.

【図17】プログラムドメイン取得処理の簡単な例を示
す図である。
FIG. 17 is a diagram showing a simple example of program domain acquisition processing.

【図18】解析前ソースプログラムの例を示す図であ
る。
FIG. 18 is a diagram showing an example of a source program before analysis.

【図19】図18の続きを示す図である。FIG. 19 is a view showing a sequel to FIG. 18;

【図20】波及効果解析後のソースプログラムの例を示
す図である。
FIG. 20 is a diagram showing an example of a source program after the ripple effect analysis.

【図21】本発明を実施して得られる結果を、ある表計
算ソフトに読み込ませたものの一部を示す図である。
FIG. 21 is a diagram showing a part of a result obtained by implementing the present invention read into a certain spreadsheet software.

【図22】図21の続きを示す図である。FIG. 22 is a view illustrating a sequel to FIG. 21;

【図23】図22の続きを示す図である。FIG. 23 is a view illustrating a sequel to FIG. 22;

【符号の説明】[Explanation of symbols]

101…端末、102…ソースファイル、103…構文
解析部、104…波及効果解析部、105…プログラム
ネットワーク作成部、106…プログラムパス式作成
部、107…サブルーチン置換部、108…プログラム
パス式展開部、109…プログラムパス連結部、110
…プログラムドメイン取得部、111…テストデータ取
得部、121…構文木、122…データ項目情報テーブ
ル、123…ルーチン情報テーブル、124…変数情
報、125…ルーチン情報、230…ユーザによって指
定された波及効果解析の起点となる変数を記憶しておく
ためのエリア、231…制御構造の木、232…文識別
番号、233…分岐識別番号、234…変数エリア23
0内の変数と記憶領域を共有している変数のリスト、2
35…波及範囲に含まれる文のリスト、240…変数リ
スト234中の変数から影響を受ける変数のリスト、3
01…プログラムパス式、302…プログラムパス式の
木306…ラベル、621…プログラムパスから演算、
代入、条件判定式を取り出して式の木にしたキュー、6
22…式の木のキュー621に含まれる式の木、623
…データ名をデータ領域の先頭からのオフセットとサイ
ズで表したシンボル名、625…あるプログラムパスが
実行されるための入力データが満たすべき条件のリス
ト。
101 ... Terminal, 102 ... Source file, 103 ... Syntax analysis unit, 104 ... Ripple effect analysis unit, 105 ... Program network creation unit, 106 ... Program path expression creation unit, 107 ... Subroutine replacement unit, 108 ... Program path expression expansion unit , 109 ... Program path connection unit, 110
... program domain acquisition unit, 111 ... test data acquisition unit, 121 ... syntax tree, 122 ... data item information table, 123 ... routine information table, 124 ... variable information, 125 ... routine information, 230 ... ripple effect specified by user Area for storing variables as the starting point of analysis, 231, ... Tree of control structure, 232 ... Sentence identification number, 233 ... Branch identification number, 234 ... Variable area 23
A list of variables that share a storage area with variables in 0, 2
35 ... a list of sentences included in the spread range, 240 ... a list of variables affected by the variables in the variable list 234, 3
01 ... Program path expression, 302 ... Tree of program path expression 306 ... Label, 621 ... Calculation from program path,
Queue that takes out substitution and conditional judgment expressions and turns them into expression trees, 6
22 ... Expression tree 623 included in expression tree queue 621
A symbol name in which a data name is represented by an offset from the head of the data area and a size, 625 ... A list of conditions that the input data must satisfy to execute a certain program path.

フロントページの続き (72)発明者 新居 健司 神奈川県横浜市中区尾上町6丁目81番地 日立ソフトウェアエンジニアリング株 式会社内 (56)参考文献 特開 平2−17547(JP,A) 特開 平5−181655(JP,A) (58)調査した分野(Int.Cl.7,DB名) G06F 11/28 - 11/34 JICSTファイル(JOIS)Front Page Continuation (72) Inventor Kenji Arai 6-81 Onoe-cho, Naka-ku, Yokohama-shi, Kanagawa Hitachi Software Engineering Co., Ltd. (56) References JP-A-2-17547 (JP, A) JP-A-5 -181655 (JP, A) (58) Fields investigated (Int.Cl. 7 , DB name) G06F 11/28-11/34 JISST file (JOIS)

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】ソースプログラムを解析し、テストデータ
を自動生成する装置において、 テストデータ生成対象のソースプログラムを解析し、構
文木を作り、変数の階層構造と大きさと別名、再定義、
サブルーチンの情報を収集する構文解析処理を行う構文
解析手段と、ユーザによって指定された変数の値の影響
がソースプログラム内で波及する範囲を特定し、その部
分を取り出すための波及効果解析処理を行う波及効果解
析手段と、前記波及効果解析処理によって得られた解析
結果を用い、ユーザによって指定された変数について、
その変数が満たすべき条件を算出する条件算出手段と、
算出された条件に当てはまる変数のテストデータを自動
生成する手段と、前記波及効果解析処理によって得られ
た解析結果を用い、ルーチン毎にプログラムネットワー
クを作成するプログラムネットワーク作成処理を行うプ
ログラムネットワーク作成手段と、前記プログラムネッ
トワークからプログラムパス式を生成するプログラムパ
ス式生成処理を実行するプログラムパス式生成手段と、
サブルーチンコールが検出された場合、それをコール先
のサブルーチンのプログラムパス式で置き換えるサブル
ーチン置換処理を実行するサブルーチン置換手段と、生
成されたプログラムパス式を展開するプログラムパス式
展開処理を実行するプログラムパス式展開手段と、分割
して求められたプログラムパスをプログラムの処理の流
れにしたがって連結するプログラムパス連結処理を実行
するプログラムパス連結手段とを備え、前記条件算出手
段は、連結されたプログラムパスからそのプログラムパ
スが実行されるための変数の条件を算出することを特徴
とするプログラムのテストデータ自動生成装置。
Claim: What is claimed is: 1. An apparatus for analyzing a source program and automatically generating test data, analyzing a source program of a test data generation target, creating a syntax tree, and hierarchical structure and size of variables and aliases, redefinition,
The parsing means that performs the parsing process that collects the information of the subroutine and the range in which the influence of the value of the variable specified by the user spreads in the source program are specified, and the ripple effect analysis process that takes out that part is performed. Using the ripple effect analysis means and the analysis result obtained by the ripple effect analysis processing, for the variable designated by the user,
Condition calculating means for calculating the condition that the variable should satisfy,
Means to automatically generate test data of variables that apply to the calculated conditions, and to obtain by the ripple effect analysis process
The analysis result is used to program the program network for each routine.
A program that creates a network
Program network creation means and the program network
Program path that generates a program path expression from the network
Program path expression generating means for executing the expression generation processing,
If a subroutine call is detected, call it
Replaced by the program path expression of the subroutine
Subroutine replacement means for executing routine replacement processing, and
A program path expression that expands the created program path expression
Program path type expansion means for executing expansion processing, and division
The program path obtained by
Perform program path linking process to link according to this
And a program path connecting means for
A column is the program path from the linked program path.
It is characterized by calculating the condition of variables for execution
Automatic test data generation device for programs.
【請求項2】 プログラムパスの条件算出時に、変数名
を、データ領域の先頭からのオフセットと、その変数が
占有する領域の大きさの2つの数値を使ったシンボル名
に変換することで、複数の変数が任意の記憶領域を共有
している場合でも変数が満たすべき条件を算出する手段
を有することを特徴とする請求項1記載のプログラムの
テストデータ自動生成装置。
2. When a program path condition is calculated, a variable name is converted into a symbol name using an offset from the beginning of a data area and two numerical values of the size of the area occupied by the variable, thereby making a plurality 2. The program test data automatic generation device according to claim 1, further comprising means for calculating a condition to be satisfied by the variable even when the variable shares an arbitrary storage area.
JP07555398A 1998-03-24 1998-03-24 Automatic test data generator for programs Expired - Fee Related JP3418544B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP07555398A JP3418544B2 (en) 1998-03-24 1998-03-24 Automatic test data generator for programs

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP07555398A JP3418544B2 (en) 1998-03-24 1998-03-24 Automatic test data generator for programs

Publications (2)

Publication Number Publication Date
JPH11272503A JPH11272503A (en) 1999-10-08
JP3418544B2 true JP3418544B2 (en) 2003-06-23

Family

ID=13579499

Family Applications (1)

Application Number Title Priority Date Filing Date
JP07555398A Expired - Fee Related JP3418544B2 (en) 1998-03-24 1998-03-24 Automatic test data generator for programs

Country Status (1)

Country Link
JP (1) JP3418544B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10489149B2 (en) 2013-03-22 2019-11-26 International Business Machines Corporation Information processing apparatus, information processing method and program

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPWO2007072652A1 (en) * 2005-12-22 2009-05-28 俊一 新原 Program processing pattern automatic analysis processor
JP5440287B2 (en) * 2010-03-15 2014-03-12 富士通株式会社 Symbolic execution support program, method and apparatus
US8479171B2 (en) * 2010-05-24 2013-07-02 Fujitsu Limited Generating test sets using intelligent variable selection and test set compaction
JP5505227B2 (en) * 2010-09-22 2014-05-28 富士通株式会社 Repetitive symbolic execution method, program, and apparatus
JP5458065B2 (en) * 2011-07-25 2014-04-02 伸一 石田 Device and program for supporting structural analysis of module
US9069892B2 (en) 2013-05-10 2015-06-30 International Business Machines Corporation Reducing false-positive errors in a software change-impact analysis
JP6574151B2 (en) * 2016-08-19 2019-09-11 日本電信電話株式会社 Program analysis apparatus, program analysis method, and program analysis program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10489149B2 (en) 2013-03-22 2019-11-26 International Business Machines Corporation Information processing apparatus, information processing method and program

Also Published As

Publication number Publication date
JPH11272503A (en) 1999-10-08

Similar Documents

Publication Publication Date Title
US5359546A (en) Automatic generation of test drivers
US5701487A (en) Method and apparatus for displaying locations of errors detected inside software macro calls
US7340728B2 (en) Methods and systems for direct execution of XML documents
US8006229B2 (en) Program maintenance support device and program for the same
US6859810B2 (en) Declarative specification and engine for non-isomorphic data mapping
US7647587B2 (en) Methods for enhancing type reconstruction
US20010037492A1 (en) Method and apparatus for automatically extracting verification models
US7937694B2 (en) Fast flattening of nested streams
JP2007521568A (en) Intermediate representation of multiple exception handling models
CN113508385B (en) Method and system for formal language processing using subroutine graphs
US8615729B2 (en) Extending existing model-to-model transformations
US7043720B2 (en) Mechanism for reformatting a simple source code statement into a compound source code statement
RU2347269C2 (en) System and method of declarative definition and use of subclasses in marking
JP3418544B2 (en) Automatic test data generator for programs
CN112487019A (en) Method and system for analyzing dynamic SQL (structured query language) for OpenGauss database
JP2879099B1 (en) Abstract syntax tree processing method, computer readable recording medium recording abstract syntax tree processing program, computer readable recording medium recording abstract syntax tree data, and abstract syntax tree processing device
Koskimies et al. The design of a language processor generator
CN118170386A (en) Term compiling method, term compiling system, storage medium and electronic device
CN118092892A (en) Visual editing system, method and storage medium for scene file
JP3166699B2 (en) Object-oriented program design support apparatus, method, and recording medium
JP5399601B2 (en) Implementation code development system and implementation code development program
JPH09288580A (en) Device and method for optimizing source program
Cyre et al. Generating validation feedback for automatic interpretation of informal requirements
KR20020032889A (en) A Method for Analysing a Call-Hierarchy among JAVA Classes
JPH06266562A (en) Object code size optimizing system in object-oriented language processing system

Legal Events

Date Code Title Description
R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

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

Free format text: PAYMENT UNTIL: 20090411

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20120411

Year of fee payment: 9

LAPS Cancellation because of no payment of annual fees