JPH07311694A - Analyzing method for program execution path - Google Patents

Analyzing method for program execution path

Info

Publication number
JPH07311694A
JPH07311694A JP6101211A JP10121194A JPH07311694A JP H07311694 A JPH07311694 A JP H07311694A JP 6101211 A JP6101211 A JP 6101211A JP 10121194 A JP10121194 A JP 10121194A JP H07311694 A JPH07311694 A JP H07311694A
Authority
JP
Japan
Prior art keywords
statement
execution path
program
execution
storage area
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.)
Pending
Application number
JP6101211A
Other languages
Japanese (ja)
Inventor
Akio Sato
明夫 佐藤
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
Hitachi Ltd
Original Assignee
Hitachi Software Engineering Co Ltd
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Software Engineering Co Ltd, Hitachi Ltd filed Critical Hitachi Software Engineering Co Ltd
Priority to JP6101211A priority Critical patent/JPH07311694A/en
Publication of JPH07311694A publication Critical patent/JPH07311694A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To prevent defective generation at the time of program modification and improve the quality by managing the quality of a program product by paying attention to the program execution path. CONSTITUTION:An instruction execution network generating process part 14 generates new and old network tables 18a and 18b by using a source program 11 before modification, a source program 12 after modification, and a parameter 13 as input data. Then an executable path quantity calculating process part 15 generates new and old combination tables 19a and 19b on the basis of the new and old network tables 18a and 18b. Further, an execution path table generating process part 16 generate new and old execution path tables 20a and 20b on the basis of the new and old network tables 18a and 18b and new and old combination tables 19a and 19b. Lastly, an influence path information extracting process part 17 extracts and outputs influence path information 201 on the basis of the new and old execution path tables 20a and 20b.

Description

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

【0001】[0001]

【産業上の利用分野】本発明はプログラム実行パスの解
析方法に係り、特に、プログラムテストの対象範囲を決
定するために用いるプログラム実行パスの解析方法に関
する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a program execution path analysis method, and more particularly to a program execution path analysis method used to determine a target range of a program test.

【0002】[0002]

【従来の技術】従来より、作成したプログラムのデバッ
グに伴ってソースプログラムの変更作業を行ったときに
は、クロスリファレンスなどを用いて、上記変更作業に
よってどのような影響が生ずるのかを調べていた。ま
た、変更後のソースプログラムに対して再度のプログラ
ムテストを行う際には、ソースプログラムの各所に設定
されたカバレジ情報に基づき、プログラムの変更による
影響箇所に対してのみテストが行われるように再テスト
項目を決定することにより、再テストの効率化を図って
いた(特開平1−229341号公報に記載の発明)。
2. Description of the Related Art Conventionally, when a source program is changed while a created program is being debugged, a cross reference or the like has been used to investigate what kind of influence the change has. In addition, when performing a program test again on the changed source program, retest so that only the affected parts due to the program change are tested based on the coverage information set in each part of the source program. By deciding the test item, the efficiency of the re-test is improved (the invention described in Japanese Patent Laid-Open No. 1-229341).

【0003】[0003]

【発明が解決しようとする課題】上記従来技術では、カ
バレジ情報に基づいて変更作業による影響箇所を特定す
ることはできたが、当該影響箇所を経由して実行される
プログラム実行パス(プログラム実行時に選択し得るい
ずれかひとつの“処理の流れ”)を特定することはでき
なかった。このため、プログラムの変更前後におけるプ
ログラム実行パスが異なってしまう場合など(例えば、
分岐文の追加・削除や、分岐条件の変更などが行われた
場合など)には、カバレジ情報に基づいて決定された再
テスト項目によるプログラムテストでは検出できない不
良を作り込みやすく、生産されるプログラム製品の品質
管理を十分に行うことができないという問題点があっ
た。
In the above-mentioned prior art, although it was possible to identify the affected part due to the change work based on the coverage information, the program execution path executed via the affected part (at the time of program execution) It was not possible to specify any one of the "process flows" that could be selected. Therefore, if the program execution path before and after the program change is different (for example,
When a branch statement is added / deleted, branch conditions are changed, etc.), it is easy to create defects that cannot be detected by the program test by the retest items determined based on the coverage information, and the produced program There is a problem that the quality control of the product cannot be performed sufficiently.

【0004】したがって本発明の目的は、上記の問題点
を解決して、プログラム実行パスに着目したプログラム
テストを可能として、プログラム製品の品質管理を十分
に行うことのできるプログラム実行パスの解析方法を提
供することにある。
Therefore, an object of the present invention is to solve the above problems, to enable a program test focusing on the program execution path, and to provide a program execution path analysis method capable of sufficiently controlling the quality of a program product. To provide.

【0005】[0005]

【課題を解決するための手段】[Means for Solving the Problems]

(1) 上記の目的を達成するため、本発明のプログラム実
行パスの解析方法は、解析対象とするソースプログラム
について、当該ソースプログラムを構成する命令文中の
分岐文と実行文とを選別し、それぞれの分岐文における
分岐条件のすべての組合せを求め、これに基づいて当該
ソースプログラムにおけるすべてのプログラム実行パス
を表わすプログラム実行パステーブルを作成するもので
ある。
(1) In order to achieve the above object, the analysis method of the program execution path of the present invention, for the source program to be analyzed, selects the branch statement and the execution statement in the instruction statement constituting the source program, respectively, All the combinations of branch conditions in the branch statement of are obtained, and based on this, a program execution path table showing all program execution paths in the source program is created.

【0006】(2) また、デバッグに伴う変更作業前後の
ソースプログラム(変更前:第1のソースプログラム,
変更後:第2のソースプログラム)について、第1のソ
ースプログラムに基づく第1のプログラム実行パステー
ブルを作成するとともに、前記第1のソースプログラム
を変更して得られた第2のソースプログラムに基づく第
2のプログラム実行パステーブルを作成し、前記第1お
よび第2のプログラム実行パステーブルを比較対照して
上記変更の影響を受けるすべてのプログラム実行パスを
抽出するものである。
(2) Further, the source program before and after the change work associated with debugging (before the change: the first source program,
(After change: second source program), based on a second source program obtained by changing the first source program while creating a first program execution path table based on the first source program. A second program execution path table is created, and the first and second program execution path tables are compared and compared to extract all the program execution paths affected by the change.

【0007】[0007]

【作用】上記構成に基づく作用を説明する。The operation based on the above configuration will be described.

【0008】(1) 本発明のプログラム実行パスの解析方
法では、解析対象とするソースプログラムについて、当
該ソースプログラムを構成する命令文中の分岐文と実行
文とを選別し、それぞれの分岐文における分岐条件のす
べての組合せを求め、これに基づいて当該ソースプログ
ラムにおけるすべてのプログラム実行パスを表わすプロ
グラム実行パステーブルを作成することにより、プログ
ラム中の個々の命令文が実行されるか否かではなく、プ
ログラム実行時に各々のプログラム実行パスが採用され
るか否かに着目してプログラムテストを行うことが可能
となるため、生産されるプログラム製品の品質管理を十
分に行うことができる。
(1) According to the program execution path analysis method of the present invention, for a source program to be analyzed, a branch statement and an execution statement in the instruction statements that make up the source program are selected, and the branch in each branch statement is selected. By obtaining all combinations of conditions and creating a program execution path table that represents all program execution paths in the source program based on the combinations, whether or not individual statement statements in the program are executed, Since it becomes possible to perform a program test by paying attention to whether or not each program execution path is adopted at the time of program execution, it is possible to sufficiently perform quality control of the produced program product.

【0009】(2) また、デバッグに伴う変更作業前後の
ソースプログラム(変更前:第1のソースプログラム,
変更後:第2のソースプログラム)について、第1のソ
ースプログラムに基づく第1のプログラム実行パステー
ブルを作成するとともに、前記第1のソースプログラム
を変更して得られた第2のソースプログラムに基づく第
2のプログラム実行パステーブルを作成し、前記第1お
よび第2のプログラム実行パステーブルを比較対照して
上記変更の影響を受けるすべてのプログラム実行パスを
抽出することにより、変更の影響があったすべてのプロ
グラム実行パスに対する再テスト項目を決定して再度の
プログラムテストを行うことが可能となるため、変更作
業によって作り込んでしまった不良を確実かつ正確に検
出し、生産されるプログラム製品の品質管理を十分に行
うことができる。
(2) Further, the source program before and after the change work associated with debugging (before the change: the first source program,
(After change: second source program), based on a second source program obtained by changing the first source program while creating a first program execution path table based on the first source program. There is a change effect by creating a second program execution path table and comparing and comparing the first and second program execution path tables to extract all the program execution paths affected by the change. Since it is possible to determine the retest items for all program execution paths and perform the program test again, the defects created by the change work can be detected reliably and accurately, and the quality of the produced program product Can manage well.

【0010】[0010]

【実施例】以下、本発明のプログラム実行パスの解析方
法の一実施例を図面を用いて詳細に説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the program execution path analysis method of the present invention will be described in detail below with reference to the drawings.

【0011】図1は、本発明のプログラム実行パスの解
析方法を実現するシステムの一実施例の概略構成を示す
図である。同図において、変更前ソ−スプログラム1
1,変更後ソ−スプログラム12,パラメ−タ13を入
力データとして、命令実行ネットワ−ク作成処理部14
は、変更前ソ−スプログラム11に対応する旧ネットワ
ークテーブル18aおよび変更後ソ−スプログラム12
に対応する新ネットワークテーブル18bを作成する。
次に、旧ネットワークテーブル18aおよび新ネットワ
ークテーブル18bを入力データとして、実行可能パス
数計算処理部15は、変更前ソ−スプログラム11に対
応する旧組合せテーブル19aおよび変更後ソ−スプロ
グラム12に対応する新組合せテーブル19を作成す
る。さらに、旧組合せテーブル19aおよび新組合せテ
ーブル19を入力データとして、実行パステーブル生成
処理部16は、変更前ソ−スプログラム11に対応する
旧実行パステーブル20aおよび変更後ソ−スプログラ
ム12に対応する新実行パステーブル20bを生成す
る。最後に、旧実行パステーブル20aおよび新実行パ
ステーブル20bを入力データとして、影響パス情報抽
出処理部17は、すべての影響パス(変更前ソ−スプロ
グラム11を変更後ソ−スプログラム12に変更したこ
とによって影響を受けるプログラム実行パス)に関する
情報を示す影響パス情報201を抽出する。
FIG. 1 is a diagram showing a schematic configuration of an embodiment of a system for realizing the program execution path analysis method of the present invention. In the figure, source program 1 before change
1, the post-change source program 12 and the parameter 13 as input data, the instruction execution network creation processing unit 14
Is the old network table 18a corresponding to the source program 11 before the change and the source program 12 after the change.
The new network table 18b corresponding to is created.
Next, using the old network table 18a and the new network table 18b as input data, the feasible path number calculation processing unit 15 stores the old combination table 19a and the changed source program 12 corresponding to the source program 11 before the change. The corresponding new combination table 19 is created. Further, using the old combination table 19a and the new combination table 19 as input data, the execution path table generation processing unit 16 corresponds to the old execution path table 20a and the changed source program 12 corresponding to the source program 11 before change. The new execution path table 20b is generated. Finally, using the old execution path table 20a and the new execution path table 20b as input data, the affected path information extraction processing unit 17 changes all the affected paths (the source program 11 before the change to the source program 12 after the change). The influence path information 201 indicating the information regarding the program execution path affected by the action is extracted.

【0012】図2は図1中の変更前ソースプログラムの
一例を、図3は図1中の変更後ソースプログラムの一例
を、それぞれ示す図である。両図中、21はソ−スプロ
グラム上での実行開始点であり、22は実行終了点であ
る。また、図2中の23aは変更前の命令文を、図3中
の23bは変更後の命令文を、それぞれ示しており、本
実施例では、図2中でシーケンス番号「110」の命令
文“H;”が、シーケンス番号「106」「108」
「110」の3ステップの命令文“IF X”,“TH
EN H;”,“ELSE Y;”に変更されている。
FIG. 2 is a diagram showing an example of the pre-change source program in FIG. 1, and FIG. 3 is a diagram showing an example of the post-change source program in FIG. In both figures, 21 is an execution start point on the source program, and 22 is an execution end point. Reference numeral 23a in FIG. 2 shows the command statement before the change, and reference numeral 23b in FIG. 3 shows the command statement after the change. In this embodiment, the command statement with the sequence number “110” in FIG. "H;" is sequence number "106""108"
"110" three-step statement "IF X", "TH"
It has been changed to EN H; "and" ELSE Y; ".

【0013】図4は、図1中のパラメータの一例を示す
図である。本実施例においては、ソ−スプログラム上で
の実行開始点21のシーケンス番号「020」および実
行終了点22のシーケンス番号「130」をパラメータ
13として入力する。
FIG. 4 is a diagram showing an example of the parameters in FIG. In this embodiment, the sequence number “020” of the execution start point 21 and the sequence number “130” of the execution end point 22 on the source program are input as the parameter 13.

【0014】図5は、図2に対応するネットワークテー
ブルの一例を示す図であり、64は命令文シ−ケンス番
号格納領域,65は命令文格納領域,61は制御情報格
納領域,62は選択可能数格納領域,63はポインタ領
域である。同図中、選択可能数格納領域62に設定され
ている選択可能数に相当するエントリ数のポインタ領域
63が確保され、各々のポインタ領域63にはネクスト
ポインタ(当該命令文に続いて実行されるべき命令文の
シーケンス番号)が格納される。なお、以後の記述にお
いて、選択文および繰り返し文を合わせて分岐文と記載
する。
FIG. 5 is a diagram showing an example of a network table corresponding to FIG. 2, in which 64 is a command statement sequence number storage area, 65 is a command statement storage area, 61 is a control information storage area, and 62 is a selection. A possible number storage area, 63 is a pointer area. In the figure, a pointer area 63 having the number of entries corresponding to the selectable number set in the selectable number storage area 62 is secured, and each pointer area 63 has a next pointer (executed subsequent to the command statement). The sequence number of the statement to be written is stored. In the following description, the selected sentence and the repeated sentence are collectively referred to as a branch sentence.

【0015】図6〜8は、図1中の命令実行ネットワー
ク作成処理部の処理フローの一例を示す図であり、これ
ら三図を用いて説明を行う。最初に、旧ネットワークテ
ーブル18a(新ネットワークテーブル18b)の外枠
を生成した後、入力データとして与えられた変更前ソ−
スプログラム11(変更後ソ−スプログラム12)を構
成するすべての命令文について、シ−ケンス番号および
命令文の内容をシ−ケンス番号格納領域64および命令
文格納領域65に設定する。このとき、該当する命令文
が選択文であった場合には、各々の選択節の最後にDM
YEND文の付加を行う(ステップ501)。次に、各
々の命令文について、当該命令文が選択文(IF文やCASE
文など)の場合には選択節数を、繰り返し文(DO WHILE
文など)の場合には“2”(ル−プしない場合と、ル−
プする場合の2通りの選択を示す)を、連続文の場合に
は“1”を、実行終了点の場合には“0”を、それぞれ
選択可能数として選択可能数格納領域62に設定すると
ともに、当該命令文が実行開始点の場合にフラグ“S”
を、実行終了点の場合にフラグ“E”を、繰り返し文の
場合にフラグ“L”を、それぞれ制御情報格納領域61
に設定する(ステップ502)。
FIGS. 6 to 8 are diagrams showing an example of the processing flow of the instruction execution network creation processing section in FIG. 1, which will be described with reference to these three figures. First, after the outer frame of the old network table 18a (new network table 18b) is generated, the pre-change source code provided as the input data is generated.
The sequence numbers and the contents of the instruction statements are set in the sequence number storage area 64 and the instruction statement storage area 65 for all the instruction statements constituting the source program 11 (the changed source program 12). At this time, when the corresponding imperative sentence is a selection sentence, DM is added at the end of each selection clause.
A YEND sentence is added (step 501). Next, for each imperative statement, the imperative statement is a selected statement (IF statement or CASE
In the case of a statement), the number of selected clauses
"2" (for sentences, etc.)
(Indicates two kinds of selections in case of continuous execution), “1” in the case of continuous sentence, and “0” in the case of execution end point, respectively, is set in the selectable number storage area 62 as the selectable number. At the same time, if the statement is the execution start point, the flag "S"
, The flag “E” for the execution end point, the flag “L” for the repeated statement, and the control information storage area 61.
(Step 502).

【0016】ステッブ503以降の処理は、入力データ
として与えられた変更前ソ−スプログラム11(変更後
ソ−スプログラム12)を構成する命令文を先頭から順
次解析することにより、前述したネクストポインタをポ
インタ領域63に設定する処理である。
In the processing after step 503, the above-mentioned next pointer is obtained by sequentially analyzing from the beginning the command statements constituting the source program 11 before change (source program 12 after change) given as input data. Is set in the pointer area 63.

【0017】最初に、解析ポインタとして旧ネットワ−
クテ−ブル18a(新ネットワークテーブル18b)の
先頭の命令文のシ−ケンス番号を設定する(ステップ5
03)。そして、解析ポインタが旧ネットワ−クテ−ブ
ル18a(新ネットワークテーブル18b)の最後の命
令文の次を指していて(ステップ504=YES)、ネ
ットワ−クテ−ブル18におけるすべてのポインタ領域
が設定済である(ステップ505=YES)場合には、
命令実行ネットワ−ク作成処理を終了する(ステップ5
04→ステップ505→END)。また、解析ポインタ
が旧ネットワ−クテ−ブル18a(新ネットワークテー
ブル18b)の最後の命令文の次を指していて(ステッ
プ504=YES)、ネットワ−クテ−ブル18におけ
るすべてのポインタ領域が設定済でない(ステップ50
5=NO)場合には、すべてのポインタ領域が設定され
るまで解析を続行する(ステップ504→ステップ50
5→ステップ503→……)。
First, the old network is used as an analysis pointer.
Set the sequence number of the first command statement in the table 18a (new network table 18b) (step 5).
03). Then, the analysis pointer points to the end of the last statement of the old network table 18a (new network table 18b) (step 504 = YES), and all pointer areas in the network table 18 have been set. If (step 505 = YES),
The instruction execution network creation process ends (step 5).
04 → step 505 → END). Further, the analysis pointer points to the next of the last statement of the old network table 18a (new network table 18b) (step 504 = YES), and all pointer areas in the network table 18 have been set. Not (step 50)
If 5 = NO, the analysis is continued until all pointer areas are set (step 504 → step 50).
5 → step 503 → ……).

【0018】一方、解析ポインタがネットワ−クテ−ブ
ル18内を指している場合(ステップ504=NO)、
当該命令文が実行終了点である(ステップ506=YE
S)か、あるいは、すでに当該命令文に対応するポイン
タ領域が設定済である(ステップ507=YES)場合
には、当該命令文の解析をスキップして直後の命令文の
解析を行う(ステップ506→ステップ507→ステッ
プ508→ステップ504→……)。また、当該命令文
に対応するポインタ領域が設定済でない(ステップ50
7=NO)場合には、ステップ509以降のポインタ領
域設定処理を行う。
On the other hand, when the analysis pointer points within the network table 18 (step 504 = NO),
The statement is the execution end point (step 506 = YE).
S) or if the pointer area corresponding to the imperative sentence has already been set (step 507 = YES), the imperative sentence analysis is skipped and the immediately following imperative sentence is analyzed (step 506). → step 507 → step 508 → step 504 → ...). Further, the pointer area corresponding to the command statement has not been set (step 50).
In the case of 7 = NO), the pointer area setting process after step 509 is performed.

【0019】当該命令文が連続文であった場合(ステッ
プ509=YES)、当該命令文が無条件分岐文であっ
たとき(ステップ510=YES)には、ネクストポイ
ンタとして分岐先のシ−ケンス番号を当該ポインタ領域
に設定してステップ508に分岐し(ステップ509→
ステップ510→ステップ512→ステップ508→…
…)、当該命令文が無条件分岐文でなかったとき(ステ
ップ510=NO)には、当該命令文の直後の命令文の
シ−ケンス番号を設定してステップ508に分岐する
(ステップ509→ステップ510→ステップ511→
ステップ508→……)。すなわち、図5中のネットワ
−クテ−ブルにおけるシ−ケンス番号「120」に対応
する命令文に解析ポインタが設定されていたときには、
ネクストポインタとして「130」が設定され(ステッ
プ511)た後に、解析ポインタとして「130」を設
定し、解析を続行する(ステップ508)。
If the imperative sentence is a continuous sentence (step 509 = YES) and the imperative sentence is an unconditional branch sentence (step 510 = YES), the branch destination sequence is used as the next pointer. Set a number in the pointer area and branch to step 508 (step 509 →
Step 510 → Step 512 → Step 508 → ...
...), if the imperative statement is not an unconditional branch statement (step 510 = NO), the sequence number of the imperative statement immediately after the imperative statement is set and the procedure branches to step 508 (step 509 →). Step 510 → Step 511 →
Step 508 → ...). That is, when the analysis pointer is set in the instruction statement corresponding to the sequence number "120" in the network table in FIG.
After "130" is set as the next pointer (step 511), "130" is set as the analysis pointer and the analysis is continued (step 508).

【0020】当該命令文が連続文でなかった場合(ステ
ップ509=NO)、当該命令文が繰返し文であったと
き(ステップ520=YES)には、当該繰返し文の直
後の命令文,当該繰返し文に対応する終了文,その終了
文の直後の命令文のそれぞれのシ−ケンス番号を求め
(ステップ521)、当該繰返し文と当該繰返し文に対
する終了文のネクストポインタをそれぞれのポインタ領
域63に設定して(ステップ522)、解析ポインタに
は当該繰返し文に対する終了文の直後の命令文のシ−ケ
ンス番号を設定して、解析を続行する(ステップ52
3)。すなわち、図5中のネットワ−クテ−ブルにおけ
るシ−ケンス番号「080」に対応する命令文(DO WHI
LE文)に解析ポインタが設定されていたときには、DO W
HILE文の直後の命令文のシ−ケンス番号「090」,DO
WHILE文に対応する END文のシ−ケンス番号「10
0」,当該 END文の直後の命令文のシ−ケンス番号「1
10」を求め(ステップ521)、DO WHILE文に対する
ネクストポインタとして「090」と「110」を、 E
ND文に対するネクストポインタとして「080」をそれ
ぞれのポインタ領域63に設定して(ステップ52
2)、解析ポインタには当該繰返し文に対する終了文の
直後の命令文のシ−ケンス番号「110」を設定して、
解析を続行する(ステップ523)。
If the imperative statement is not a continuous statement (step 509 = NO), and if the imperative statement is a repeat statement (step 520 = YES), the imperative statement immediately after the repeat statement and the repeat The sequence numbers of the end statement corresponding to the statement and the imperative statement immediately after the end statement are obtained (step 521), and the repetition statement and the next pointer of the end statement for the repetition statement are set in the respective pointer areas 63. Then, (step 522), the sequence number of the imperative sentence immediately after the end sentence for the repetitive sentence is set in the analysis pointer, and the analysis is continued (step 52).
3). That is, the command statement (DO WHI) corresponding to the sequence number "080" in the network table in FIG.
When the analysis pointer is set in (LE sentence), DO W
Sequence number “090” of the imperative statement immediately after the HILE statement, DO
Sequence number “10” of END statement corresponding to WHILE statement
0 ”, the sequence number of the statement immediately after the END statement“ 1 ”
10 "is obtained (step 521), and" 090 "and" 110 "are set as the next pointers to the DO WHILE statement, and E
As a next pointer for the ND sentence, "080" is set in each pointer area 63 (step 52).
2) The sequence number "110" of the imperative sentence immediately after the end sentence for the repetitive sentence is set in the analysis pointer,
The analysis is continued (step 523).

【0021】当該命令文が連続文または繰返し文のいず
れでもなかった場合(ステップ509=NO,ステップ
520=NO)、当該命令文が選択文であったときには
(ステップ530)、最初に選択可能数格納領域62を
参照して当該選択文の選択節数nを求めて作業用変数k
←n−1とするとともに、最初の選択節の先頭に記述さ
れている命令文のシ−ケンス番号S1および当該選択文
グル−プ(当該選択文とその分岐先の複数の選択節から
構成される選択処理の全体)の次の命令文のシ−ケンス
番号S0を得る(ステップ531)。そして、命令文S1
の直後の命令文のシ−ケンス番号S2,当該選択節の最
後の命令文のシ−ケンス番号S3,命令文S3の直後の
命令文のシ−ケンス番号S4を得て(ステップ532)
から、当該選択文のポインタ領域63における「n−
k」番目のエントリにシ−ケンス番号S1を、命令文S
1のポインタ領域63にシ−ケンス番号S2を、命令文
S3(DMYEND文)のポインタ領域63にシ−ケン
ス番号S0を、それぞれ設定する(ステップ533)。
以上の処理を行った後に、処理の対象とすべき選択節が
残っていた場合には(ステップ534=NO)、作業用
変数k←k−1,S1←S4としてからステップ532
に分岐する(ステップ535)ことにより、以降の選択
節についても同様の処理を行う。また、すべての選択節
に対する処理を終了した場合には(ステップ534=Y
ES)、次の解析ポインタとしてS0を設定した後、処
理を続行する(ステップ536)。
When the imperative sentence is neither a continuous sentence nor a repetitive sentence (step 509 = NO, step 520 = NO), when the imperative sentence is a selected sentence (step 530), the selectable number is first. By referring to the storage area 62, the number n of selected clauses of the selected sentence is calculated, and the work variable k
← n−1, and the sequence number S1 of the instruction statement described at the beginning of the first selection clause and the selection statement group (comprising the selection statement and a plurality of selection clauses at the branch destination). (The entire selection process), the sequence number S0 of the next statement is obtained (step 531). And the statement S1
, The sequence number S2 of the statement immediately after the statement S2, the sequence number S3 of the last statement of the selected section, and the sequence number S4 of the statement immediately after the statement S3 are obtained (step 532).
From "n- in the pointer area 63 of the selected sentence.
The sequence number S1 and the statement S
The sequence number S2 is set in the pointer area 63 of 1 and the sequence number S0 is set in the pointer area 63 of the statement S3 (DMYEND statement) (step 533).
After the above processing, if there are remaining selected clauses to be processed (step 534 = NO), the work variables k ← k−1, S1 ← S4 are set, and then step 532 is performed.
By branching to step 535 (step 535), the same processing is performed for the subsequent selected clauses. When the processing for all the selected clauses is completed (step 534 = Y
ES), after setting S0 as the next analysis pointer, the process is continued (step 536).

【0022】すなわち、図5中のネットワ−クテ−ブル
におけるシ−ケンス番号「020」に対応する命令文
(IF文)に解析ポインタが設定されていたときには、最
初に、n←2,k←1,S1←“030”,S0←“0
50”とし(ステップ531)、S2←“031”,S3
←“031”,S4←“040”として(ステップ53
2)から、「020」のIF文の一番目のネクストポイン
タとして「030」を、「030」のTHEN文のネクスト
ポインタとして「031」を、「031」のDMYEND文の
ネクストポインタとして「050」を、それぞれ設定し
た(ステップ533)後、k≠0であるため、S1←
“040”,S4←“040”,k←0として、ステッ
プ532に分岐する(ステップ534=NO→ステップ
535)。次に、S2←“041”,S3←“04
1”,S4←“050”として(ステップ532)か
ら、「020」のIF文の2番目のネクストポインタとし
て「040」を、「040」のELSE文のネクストポイン
タとして「041」を、「041」のDMYEND文のネクス
トポインタとして「050」を、それぞれ設定した(ス
テップ533)後、k=0であるため、次の解析ポイン
タとして「050」を設定し、処理を続行する(ステッ
プ534=YES→ステップ536)。
That is, when the analysis pointer is set to the instruction statement (IF statement) corresponding to the sequence number "020" in the network table in FIG. 5, first, n ← 2 and k ← 1, S1 ← “030”, S0 ← “0
50 "(step 531), S2 ←" 031 ", S3
← “031”, S4 ← “040” (step 53
From 2), "030" is set as the first next pointer of the IF statement of "020", "031" is set as the next pointer of the THEN statement of "030", and "050" is set as the next pointer of the DMYEND statement of "031". After setting (step 533), since k ≠ 0, S1 ←
As “040”, S4 ← “040”, k ← 0, the process branches to step 532 (step 534 = NO → step 535). Next, S2 ← “041”, S3 ← “04
Since 1 ”and S4 ←“ 050 ”(step 532),“ 040 ”is set as the second next pointer of the IF statement of“ 020 ”,“ 041 ”is set as the next pointer of the ELSE statement of“ 040 ”, and“ 041 ”is set. After setting “050” as the next pointer of the DMYEND sentence of “” (step 533) and k = 0, set “050” as the next analysis pointer and continue the process (step 534 = YES). → Step 536).

【0023】図9は、図2に対応する組合せテーブルの
一例を示す図であり、81は実行パス名格納領域,82
は分岐文シーケンス番号格納領域(図5中の選択可能数
格納領域62に2以上の値が設定されている命令文=分
岐文のシーケンス番号が格納される),83は選択番号
格納領域(各々の実行パスにおいて、上記分岐文シーケ
ンス番号格納領域82に格納されているシ−ケンス番号
に対応する命令文のいずれの選択節を選択実行するかを
示す)である。同図中、選択番号格納領域83に格納さ
れる値は、対応する分岐文シーケンス番号格納領域82
に格納されている分岐文シーケンス番号によって示され
る命令文の分岐数より1少なく、かつ、0以上の整数値
である。例えば、ある分岐文の分岐数=3である場合に
は、選択番号格納領域83に格納される値は、「0」,
「1」,「2」の3通りの値のいずれかとなり、当該分岐文
シーケンス番号格納領域82の各行に示されるそれぞれ
の実行パスには「0」,「1」,「2」のいずれかの選択値が
設定される。すなわち、選択番号格納領域83に格納さ
れる値Sは、対応する分岐文における第(S+1)の選択
節を実行することを示す。
FIG. 9 is a diagram showing an example of the combination table corresponding to FIG. 2. 81 is an execution path name storage area, and 82 is an execution path name storage area.
Is a branch statement sequence number storage area (instruction statement in which a value of 2 or more is set in the selectable number storage area 62 in FIG. 5 = branch statement sequence number is stored), and 83 is a selection number storage area (each In the execution path of (1), it indicates which selection clause of the instruction statement corresponding to the sequence number stored in the branch statement sequence number storage area 82 is selected and executed). In the figure, the value stored in the selection number storage area 83 is the corresponding branch statement sequence number storage area 82.
It is an integer value that is 1 less than the number of branches of the instruction statement indicated by the branch statement sequence number stored in 1. and 0 or more. For example, when the number of branches of a certain branch statement = 3, the value stored in the selection number storage area 83 is “0”,
It is one of three values of "1" and "2", and each execution path shown in each line of the branch statement sequence number storage area 82 is one of "0", "1", and "2". The selected value of is set. That is, the value S stored in the selection number storage area 83 indicates that the (S + 1) th selected clause in the corresponding branch statement is executed.

【0024】なお、本実施例のソースプログラムでは最
大の分岐数は2であるため、図9に示す組合せテーブル
では、選択番号格納領域83に格納される選択値Sが
「0」または「1」のいずれかの値となり、選択値S=0は
1番目の選択節を、選択値S=1は2番目の選択節を実
行することを示す。また、選択番号格納領域83に格納
される値Sの設定順序は、最初に第1の分岐文(図9で
はシーケンス番号「020」の分岐文)に関連する実行
パスに対応するシーケンス番号格納領域82に「0」また
は「1」を格納し、次に第2の分岐文(図9ではシーケン
ス番号「050」の分岐文)に関連する実行パスに対応
するシーケンス番号格納領域82に「0」または「1」を格
納し…という順序とする。
Since the maximum number of branches in the source program of this embodiment is 2, the selection value S stored in the selection number storage area 83 is "0" or "1" in the combination table shown in FIG. , The selection value S = 0 indicates that the first selection clause is executed, and the selection value S = 1 indicates that the second selection clause is executed. In addition, the setting order of the values S stored in the selection number storage area 83 is as follows. First, the sequence number storage area corresponding to the execution path associated with the first branch statement (the branch statement with the sequence number “020” in FIG. 9). "0" or "1" is stored in 82, and then "0" is stored in the sequence number storage area 82 corresponding to the execution path associated with the second branch statement (the branch statement with the sequence number "050" in FIG. 9). Alternatively, "1" is stored and the order is "...

【0025】図10および図11は、図1中の実行可能
パス数計算処理部の処理フローの一例を示す図である。
両図中において、最初に旧ネットワ−クテ−ブル18a
(新ネットワ−クテ−ブル18b)における選択可能数
格納領域62に格納されている値をすべて乗算すること
により、全実行可能パス数を求める。本実施例で示した
変更前ソースプログラムの場合には、 全実行可能パス数=2×1×…×1×2×1×…×1×
2×1×…×1=8 である(ステップ710)。さらに、選択可能数格納領
域62に格納されている値が2以上である命令文=分岐
文のシ−ケンス番号およびその個数を求める。本実施例
においては、分岐文の個数は3であり、そのシーケンス
番号は各々「020」,「050」,「080」である
(ステップ711)。そして、実行パス名格納領域81
および分岐文シーケンス番号格納領域82に、それぞれ
実行パス名とステップ711で求められたシーケンス番
号とを格納して旧組合わせテーブル19a(新組合わせ
テーブル19b)を生成する(ステップ712,ステッ
プ713)。次に、選択値設定ポインタを旧組合わせテ
ーブル19a(新組合わせテーブル19b)における分
岐文シーケンス番号格納領域82の最初のエントリに位
置付けて(ステップ714)、選択値一巡設定対象数
P,現在の処理対象の分岐文の分岐数Pi,現在の処理
対象の分岐文シーケンス番号格納領域82のエントリを
示す処理対象エントリCの定義および設定を行って、P
←〈全実行可能パス数〉,Pi←1、C←1とする(ス
テップ715)。
10 and 11 are diagrams showing an example of the processing flow of the executable path number calculation processing unit in FIG.
In both figures, the old network table 18a is first shown.
The total number of executable paths is obtained by multiplying all the values stored in the selectable number storage area 62 in the (new network table 18b). In the case of the source program before change shown in this embodiment, the total number of executable paths = 2 × 1 × ... × 1 × 2 × 1 × ... × 1 ×
2 × 1 × ... × 1 = 8 (step 710). Further, the sequence number and the number of instruction statements = branch statements whose value stored in the selectable number storage area 62 is 2 or more are obtained. In the present embodiment, the number of branch statements is 3, and the sequence numbers thereof are "020", "050", and "080", respectively (step 711). The execution path name storage area 81
The execution path name and the sequence number obtained in step 711 are respectively stored in the branch statement sequence number storage area 82 to generate the old combination table 19a (new combination table 19b) (steps 712 and 713). . Next, the selection value setting pointer is positioned at the first entry of the branch statement sequence number storage area 82 in the old combination table 19a (new combination table 19b) (step 714), and the selection value round setting target number P, current The number of branches Pi of the branch statement to be processed and the processing target entry C indicating the entry of the branch statement sequence number storage area 82 of the current processing target are defined and set, and P
← <total number of executable paths>, Pi ← 1, C ← 1 (step 715).

【0026】ステップ716以降の処理は、選択番号格
納領域83に選択値の格納を行う処理であり、最初に旧
ネットワ−クテ−ブル18a(新ネットワ−クテ−ブル
18b)における選択可能数格納領域62を参照して、
分岐文シーケンス番号格納領域82に格納されたCで示
される当該分岐文の選択可能数を求め、その値を現在の
処理対象の分岐文の分岐数Piに設定する(ステップ7
16)。そして、選択値繰返し数R(同一の選択値を繰
返して設定するために用いる)およびR回復用のRsを
定義して、R←(P/Pi),Rs←(P/Pi)とし
(ステップ717)、選択値が設定された旧組合せテ−
ブル19a(新組合せテ−ブル19b)の行数を示す行
カウンタE←0(ステップ718),選択値S←0(ス
テップ719)とする。
The process from step 716 is a process of storing the selected value in the selection number storage area 83. First, the selectable number storage area in the old network table 18a (new network table 18b) is stored. Referring to 62,
The selectable number of the branch statement indicated by C stored in the branch statement sequence number storage area 82 is calculated, and the value is set to the branch number Pi of the branch statement of the current processing target (step 7).
16). Then, the selection value repetition number R (used for repeatedly setting the same selection value) and Rs for R recovery are defined as R ← (P / Pi) and Rs ← (P / Pi) (step 717), the old combination table in which the selected value is set.
A row counter E ← 0 (step 718) indicating the number of rows of the table 19a (new combination table 19b) and a selected value S ← 0 (step 719) are set.

【0027】次に、選択値繰返し数R=0か否かを判定
し、R≠0の場合はステップ721へ分岐し、R=0の
場合はステップ730へ分岐する(ステップ720)。
すなわち、R≠0であった場合には(ステップ720=
NO)、選択値設定ポインタで示される選択番号格納領
域83に選択値Sの値を格納して(ステップ721)か
ら、選択値設定ポインタを次の行にモディファイして選
択値繰返し数R←R−1,行カウンタE←E+1とし
(ステップ722)た後に、ステップ720に戻る。ま
た、R=0であった場合には(ステップ720=YE
S)、Cで示される分岐文シーケンス番号格納領域82
に関する選択値の設定が終了したか否かを、行カウンタ
Eの値が全実行可能パス数に達したか否かによって判定
し、E<(全実行可能パス数)であった場合にはステッ
プ731へ分岐し、E=(全実行可能パス数)であった
場合にはステップ734へ分岐する(ステップ73
0)。
Next, it is judged whether or not the selection value repetition number R = 0. If R ≠ 0, the process branches to step 721, and if R = 0, the process branches to step 730 (step 720).
That is, when R ≠ 0 (step 720 =
No), the value of the selection value S is stored in the selection number storage area 83 indicated by the selection value setting pointer (step 721), and then the selection value setting pointer is modified to the next line to repeat the selection value R ← R. After setting -1, the row counter E ← E + 1 (step 722), the process returns to step 720. If R = 0 (step 720 = YE
S), C branch statement sequence number storage area 82
It is determined whether the setting of the selection value for is completed by whether the value of the row counter E has reached the total number of executable paths, and if E <(the total number of executable paths), the step 731, and if E = (total number of executable paths), branch to step 734 (step 73).
0).

【0028】ステップ730でE<(全実行可能パス
数)であった場合(ステップ730=YES)、選択値
S←S+1とする(ステップ731)とともに、選択値
繰返し数RをRsから回復してR←Rsとし(ステップ
732)た後、選択値Sと現在の処理対象である分岐文
の分岐数Piとの関係が「S<Pi」となっているか否
かを判定する(ステップ733)。これは、現在の処理
対象である分岐文の選択値未設定パスに対して、これま
で設定してきた選択値を初期値「0」に戻すか否かを決
定するための判定であり、「S<Pi」であった場合
(ステップ733=YES)には、S←S+1とした直
後の選択値Sを選択値未設定パスに設定するためにステ
ップ720へ戻る。また、「S≧Pi」であった場合
(ステップ733=NO)には、初期値「0」を選択値
未設定パスに選択値Sとして設定するためにステップ7
19へ戻る。
When E <(total number of executable paths) in step 730 (step 730 = YES), the selection value S ← S + 1 is set (step 731) and the selection value repetition number R is recovered from Rs. After setting R ← Rs (step 732), it is determined whether or not the relationship between the selected value S and the number of branches Pi of the currently processed branch statement is “S <Pi” (step 733). This is a determination for deciding whether or not to return the selection value that has been set so far to the initial value “0” for the selection value unset path of the branch statement that is the current processing target. If <Pi ”(step 733 = YES), the process returns to step 720 to set the selection value S immediately after S ← S + 1 to the selection value unset path. If “S ≧ Pi” (step 733 = NO), step 7 is performed to set the initial value “0” as the selection value S in the selection value unset path.
Return to 19.

【0029】ステップ730でE=(全実行可能パス
数)であった場合(ステップ730=NO)、ステップ
734でRs=1であるか否かを判定することにより、
旧組合せテ−ブル19a(新組合せテ−ブル19b)の
分岐文シーケンス番号格納領域82における全エントリ
の全パスについて選択値Sの設定が終了したか否かを判
定する。すなわち、Rs=1であったとき(ステップ7
34=YES)には、全パスについて選択値Sの設定が
終了したものとして、実行パス数計算処理を終了させ
る。また、Rs≠1であったとき(ステップ734=N
O)には、分岐文シーケンス番号格納領域82における
エントリ中にまだ選択値Sが設定されていないエントリ
があるものとして、分岐文シーケンス番号格納領域82
における次のエントリに対して選択値設定ポインタを設
定するため、C←C+1(ステップ735),P←Rs
(ステップ736)とした後、ステップ716へ戻る。
If E = (total number of executable paths) in step 730 (step 730 = NO), it is determined in step 734 whether Rs = 1.
It is determined whether or not the selection value S has been set for all paths of all entries in the branch statement sequence number storage area 82 of the old combination table 19a (new combination table 19b). That is, when Rs = 1 (step 7)
34 = YES), the execution path number calculation process is terminated assuming that the selection value S has been set for all the paths. Further, when Rs ≠ 1 (step 734 = N
In O), it is assumed that there is an entry for which the selection value S is not set among the entries in the branch statement sequence number storage area 82 and the branch statement sequence number storage area 82.
Since the selection value setting pointer is set for the next entry in C, C ← C + 1 (step 735), P ← Rs
After (Step 736), the process returns to Step 716.

【0030】以上の実行パス数計算処理により、図9に
示す旧組合せテーブル19aにおける選択値Sは、次の
順序で選択番号格納領域83に設定される。 ・分岐文シーケンス番号格納領域82の第1エントリ
(「020」)の場合 PANDR001〜004には連続して「0」が設定
される。 PANDR005〜008には連続して「1」が設定
される。 ・分岐文シーケンス番号格納領域82の第2エントリ
(「050」)の場合 PANDR001〜002には連続して「0」が設定
される。 PANDR003〜004には連続して「1」が設定
される。 PANDR005〜006には連続して「0」が設定
される。 PANDR007〜008には連続して「1」が設定
される。 ・分岐文シーケンス番号格納領域82の第3エントリ
(「050」)の場合 PANDR001には「0」が設定される。 PANDR002には「1」が設定される。 PANDR003には「0」が設定される。 PANDR004には「1」が設定される。 PANDR005には「0」が設定される。 PANDR006には「1」が設定される。 PANDR007には「0」が設定される。 PANDR008には「1」が設定される。 すなわち、実行パスPANDR001において、020
の選択文では1番目の選択節(THEN文)が、050の選
択文でも1番目の選択節(THEN文)が、080の繰返し
文でも1番目の選択節(ル−プあり)が、それぞれ実行
される。
By the above-described execution pass number calculation processing, the selection value S in the old combination table 19a shown in FIG. 9 is set in the selection number storage area 83 in the following order. In the case of the first entry (“020”) in the branch statement sequence number storage area 82, “0” is continuously set in PANDR001 to 004. “1” is continuously set in PANDR005 to 008. In the case of the second entry (“050”) in the branch statement sequence number storage area 82, “0” is continuously set in PANDR001 to 002. “1” is continuously set in PANDR003 to 004. “0” is continuously set in PANDR005 to 006. "1" is continuously set in PANDR007 to 008. In the case of the third entry (“050”) in the branch statement sequence number storage area 82 “0” is set in PANDR001. “1” is set in PANDR002. “0” is set in PANDR003. “1” is set in PANDR004. “0” is set in PANDR005. “1” is set in PANDR006. “0” is set in PANDR007. “1” is set in PANDR008. That is, in the execution path PANDR001, 020
, The first selection clause (THEN statement), the 050 selection statement, the first selection clause (THEN statement), and the 080 repetition statement, the first selection clause (with loop), To be executed.

【0031】図12は、図2に対応する実行パステーブ
ルの一例を示す図である。同図中、101は実行パス名
格納領域(図9の実行パス名格納領域81に対応す
る),102は当該実行パスにおいて実行される命令文
に対応するシーケンス番号が格納される命令文シーケン
ス番号格納領域,103は当該実行パスにおいて実行さ
れる実行命令文が格納される命令文格納領域である。命
令文シーケンス番号格納領域102および命令文格納領
域103は対をなしており、実行命令文の実行順序のと
おりの並びで生成されている。また、実行パス名格納領
域101中の実行パス名に対応する各々の実行パスは、
実行される命令または実行される命令の実行順序が互い
に異なっている。
FIG. 12 is a diagram showing an example of the execution path table corresponding to FIG. In the figure, 101 is an execution path name storage area (corresponding to the execution path name storage area 81 in FIG. 9), and 102 is an instruction statement sequence number in which a sequence number corresponding to an instruction statement executed in the execution path is stored. A storage area 103 is an instruction statement storage area in which execution instruction statements executed in the execution path are stored. The command statement sequence number storage area 102 and the command statement storage area 103 form a pair, and are generated in a sequence according to the execution order of the execution command statements. Further, each execution path corresponding to the execution path name in the execution path name storage area 101 is
The instructions to be executed or the execution order of the executed instructions are different from each other.

【0032】図13および図14は、図1中の実行パス
テーブル生成処理部の処理フローの一例を示す図であ
る。その処理の概要は、旧ネットワ−クテ−ブル18a
(新ネットワ−クテ−ブル18b)および旧組合わせテ
−ブル19a(新組合わせテ−ブル19b)に基づき、
旧組合わせテ−ブル19a(新組合わせテ−ブル19
b)に設定されているすべての実行パスについて、当該
実行パスで実行される命令をその実行順序のとおりに並
べた後、各々の実行パスについて実行される命令がその
実行順序も含めて同一である他の実行パスの有無を確認
し、同一の実行パスが2以上存在していたときにはいず
れかひとつの実行パスのみを残して他の同一の実行パス
はすべて削除する、というものである。
13 and 14 are diagrams showing an example of the processing flow of the execution path table generation processing section in FIG. The outline of the process is the old network table 18a.
Based on (new network table 18b) and old combination table 19a (new combination table 19b),
Old combination table 19a (New combination table 19a
For all execution paths set in b), after the instructions executed in the execution path are arranged in the execution order, the instructions executed in each execution path are the same including the execution order. The presence or absence of a certain other execution path is checked, and when there are two or more identical execution paths, only one execution path is left and all other identical execution paths are deleted.

【0033】両図において、最初にステップ910〜9
13で必要な初期設定を行った後、旧組合わせテ−ブル
19a(新組合わせテ−ブル19b)中の実行パス名格
納領域81からひとつの実行パス名を取り出して、その
実行パス名Pnを生成しようとする旧実行パステ−ブル
20a(新実行パステ−ブル20b)における実行パス
名格納領域101に格納して(ステップ914)、旧ネ
ットワ−クテ−ブル18a(新ネットワ−クテ−ブル1
8b)の実行開始点をポイントする(ステップ91
5)。そして、旧ネットワ−クテ−ブル18a(新ネッ
トワ−クテ−ブル18b)中でポイントされているエン
トリの命令文シーケンス番号格納領域64および命令文
格納領域65の内容(例えば、SnおよびCn)を、そ
れぞれ旧実行パステ−ブル20a(新実行パステ−ブル
20b)における命令文シーケンス番号格納領域102
および命令文格納領域103に格納するとともに、続い
て実行される命令文(例えば、Cn+1)についての設
定を行うため、命令文シーケンス番号格納領域102お
よび命令文格納領域103を1エントリ分モディファイ
する(ステップ916)。
In both figures, first, steps 910-9 are performed.
After performing necessary initialization in 13, the execution path name Pn is obtained by extracting one execution path name from the execution path name storage area 81 in the old combination table 19a (new combination table 19b). Is stored in the execution path name storage area 101 of the old execution path table 20a (new execution path table 20b) (step 914), and the old network table 18a (new network table 1) is generated.
8b) execution start point (step 91)
5). Then, the contents (for example, Sn and Cn) of the command statement sequence number storage area 64 and the command statement storage area 65 of the entry pointed to in the old network table 18a (new network table 18b) are changed to An instruction statement sequence number storage area 102 in the old execution path table 20a (new execution path table 20b).
And the instruction statement storage area 103, and in order to set the instruction statement (for example, Cn + 1) to be executed subsequently, the instruction statement sequence number storage area 102 and the instruction statement storage area 103 are modified by one entry ( Step 916).

【0034】次に、ステップ916で旧実行パステ−ブ
ル20a(新実行パステ−ブル20b)に格納した命令
文Cnが実行終了点であるか否かを、命令文Cnの制御
情報格納領域61にフラグEが格納されているか否かに
よって確認し、実行終了点である場合にはステップ93
0へ分岐し、そうでない場合はステップ918へ分岐す
る(ステップ917)。命令文Cnの制御情報格納領域
61にフラグEが格納されていなかった場合(ステップ
917=NO)、ステップ918では、命令文Cnに対
応する選択可能数格納領域62を参照して、設定されて
いる選択節数が2以上であるか否かを確認し、2以上で
ないと判定された場合(ステップ918=NO)には、
命令文Cnのネクストポインタを解析ポインタとして
(ステップ919)、ステップ916へ戻る。また、設
定されている選択節数が2以上であると判定された場合
(ステップ918=YES)には、命令文Cnの次に実
行される命令文が旧ネットワ−クテ−ブル18a(新ネ
ットワ−クテ−ブル18b)における次のエントリの命
令文とは限らないので、旧組合わせテ−ブル19a(新
組合わせテ−ブル19b)における現在処理中の実行パ
スに対応するエントリとシ−ケンス番号Sn欄との交差
位置の選択番号格納領域83に格納されている選択値を
求め(ステップ920)、この選択値に基づいて命令文
Cnの(S+1)番目のネクストポインタを解析ポイン
タとして(ステップ921)、ステップ916へ戻る。
Next, in the control information storage area 61 of the command statement Cn, it is determined whether the command statement Cn stored in the old execution path table 20a (new execution path table 20b) in step 916 is the execution end point. It is confirmed whether the flag E is stored or not, and if it is the execution end point, step 93
If not, the process branches to step 918 (step 917). When the flag E is not stored in the control information storage area 61 of the command statement Cn (step 917 = NO), it is set in step 918 by referring to the selectable number storage area 62 corresponding to the command statement Cn. It is confirmed whether or not the number of selected clauses is 2 or more, and when it is determined that the number is not 2 or more (step 918 = NO),
The next pointer of the statement Cn is used as the analysis pointer (step 919), and the process returns to step 916. If it is determined that the set number of selected clauses is 2 or more (step 918 = YES), the statement to be executed next to the statement Cn is the old network table 18a (new network). Since it is not always the statement of the next entry in the table 18b), the entry and sequence corresponding to the execution path currently being processed in the old combination table 19a (new combination table 19b). The selection value stored in the selection number storage area 83 at the intersection with the number Sn column is obtained (step 920), and the (S + 1) th next pointer of the statement Cn is used as the analysis pointer based on the selection value (step 920). 921) and the procedure returns to step 916.

【0035】命令文Cnの制御情報格納領域61にフラ
グEが格納されていた場合(ステップ917=NO)、
すなわち、現在処理対象としている実行パスにおいて実
行されるすべての命令文をその実行順序に並べ替える処
理が終了したと判定された場合には、同様の並べ替え処
理がすべての実行パスについて終了したか否かを確認
し、すべての並べ替え処理が終了したと判定された場合
にはステップ934へ分岐し、そうでない場合にはステ
ップ931へ分岐する(ステップ930)。すなわち、
上記の並べ替え処理がすべての実行パスについて終了し
ていないと判定された場合(ステップ930=NO)に
は、続く実行パスに対する処理を行うために、旧組合わ
せテ−ブル19a(新組合わせテ−ブル19b)におけ
る現在処理中のエントリと、旧実行パステ−ブル20a
(新実行パステ−ブル20b)における現在処理中のエ
ントリとをそれぞれ1エントリ分モディファイして(ス
テップ931,ステップ932)から、ステップ914
へ戻る。また、すべての並べ替え処理が終了したと判定
された場合(ステップ930=YES)には、各々の実
行パスについて、実行される命令がその実行順序も含め
て同一である他の実行パスの有無を確認し、同一の実行
パスが2以上存在していたときにはいずれかひとつの実
行パスのみを残して他の同一の実行パスの削除を行った
後(ステップ934)、実行パステーブル生成処理を完
了する。
When the flag E is stored in the control information storage area 61 of the command statement Cn (step 917 = NO),
That is, if it is determined that the processing of rearranging all the command statements executed in the execution path currently being processed in the execution order is completed, whether the same rearrangement processing is completed for all the execution paths. If it is determined that all the rearrangement processes have been completed, the process branches to step 934, and if not, the process branches to step 931 (step 930). That is,
When it is determined that the above-mentioned rearrangement processing has not been completed for all execution paths (step 930 = NO), the old combination table 19a (new combination) is set in order to perform the processing for the subsequent execution paths. The entry currently being processed in the table 19b) and the old execution path table 20a.
The entry currently being processed in the (new execution path table 20b) is modified by one entry each (step 931 and step 932), and then step 914.
Return to. Further, when it is determined that all the rearrangement processes have been completed (step 930 = YES), whether or not there is another execution path in which the executed instructions are the same, including the execution order, for each execution path. When there are two or more identical execution paths, only one execution path is left and the other identical execution paths are deleted (step 934), and the execution path table generation processing is completed. To do.

【0036】例えば、本実施例の図2で示した変更前ソ
ースプログラム11における実行パスでは、実行パスP
ANDR001およびPANDR002,実行パスPA
NDR005およびPANDR006で実行される命令
文は、以下に示すように、その実行順序も含めてまった
く同一である。 PANDR001:020→030→050→060→
120→130 PANDR002:020→030→050→060→
120→130 PANDR005:020→040→050→060→
120→130 PANDR006:020→040→050→060→
120→130 したがって、本実施例における実行パステーブル生成処
理で生成された旧実行パステ−ブル20aからは、実行
パスPANDR002およびPANDR006が削除さ
れている。
For example, in the execution path in the pre-change source program 11 shown in FIG. 2 of this embodiment, the execution path P
ANDR001 and PANDR002, execution path PA
The command statements executed by NDR005 and PANDR006 are exactly the same, including the order of execution, as shown below. PANDR001: 020 → 030 → 050 → 060 →
120 → 130 PANDR002: 020 → 030 → 050 → 060 →
120 → 130 PANDR005: 020 → 040 → 050 → 060 →
120 → 130 PANDR006: 020 → 040 → 050 → 060 →
120 → 130 Therefore, the execution paths PANDR002 and PANDR006 are deleted from the old execution path table 20a generated by the execution path table generation processing in this embodiment.

【0037】図15は、図1中の影響パス情報抽出処理
部の処理フローの一例を示す図である。同図において、
最初に変更前ソ−スプログラム11から生成された旧実
行パステ−ブル20aと、変更後ソースプログラム12
から生成された新実行パステ−ブル20bとを1実行パ
ス毎に全件比較して、一致する実行パスが検出された場
合には、旧実行パステ−ブル20aおよび新実行パステ
−ブル20bから一致した実行パスを削除する(ステッ
プ111)。そして、旧実行パステ−ブル20aおよび
新実行パステ−ブル20bに残った実行パスについて、
旧実行パステ−ブル20aにおいてはDELETED PATHSと
して、新実行パステ−ブル20bにおいてはADDED PATH
Sとして、影響パス情報201の抽出および出力を行う
(ステップ112)。
FIG. 15 is a diagram showing an example of the processing flow of the affected path information extraction processing section in FIG. In the figure,
First, the old execution path table 20a generated from the source program 11 before the change and the source program 12 after the change
All the new execution path tables 20b generated from the above are compared for each execution path, and if a matching execution path is detected, the old execution path table 20a and the new execution path table 20b are matched. The executed path is deleted (step 111). Then, regarding the execution paths remaining in the old execution path table 20a and the new execution path table 20b,
DELETED PATHS in the old execution path table 20a and ADDED PATH in the new execution path table 20b.
As S, the affected path information 201 is extracted and output (step 112).

【0038】図16は、図1および図2に基づいて抽出
された影響パス情報の一例を示す図であり、本実施例で
は、変更前ソースプログラムの4パスが削除され、変更
後ソースプログラムで8パスが追加されている。なお、
符号121で示す“〈”および“〉”は、1回〜n回の
ル−プを示すル−プ記号である。
FIG. 16 is a diagram showing an example of the affected path information extracted based on FIGS. 1 and 2. In this embodiment, four paths of the source program before change are deleted and the source program after change is deleted. Eight passes have been added. In addition,
“<” And “>” denoted by reference numeral 121 are loop symbols indicating loops 1 to n times.

【0039】[0039]

【発明の効果】【The invention's effect】

(1) 以上詳しく説明したように、本発明のプログラム実
行パスの解析方法によれば、解析対象とするソースプロ
グラムについて、当該ソースプログラムを構成する命令
文中の分岐文と実行文とを選別し、それぞれの分岐文に
おける分岐条件のすべての組合せを求め、これに基づい
て当該ソースプログラムにおけるすべてのプログラム実
行パスを表わすプログラム実行パステーブルを作成する
ことにより、プログラム中の個々の命令文が実行される
か否かではなく、プログラム実行時に各々のプログラム
実行パスが採用されるか否かに着目してプログラムテス
トを行うことが可能となるため、生産されるプログラム
製品の品質管理を十分に行うことができるという効果が
得られる。
(1) As described in detail above, according to the program execution path analysis method of the present invention, for the source program to be analyzed, the branch statement and the execution statement in the instruction statement constituting the source program are selected, Individual instruction statements in a program are executed by obtaining all combinations of branch conditions in each branch statement and creating a program execution path table that represents all program execution paths in the source program based on this combination. Whether or not each program execution path is adopted at the time of program execution, it is possible to carry out a program test, so that it is possible to perform sufficient quality control of the produced program product. The effect that it can be obtained.

【0040】(2) また、デバッグに伴う変更作業前後の
ソースプログラム(変更前:第1のソースプログラム,
変更後:第2のソースプログラム)について、第1のソ
ースプログラムに基づく第1のプログラム実行パステー
ブルを作成するとともに、前記第1のソースプログラム
を変更して得られた第2のソースプログラムに基づく第
2のプログラム実行パステーブルを作成し、前記第1お
よび第2のプログラム実行パステーブルを比較対照して
上記変更の影響を受けるすべてのプログラム実行パスを
抽出することにより、変更の影響があったすべてのプロ
グラム実行パスに対する再テスト項目を決定して再度の
プログラムテストを行うことが可能となるため、変更作
業によって作り込んでしまった不良を確実かつ正確に検
出し、生産されるプログラム製品の品質管理を十分に行
うことができるという効果が得られる。
(2) Further, the source program before and after the change work associated with debugging (before the change: the first source program,
(After change: second source program), based on a second source program obtained by changing the first source program while creating a first program execution path table based on the first source program. There is a change effect by creating a second program execution path table and comparing and comparing the first and second program execution path tables to extract all the program execution paths affected by the change. Since it is possible to determine the retest items for all program execution paths and perform the program test again, the defects created by the change work can be detected reliably and accurately, and the quality of the produced program product The effect is that management can be performed sufficiently.

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

【図1】本発明のプログラム実行パスの解析方法を実現
するシステムの一実施例の概略構成を示す図である。
FIG. 1 is a diagram showing a schematic configuration of an embodiment of a system for realizing a program execution path analysis method of the present invention.

【図2】図1中の変更前ソースプログラムの一例を示す
図である。
FIG. 2 is a diagram showing an example of a pre-change source program in FIG.

【図3】図1中の変更後ソースプログラムの一例を示す
図である。
FIG. 3 is a diagram showing an example of a changed source program in FIG.

【図4】図1中のパラメータの一例を示す図である。FIG. 4 is a diagram showing an example of parameters in FIG.

【図5】図2に対応するネットワークテーブルの一例を
示す図である。
5 is a diagram showing an example of a network table corresponding to FIG.

【図6】図1中の命令実行ネットワーク作成処理部の処
理フローの一例を示す図(その1)である。
FIG. 6 is a diagram (No. 1) showing an example of the processing flow of the instruction execution network creation processing unit in FIG. 1.

【図7】図1中の命令実行ネットワーク作成処理部の処
理フローの一例を示す図(その2)である。
7 is a diagram (No. 2) showing an example of the processing flow of the instruction execution network creation processing unit in FIG. 1. FIG.

【図8】図1中の命令実行ネットワーク作成処理部の処
理フローの一例を示す図(その3)である。
FIG. 8 is a diagram (No. 3) showing an example of the processing flow of the instruction execution network creation processing unit in FIG. 1.

【図9】図2に対応する組合せテーブルの一例を示す図
である。
9 is a diagram showing an example of a combination table corresponding to FIG.

【図10】図1中の実行可能パス数計算処理部の処理フ
ローの一例を示す図(その1)である。
FIG. 10 is a diagram (No. 1) showing an example of the processing flow of the executable path number calculation processing unit in FIG. 1;

【図11】図1中の実行可能パス数計算処理部の処理フ
ローの一例を示す図(その2)である。
FIG. 11 is a diagram (No. 2) showing an example of the processing flow of the executable path number calculation processing unit in FIG. 1;

【図12】図2に対応する実行パステーブルの一例を示
す図である。
12 is a diagram showing an example of an execution path table corresponding to FIG.

【図13】図1中の実行パステーブル生成処理部の処理
フローの一例を示す図(その1)である。
FIG. 13 is a diagram (No. 1) showing an example of the processing flow of the execution path table generation processing unit in FIG. 1.

【図14】図1中の実行パステーブル生成処理部の処理
フローの一例を示す図(その2)である。
FIG. 14 is a diagram (No. 2) showing an example of the processing flow of the execution path table generation processing unit in FIG. 1;

【図15】図1中の影響パス情報抽出処理部の処理フロ
ーの一例を示す図である。
FIG. 15 is a diagram showing an example of a processing flow of an affected path information extraction processing unit in FIG.

【図16】図1および図2に基づいて抽出された影響パ
ス情報の一例を示す図である。
FIG. 16 is a diagram showing an example of affected path information extracted based on FIGS. 1 and 2.

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

11 変更前ソ−スプログラム 12 変更後ソ−スプログラム 13 パラメ−タ 14 命令実行ネットワ−ク作成処理部 15 実行可能パス数計算処理部 16 実行パステーブル生成処理部 17 影響パス情報抽出処理部 18a,18b ネットワ−クテーブル 19a,19b 組合わせテーブル 20a,20b 実行パステーブル 201 影響パス情報 21a,21b ソ−スプログラム実行開始点 22a,22b ソ−スプログラム実行終了点 23a,32b 変更された命令文 61 制御情報格納領域 62 選択可能数格納領域 63 ポインタ領域 64,102 命令文シ−ケンス番号格納領域 65,103 命令文格納領域 81,101 実行パス名格納領域 82 分岐文シーケンス番号格納領域 83 選択番号格納領域 121 ル−プ記号 11 Source Program Before Change 12 Source Program After Change 13 Parameters 14 Instruction Execution Network Creation Processing Unit 15 Executable Path Number Calculation Processing Unit 16 Execution Path Table Generation Processing Unit 17 Impacted Path Information Extraction Processing Unit 18a , 18b Network table 19a, 19b Combination table 20a, 20b Execution path table 201 Influenced path information 21a, 21b Source program execution start point 22a, 22b Source program execution end point 23a, 32b Changed statement 61 Control information storage area 62 Selectable number storage area 63 Pointer area 64, 102 Command statement sequence number storage area 65, 103 Command statement storage area 81, 101 Execution path name storage area 82 Branch statement sequence number storage area 83 Selection number Storage area 121 Loop symbol

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 ソースプログラムを構成する命令文中の
分岐文と実行文とを選別し、それぞれの分岐文における
分岐条件のすべての組合せを求め、これに基づいて当該
ソースプログラムにおけるすべてのプログラム実行パス
を表わすプログラム実行パステーブルを作成することを
特徴とするプログラム実行パスの解析方法。
1. A branch statement and an executable statement in an instruction statement constituting a source program are selected, all combinations of branch conditions in each branch statement are obtained, and based on this, all program execution paths in the source program. A method for analyzing a program execution path, characterized by creating a program execution path table representing
【請求項2】 第1のソースプログラムに基づく第1の
プログラム実行パステーブルを作成するとともに、前記
第1のソースプログラムを変更して得られた第2のソー
スプログラムに基づく第2のプログラム実行パステーブ
ルを作成し、 前記第1および第2のプログラム実行パステーブルを比
較対照して上記変更の影響を受けるすべてのプログラム
実行パスを抽出することを特徴とする請求項1記載のプ
ログラム実行パスの解析方法。
2. A second program execution path based on a second source program obtained by modifying the first source program while creating a first program execution path table based on the first source program. 2. A program execution path analysis according to claim 1, wherein a table is created, and all the program execution paths affected by the change are extracted by comparing and comparing the first and second program execution path tables. Method.
JP6101211A 1994-05-16 1994-05-16 Analyzing method for program execution path Pending JPH07311694A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6101211A JPH07311694A (en) 1994-05-16 1994-05-16 Analyzing method for program execution path

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6101211A JPH07311694A (en) 1994-05-16 1994-05-16 Analyzing method for program execution path

Publications (1)

Publication Number Publication Date
JPH07311694A true JPH07311694A (en) 1995-11-28

Family

ID=14294585

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6101211A Pending JPH07311694A (en) 1994-05-16 1994-05-16 Analyzing method for program execution path

Country Status (1)

Country Link
JP (1) JPH07311694A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007193586A (en) * 2006-01-19 2007-08-02 Nec Corp Program test assist system, method and program
JP2008299723A (en) * 2007-06-01 2008-12-11 Hitachi Systems & Services Ltd Program verification method and device
JPWO2007072652A1 (en) * 2005-12-22 2009-05-28 俊一 新原 Program processing pattern automatic analysis processor

Cited By (3)

* 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
JP2007193586A (en) * 2006-01-19 2007-08-02 Nec Corp Program test assist system, method and program
JP2008299723A (en) * 2007-06-01 2008-12-11 Hitachi Systems & Services Ltd Program verification method and device

Similar Documents

Publication Publication Date Title
CN106294156B (en) A kind of static code fault detection analysis method and device
Korel et al. Slicing of state-based models
JPH08190587A (en) Simulation system for application process
CN104794057B (en) A kind of crossing event automated testing method and device
US7080360B2 (en) Breakpoint safety net
US6330692B1 (en) Method of determining the route to be tested in a load module test
CN108021507A (en) The parallel route searching method and device of semiology analysis
US6106572A (en) Forward and reverse hierarchical page level debugger
CN108595336A (en) A kind of computer software testing system based on Ethernet
CN114003451B (en) Interface testing method, device, system and medium
Grieskamp et al. Testable use cases in the abstract state machine language
CN110321144A (en) Recognition methods, device, equipment and the storage medium of offline source code
JPH07311694A (en) Analyzing method for program execution path
Ulrich et al. Specification-based testing of concurrent systems
CN111695238A (en) System and method for visualizing transient simulation data of power system
CN108874668A (en) A kind of application testing method and device
JPH03286337A (en) Speed increasing system for inference with optimization of processing structure for decision of condition
CN110413518A (en) The generation method and generating means and computer readable storage medium of control object library
JPH09288580A (en) Device and method for optimizing source program
Beck An Empirical Study of Multi-Point Constructive Search for Constraint-Based Scheduling.
CN109815136B (en) Data processing method and device for service operation
JPH10198579A (en) Device for extracting state transition route
Gong et al. Detecting interprocedural infeasible paths via symbolic propagation and dataflow analysis
JPH02171938A (en) Device for supporting program development
US20050262079A1 (en) Method and apparatus for assigning test numbers