JPH01237737A - System for supporting flag identification - Google Patents
System for supporting flag identificationInfo
- Publication number
- JPH01237737A JPH01237737A JP63064596A JP6459688A JPH01237737A JP H01237737 A JPH01237737 A JP H01237737A JP 63064596 A JP63064596 A JP 63064596A JP 6459688 A JP6459688 A JP 6459688A JP H01237737 A JPH01237737 A JP H01237737A
- Authority
- JP
- Japan
- Prior art keywords
- list
- variable
- flag
- definition
- conditional
- 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
Links
Landscapes
- Debugging And Monitoring (AREA)
- Devices For Executing Special Programs (AREA)
Abstract
Description
【発明の詳細な説明】
〔概 要〕
手続型言語のプログラムの変数のうちフラグとして用い
られているものを識別するためのフラグ識別支援方式に
関し、
ソフトウェアのテスト等を効率的に行う為の支援方式を
提供することを目的とし、
入力されたプログラムに対し、条件文または代入文によ
ってのみ参照されるような変数のリストを作成する変数
リスト生成部と、変数リスト中の指定された変数に対し
て、到達可能な定義の集合を求める到達可能定義集合抽
出部と、上記の到達可能な定義の集合が、ある条件文に
よって互いに素な部分集合に分割されるかを調べるマー
カ最終判定部と、マーカと判定された変数からフラグと
して使われる変数のリストを作成するフラグ抽出部と、
前記フラグのリストを出力する出力処理部とを持ち、入
力されたプログラム中で、フラグとして使われている変
数を抽出するための支援を行うように構成する。[Detailed Description of the Invention] [Summary] Support for efficiently performing software testing, etc., regarding a flag identification support method for identifying variables used as flags among variables in a procedural language program. The purpose of this program is to provide a variable list generator that creates a list of variables that are referenced only by conditional statements or assignment statements for an input program, and a a reachable definition set extraction unit that obtains a set of reachable definitions; a marker final determination unit that examines whether the set of reachable definitions is divided into disjoint subsets by a certain conditional statement; a flag extraction unit that creates a list of variables to be used as flags from variables determined to be markers;
and an output processing unit that outputs the list of flags, and is configured to support extraction of variables used as flags in the input program.
本発明はソフトウェアのテスト方式に係り、特に手続型
言語のプログラムの変数のうちフラグとして用いられて
いるものを識別するためのフラグ識別支援方式に関する
。The present invention relates to a software testing method, and more particularly to a flag identification support method for identifying variables of a procedural language program that are used as flags.
本発明は、コンピュータによってフラグ識別作業を支援
するための方式であり、既存の技術であるデータフロー
解析を利用することによってフラグの識別を効率化する
ことを目的とする。The present invention is a system for supporting flag identification work using a computer, and aims to make flag identification more efficient by using data flow analysis, which is an existing technique.
〔従来の技術及び発明が解決しようとする課題〕ソフト
ウェアのテスト、あるいは保守例えば機能の削除、変更
、追加の必要性から作成済みのプログラムを理解しよう
とするとき、ある変数がフラグであることを識別するこ
とは理解作業を容易にするために重要である。従来、こ
の作業は担当者が直接プログラムを読み、自身が持って
いる知識や経歴を頼りに行われていたため、時間と労力
がかかり、作業内容も不均質であった。[Prior art and problems to be solved by the invention] When trying to understand a created program for software testing or maintenance, for example, the need to delete, change, or add functionality, it is difficult to understand that a certain variable is a flag. Identification is important to facilitate understanding tasks. Previously, this work had to be done by the person in charge directly reading the program and relying on their own knowledge and background, which took time and effort, and the content of the work was heterogeneous.
本発明はソフトウェアのテスト等を効率的に行う為の支
援方式を提供することを目的とする。An object of the present invention is to provide a support method for efficiently performing software testing.
〔課題を解決するための手段及び作用〕本発明の詳細な
説明する前に、フラグの定義を明確にする。ただし、以
下では複数のプログラムに跨がって利用されるようなフ
ラグは除外して考える。すなわち、本発明はプログラム
内部でローカルに使われ他のプログラムの参照関係がな
いフラグのみを対象としている。基本的にフラグはプロ
グラムのある点における処理の仕方に応じて他の(後の
)点の処理の分岐を制御するためのものであるとする。[Means and effects for solving the problems] Before explaining the present invention in detail, the definition of a flag will be clarified. However, in the following we will exclude flags that are used across multiple programs. That is, the present invention targets only flags that are used locally within a program and have no reference relationship with other programs. Basically, flags are used to control branching of processing at other (later) points in accordance with the processing at a certain point in the program.
すなわち、フラグはプログラムにおいて分岐の制御のた
めだけに使われる制御変数であり、それ以外の意味は持
たないとする。フラグはプログラム中のある点における
処理の仕方を保存するための目印(マーカ)用変数と対
で使われるが、マーカ自身がフラグとなることもある。In other words, flags are control variables used only to control branching in a program, and have no other meaning. A flag is used in conjunction with a marker variable to store the processing at a certain point in a program, but the marker itself can also serve as a flag.
通常は両者は同一である。Usually both are the same.
次にフラf’の定義を与える。Next, we will give the definition of f'.
・変数AH,・・・、A6によって変数Xが定義される
(例えば、X : ” AI + 2 At + 3
A3などのように、AI、・・・、Aいの値によってX
の値が定められるような代入文をXの定義という)とき
、これを関数的にX : =X (A、、・・・。・Variable X is defined by variables AH, ..., A6 (for example, X: ” AI + 2 At + 3
As in A3, AI, ..., X depending on the value of A
An assignment statement that determines the value of is called a definition of X), then this can be expressed functionally as
Aイ)とかくことにする。A) I will write it as follows.
・以下、条件文の条件関数とは、条件文中の条件式が成
立するときに真(T)、成立しないときに偽(F)とな
るような関数であるとする。-Hereinafter, the conditional function of a conditional statement is a function that is true (T) when the conditional expression in the conditional statement is true, and false (F) when it is not true.
例えば条件文
「if X+2Y〉Othen・・・else・・・」
の条件関数は
である。For example, the conditional statement "if X+2Y>Othen...else..."
The conditional function of is .
・変数Xが間接的に参照されるとは、Y:=f(X、
Z’)のようにXを用いて定義される変数(この場合
Y)が参照されることをいう。・Variable X is indirectly referenced as Y:=f(X,
This means that a variable defined using X (Y in this case), such as Z'), is referenced.
ここで本発明でプログラム中に使用される変数がフラグ
と判断するための条件を以下に見い出す。Here, the conditions for determining that a variable used in a program in the present invention is a flag are found below.
〔定義1〕 変数Xがマーカ(MK)である。[Definition 1] Variable X is a marker (MK).
(1)Xは、プログラム中の条件文、または代入文にお
いてのみ参照される(この参照されるノードをηとする
)。(1) X is referenced only in a conditional statement or an assignment statement in the program (this referenced node is assumed to be η).
(2) (1)の参照に対して、Xは異なる2つ以上
の到達可能な定義を持つ(これをRD(η、X>とする
)。(2) For the reference in (1), X has two or more different reachable definitions (let this be RD(η, X>)).
(31RD(η、X)は、ある条件文によって互いに異
なると判別できる部分集合に分割される(定義2参照)
。この定義1の(3)をさらに具体的に定義2として見
い出される。(31RD(η,
. This Definition 1 (3) can be found more specifically as Definition 2.
〔定義2) RD(η、 X) = (X : =X
(i)(Al(り、・・・A、 U) ); i =
1゜・・・、n) とするとき、
RD(η、X)がある条件文によって互いに異なると判
別できる部分集合に分割される。[Definition 2) RD(η, X) = (X: =X
(i) (Al(ri,...A, U)); i =
1°..., n), RD(η, X) is divided into subsets that can be determined to be different from each other by a certain conditional statement.
+l) Xを直接(例えばC(X) )または間接的
(例えばC(W);w== (X))に参照する条件文
が存在する。このときこの条件文の条件関数をC(X、
Yl 、 ・・・、Yi)とする。+l) There is a conditional statement that refers to X directly (for example, C(X)) or indirectly (for example, C(W); w== (X)). In this case, the conditional function of this conditional statement is C(X,
Yl, ..., Yi).
ただし、Xが条件文において間接的に参照される場合、
Xによって定義される変数(Wとする)が存在し、W:
=g (X、B、、 ・・・。However, if X is indirectly referenced in the conditional statement,
There is a variable (let W) defined by X, and W:
=g (X, B, . . .
Bs)のように表される。このとき、条件関数は
C(g (X、 B、、 ・ −・、 Bs)
、 Y、。Bs). At this time, the conditional function is C(g (X, B,, ・ −・, Bs)
, Y.
・ ・ ・、Yi)
と表されるが、本質的な影響はないので、簡単のためC
(X、Y、、 ・・・、Yz)の場合だけを考える。・ ・ ・, Yi), but since there is no essential effect, C is used for simplicity.
Consider only the case of (X, Y, . . . , Yz).
(21X(7)定義X 、 =)((i) (A、
(i) 、 ・・、。(21X(7) Definition X , =)((i) (A,
(i) ,...,.
A、 (i) )において、関数X(′)の定義域(す
なわち、全てのAk ” (K=1. ・・ ・。A, (i)), the domain of the function X(') (i.e. all Ak'' (K=1. . . .
m)の取り得る値の可能な組合せの集合)をdon(X
) (dom;領域)とかくとき、全てのX<=+
(i= 1. ・・+、n)!11:対して以
下が成立する。set of possible combinations of possible values of m)) as don(X
) (dom; area), all X<=+
(i = 1. . . +, n)! 11: In contrast, the following holds true.
Y++ ・・・YLの取り得る値を任意に固定したと
き(これをyl、・・・yzとする)、C(X(直)
目(ム’+71+ ・・・、y、c)=一定forf
”こdom(X ” )
+3)Y、、 ・・・Yfiの取り得る値を任意に固
定したとき、
C(X”ゝ (言(11)、y、、・・・。Y++...When the possible values of YL are arbitrarily fixed (these are yl,...yz), C(X (direct)
Eyes (mu'+71+ ..., y, c) = constant forf
"Kdom(X") +3)Y,... When the possible values of Yfi are fixed arbitrarily, C(X"ゝ (Word (11), y,...
yz)≠C(X ” (a ” ) r 7 r
+ ・・・。yz)≠C(X ” (a ”) r 7 r
+...
y□)となるi、j(i≠j)が存在する。There exist i and j (i≠j) such that y□).
〔定義3〕 変数Xがフラグである。[Definition 3] Variable X is a flag.
XはMKであり、かつ、直接参照するような条件文があ
るか、又はMKによって定義され、かつ、Xを直接参照
するような条件文が存在する。Either X is MK and there is a conditional statement that directly references it, or there is a conditional statement that is defined by MK and directly references X.
定義1は、プログラム中でマーカとして使われる変数の
定義である。マーカ自身とフラグとが一致する場合が多
く、例えば、第2図(a)のMはフラグであリマーカで
ある。また、例えば第2図世)の例の場合、Ml、M2
はマーカであるがフラグではなく、Fはマーカではない
が、フラグであると考える。Definition 1 is a definition of a variable used as a marker in the program. In many cases, the marker itself and the flag match; for example, M in FIG. 2(a) is a flag and is a remarker. For example, in the case of the example shown in Figure 2), Ml, M2
is a marker but not a flag, and F is not a marker but is considered a flag.
定義2はマーカの性質のひとつ(定義1131)を定式
化したものである。Definition 2 is a formulation of one of the properties of a marker (definition 1131).
定義3はフラグの定義である。Definition 3 is the definition of a flag.
次に本発明の機能ブロック図を第1図に示す。Next, a functional block diagram of the present invention is shown in FIG.
本発明は指定されたプログラムを入力しく101)、プ
ログラム内でフラグとして用いられる変数のリストを出
力する(107)。The present invention inputs a specified program (101) and outputs a list of variables used as flags within the program (107).
変数リスト生成部102は、読み込んだプログラムの全
(ローカル)変数の内、条件文または代入文によっての
み参照される変数のリストを作成する(定義1(11)
。このリストを“処理リスト”と呼ぶ。処理リストから
先頭の要素(変数)を取り出し、到達可能定義集合抽出
部103以後の処理を実行し、処理が終了したら次の要
素を取り出し同様なことを繰り返す。The variable list generation unit 102 creates a list of variables that are referenced only by conditional statements or assignment statements among all (local) variables of the read program (Definition 1 (11)
. This list is called a "processing list". The first element (variable) is extracted from the processing list, the processing after the reachable definition set extraction unit 103 is executed, and when the processing is completed, the next element is extracted and the same process is repeated.
到達可能定義集合抽出部103は、定義2(2)をチエ
ツクするためのものである。これは変数リスト生成部1
02によって取り出された変数を入力とし、既存の技術
であるデータフロー解析手段1O8を利用することによ
って、その変数(Xとする)が参照される箇所に到達可
能なXの定義の集合を求める。この集合が2つ以上の要
素から成るとき(定義[2))、マーカ最終判定部10
4以後の処理を実行し、そうでなければXに関する処理
を終了する。The reachable definition set extraction unit 103 is for checking definition 2 (2). This is variable list generator 1
02 is input, and by using the data flow analysis means 1O8, which is an existing technique, a set of definitions of X that can reach the location where the variable (denoted as X) is referenced is obtained. When this set consists of two or more elements (definition [2)], the marker final determination unit 10
4 and subsequent processes are executed, and if not, the process related to X is ended.
ここで、プログラムのある点ηに到達可能なXの定義(
代入文)とは、その定義からηに達するパスが存在し、
かつ、そのパス上に他のXの定義が存在しないような定
義をいう。例えば第3図の44に到達可能なXの定義の
集合RD(η4.X)は(X : =3.X : =X
+Y)である。Here, the definition of X that can reach a certain point η in the program (
Assignment statement) means that there exists a path from its definition to η,
A definition in which there is no other definition of X on that path. For example, the set RD(η4.X) of definitions of X that can reach 44 in FIG.
+Y).
第4図に到達可能定義集合抽出部の処理フロー図を示す
。以下第4図によってこの処理を説明する。FIG. 4 shows a processing flow diagram of the reachable definition set extraction unit. This process will be explained below with reference to FIG.
変数リスト生成部102により取り出された変敗X(2
01)に関する、全ての参照箇所が調べられ、そのプロ
グラム内の位置を識別するための名前、例えば行番号な
どがつけられて、REFリストに格納される(202)
。例えば第3図ではREFリスト−(η3.η4)であ
る。The change X(2) extracted by the variable list generation unit 102
All references to 01) are checked, given a name to identify the position in the program, such as a line number, and stored in the REF list (202).
. For example, in FIG. 3, the REF list is -(η3.η4).
REFリストから先頭要素ηを取り出し、(Xの)参照
箇所ηに到達可能な(Xの)定義の集合RD (77、
X)を求める(203)。Extract the first element η from the REF list and set RD (77,
X) is determined (203).
RD(η、X>の要素数が1つ以下の場合、Xに関する
処理を終了し到達可能定義集合抽出部103へ戻る(2
05)。If the number of elements in RD(η,
05).
そうでなければRD(η、X)を“RDリスト”へ格納
しく206) 、REFリストが空になるまで(207
)同様なことを繰り返す。Otherwise, store RD(η,
) Repeat the same thing.
次に、マーカ最終判定部104の説明を、その処理フロ
ー図である第5図を用いて行う。マーカ最終判定部10
4は定義1の(3)(すなわち定義2)をチエツクする
ための処理を行う部分である。Next, the marker final determination section 104 will be explained using FIG. 5, which is a processing flow diagram thereof. Marker final judgment section 10
4 is a part that performs processing for checking (3) of Definition 1 (ie, Definition 2).
先ず、着目している変数Xを直接又は間接に参照する条
件文が存在するか否かを判定しく303)、もしなけれ
ばXに関する処理を終了して到達可能定義集合抽出部1
03へ戻る(302)。First, it is determined whether there is a conditional statement that directly or indirectly refers to the variable X of interest (303), and if there is no conditional statement, the process regarding X is terminated and the reachable definition set extraction unit 1
Return to 03 (302).
ここで、Xを間接に参照するとは、Y:=f(X、Z”
)のようにXを用いて定義される変数Yを参照する場合
をいうこととする。Here, referring to X indirectly means Y:=f(X, Z"
) refers to the case where a variable Y defined using X is referenced.
次にその条件文に関する条件関数
C(X、 Y+ 、Y2 、・・・、Yl)を条件文か
ら求める(304)。Next, a conditional function C (X, Y+, Y2, . . . , Yl) regarding the conditional statement is obtained from the conditional statement (304).
条件文のプログラム中の位置をη。とする。Let η be the position of the conditional statement in the program. shall be.
入力されたRDリスI−(301)から先頭要素(RD
(η、X>とする)を取り出す(305)。From the input RD list I-(301) to the first element (RD
(let η, X>) is extracted (305).
更に、RD(η、X>の先頭要素(x 、 = x (
i)(A、(”)、・・・ 、a、、(1) とする
。)を取り出す(306)。Furthermore, the first element (x, = x (
i) Extract (A, (''), . . . , a, , (1)) (306).
このX(i)に対して定義2の(2)が成立するか否か
を次のようにしてチエツクする(307)。It is checked as follows whether (2) of Definition 2 holds for this X(i) (307).
プログラム中でX 、 = X (i) (A、
+り、・・・ )、、 (1) )が存在する箇所(定
義箇所)をη(1) とする。In the program, X , = X (i) (A,
Let η(1) be the location (definition location) where +ri,... ),, (1) ) exists.
プログラム変数の取り得る値の推定支援方式(以下値推
定方式と略す)によって、A、 Tit。A. Tit by a support method for estimating possible values of program variables (hereinafter abbreviated as value estimation method).
・・・、A、 +i)の各々に対して、η(i)におい
て取りうる値を全て求め、それらの値の組み合わせの全
てに対して(すなわち全てのa(a)εdomX(“)
に対し)
C(X” (a ”’ ) + )’+ 、・・・、
yA)・・・・・(1)
を計算し、それらの計算結果が全て一致するかどうかを
調べる。ただし、Cは条件関数、y++ ・・・、y
はY3.・・・、YLのηゎにおいて取り得る値に固
定する。丁(正) は
a (i) = (a 、(り、 a %
il 、 、 ・ t、 a 、
(五) )かツa lC1’ + ” ’ + a
m ″) は各々A 、 (t )。..., A, +i), find all possible values of η(i), and for all combinations of those values (i.e., all a(a)εdomX(")
) C(X” (a ”’ ) + )’+ ,...
yA)...(1) Calculate and check whether all the calculation results match. However, C is a conditional function, y++ ..., y
is Y3. . . . is fixed to a value that can be taken at ηゎ of YL. Ding (correct) is a (i) = (a , (ri, a %
il, , ・t, a,
(5) ) katsu a lC1' + ” ' + a
m ″) are A and (t ), respectively.
・・・、Aイ(iゝ の取り得る値である。実際には、
Xがマーカのときは、Xの定義は単なる定数(Xとする
)であることが多く、(1)式はその定義に対し、
C(x、y、、 ・・・、yl)
となり、不変なので、この場合Xに関して定義2(2)
は容易に成立する(307)ことが分る。. . . is the possible value of Ai (iゝ).In reality,
When X is a marker, the definition of X is often just a constant (X), and equation (1) becomes C(x, y, . . . , yl) for that definition and remains unchanged. Therefore, in this case, definition 2 (2) regarding X
It can be seen that (307) is easily established.
RD(η、X)の全ての要素(ηに到達可能なXの定義
)に対し、同様のチエツクを行う (309)。A similar check is performed for all elements of RD(η, X) (definitions of X that can reach η) (309).
次に、Xの各定義 X : = X (i) (・・
・・)に対し、Xに関して定義2(2)が成立するか、
(307)のチエツクを行う際に実行される(11式の
計算の結果を利用して定義2の(3)が成立するか否か
を調べる。成立すればXはマーカと判定され、成立しな
ければXに関する処理を終了して到達可能定義集合抽出
部103へ戻る(30 B)。Next, each definition of X X: = X (i) (...
), does Definition 2 (2) hold for X?
Executed when checking (307), it is checked whether (3) of Definition 2 holds true using the result of the calculation of equation 11. If it holds, X is determined to be a marker and it does not hold. If not, the process regarding X is ended and the process returns to the reachable definition set extraction unit 103 (30B).
以上のようにしてマーカ最終判定部104の処理によっ
て、Xが目印(マーカ)であると判定された場合、次に
フラグ抽出部105が実行される。If it is determined that X is a landmark (marker) through the process of the marker final determination unit 104 as described above, then the flag extraction unit 105 is executed.
フラグ抽出部105はマーカ変数Xを入力とし、Xがプ
ログラム中のある条件文において直接参照されるかどう
かを調べる。直接参照されるならばXはフラグであると
判定され、フラグリストに格納される。条件文に直接参
照されないとき、プログラム中でXが参照される代入文
を調べ、その代入先の変数(代入文の左辺)をフラグと
してフラグリストに格納し、更に変数リストから消去す
る。The flag extraction unit 105 receives the marker variable X and checks whether X is directly referenced in a certain conditional statement in the program. If it is directly referenced, X is determined to be a flag and is stored in the flag list. When X is not directly referenced by a conditional statement, the assignment statement in which X is referenced is checked in the program, the variable to which it is assigned (the left side of the assignment statement) is stored as a flag in the flag list, and then deleted from the variable list.
以上によってXに関する処理を終了し、到達可能定義集
合抽出部103に戻って同様の処理を繰り返す。With the above, the processing related to X is completed, and the process returns to the reachable definition set extraction unit 103 to repeat the same processing.
変数リスト生成部102で生成した変数リストの全ての
要素(変数)に対して処理が終了した後、出力処理部1
06によって、フラグリストを適当な形で出力する。After processing is completed for all elements (variables) of the variable list generated by the variable list generation unit 102, the output processing unit 1
06, the flag list is output in an appropriate format.
本発明の実施例を第6図に示すプログラムのフローチャ
ートについて、第1図、第4図、第5図を参照して説明
する。The program flowchart of the embodiment of the present invention shown in FIG. 6 will be described with reference to FIGS. 1, 4, and 5.
入力されたプログラム(第6図)に対し、変数リスト生
成部102の処理を実行し、変数リスト(・・・、X、
Y、 ・・・)を作成する。The process of the variable list generation unit 102 is executed for the input program (Fig. 6), and the variable list (...,
Y, ...) is created.
変数リストの各要素に対し、到達可能定義集合抽出部1
03以後の処理を次々と実行し、今、変数Xに関する処
理を実行するものとする。For each element of the variable list, reachable definition set extraction unit 1
It is assumed that the processes after 03 are executed one after another, and now the process regarding variable X is executed.
変数Xは到達可能定義集合抽出部103に送られ(20
1)、その参照箇所を調べられる。この実施例のプログ
ラムにおけるXの参照箇所はYニーX−4であるので、
これにηという名前をつけてREFリストに格納する(
202)。REFリスト=(η)である。The variable X is sent to the reachable definition set extraction unit 103 (20
1), you can look up the references. The reference point for X in the program of this example is Y knee X-4, so
Name this η and store it in the REF list (
202). REF list=(η).
次に、ηをREFリストがら取り出して、データフロー
解析手段108を用いてRD(η、x)を求める(20
3)、RD (η、X)= (X:=1、X:=51で
ある。Next, η is extracted from the REF list and RD(η, x) is obtained using the data flow analysis means 108 (20
3), RD (η, X)=(X:=1, X:=51.
RD(η、X)の要素数は2以上なので(204)、こ
れをRDリストに格納する(206)。Since the number of elements of RD(η,X) is 2 or more (204), it is stored in the RD list (206).
RDリスト=RD (η、X)である。RD list=RD (η, X).
REFリストは空となるので(20?)、マーカ最終判
定部104へ処理を移す。Since the REF list is empty (20?), the process is transferred to the marker final determination unit 104.
マーカ最終判定部104において、まずXを直接または
間接に参照する条件文があるかどうがが判定されるが(
303)、Xは2つ目の条件分岐において間接的に参照
される。The marker final determination unit 104 first determines whether there is a conditional statement that directly or indirectly refers to X (
303), X is indirectly referenced in the second conditional branch.
従って、この条件文に関する条件関数を求める(304
)。Therefore, find the conditional function regarding this conditional statement (304
).
条件関数は、 である。The condition function is It is.
RDリストから先頭要素RD(η、X)を取り出す(3
05)。Extract the first element RD (η, X) from the RD list (3
05).
次に、RD(η、X)から先頭要素X:=1を取り出す
(306)。この定義は定数定義であり、Xの定義に変
数を含まないのでXは常に同一の値(すなわち1)を取
るので、恒等的に
C(1) =F ・・・・ (ア)
となり、Xに関して定義2(2)が成立する(307)
。Next, the first element X:=1 is extracted from RD(η,X) (306). This definition is a constant definition, and since the definition of X does not include any variables, X always takes the same value (i.e. 1), so C(1) = F... (A)
Therefore, definition 2 (2) holds for X (307)
.
このとき、RD(η、X)= (X:=5)であり、空
でないので(309)X:=5を取り出しく306)、
同様に
C(5)=T ・ ・ ・ ・
(イ)からXに関して定義2(2)が成立する(307
)。At this time, RD(η,
Similarly, C(5)=T ・ ・ ・ ・
From (a), definition 2(2) holds for X (307
).
(ア)、(イ)より定義2の(3)が成立するので(3
10)、Xをマーカと判定する(311)。From (a) and (b), definition 2 (3) holds, so (3
10), determines that X is a marker (311).
次にフラグ抽出部105に処理が移される。フラグ抽出
部105では、マーカ変数Xを入力し、Xを直接参照す
る条件文が存在するかを′調べるが、存在しないので、
Xによって定義される変数Yをフラグとしフラグリスト
に格納し、Yを変数リストから消去する。Next, processing is transferred to flag extraction section 105. The flag extraction unit 105 inputs the marker variable X and checks to see if there is a conditional statement that directly refers to X.
The variable Y defined by X is stored as a flag in the flag list, and Y is deleted from the variable list.
以上によってXに関する処理を終了し、到達可能定義集
合抽出部103へ戻って変数が無くなるまで同様の処理
を行い、最後にフラグリストを出力して全処理を終了す
る。The processing related to X is thus completed, and the process returns to the reachable definition set extracting unit 103 to perform the same processing until there are no more variables, and finally outputs the flag list and completes the entire processing.
本発明によれば、手続型言語のプログラムのテストに際
して従来の手作業に比べて著しく作業効率が向上する。According to the present invention, when testing a program in a procedural language, work efficiency is significantly improved compared to conventional manual testing.
第1図は本発明の機能ブロック図、
第2図(a)、 (blはマーカ判別図、第3図は本発
明を説明するためのフローの一例、第4図は本発明の到
達可能定義集合抽出部処理フロー図、
第5図はマーカ最終判定部処理フロー図、第6図は入カ
プログラム例図である。 。
101・・・入力プログラム、
102・・・変数リスト生成部、
103・・・到達可能定義集合抽出部、104・・・マ
ーカ最終判定部、
105・・・フラグ抽出部、
106・・・出力処理部、
107・・・出力リスト、
108・・・データフロー解析手段、
109・・・変数の取り得る値推定手段。Fig. 1 is a functional block diagram of the present invention, Fig. 2(a) and (bl are marker discrimination diagrams, Fig. 3 is an example of a flow for explaining the present invention, and Fig. 4 is a reachable definition of the present invention). Figure 5 is a processing flow diagram of the set extraction unit, Figure 5 is a processing flow diagram of the marker final judgment unit, and Figure 6 is an example diagram of the input program.101... Input program, 102... Variable list generation unit, 103. ... Reachable definition set extraction unit, 104... Marker final judgment unit, 105... Flag extraction unit, 106... Output processing unit, 107... Output list, 108... Data flow analysis means, 109...Means for estimating possible values of variables.
Claims (1)
代入文によってのみ参照されるような変数のリストを作
成する変数リスト生成部(102)と、 変数リスト中の指定された変数に対して、到達可能な定
義の集合を求める到達可能定義集合抽出部(103)と
、 上記の到達可能な定義の集合が、ある条件文によって互
いに素な部分集合に分割されるかを調べるマーカ最終判
定部(104)と、 マーカと判定された変数からフラグとして使われる変数
のリストを作成するフラグ抽出部(105)と、 前記フラグのリストを出力する出力処理部(106)と
を持ち、入力されたプログラム中で、フラグとして使わ
れている変数を抽出するための支援を行うフラグ識別支
援方式。[Claims] A variable list generation unit (102) that creates a list of variables that are referenced only by conditional statements or assignment statements for an input program (101); A reachable definition set extraction unit (103) that obtains a set of reachable definitions for a variable, and checks whether the above set of reachable definitions can be divided into disjoint subsets by a certain conditional statement. It has a marker final determination unit (104), a flag extraction unit (105) that creates a list of variables used as flags from variables determined to be markers, and an output processing unit (106) that outputs the list of flags. , a flag identification support method that supports extracting variables used as flags in an input program.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP63064596A JPH01237737A (en) | 1988-03-17 | 1988-03-17 | System for supporting flag identification |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP63064596A JPH01237737A (en) | 1988-03-17 | 1988-03-17 | System for supporting flag identification |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH01237737A true JPH01237737A (en) | 1989-09-22 |
Family
ID=13262794
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP63064596A Pending JPH01237737A (en) | 1988-03-17 | 1988-03-17 | System for supporting flag identification |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH01237737A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2006038394A1 (en) * | 2004-10-04 | 2006-04-13 | Matsushita Electric Industrial Co., Ltd. | Source code inspection device, method, program, and recording medium |
| JP2018049565A (en) * | 2016-09-23 | 2018-03-29 | 株式会社東芝 | Software verification system and software verification method |
-
1988
- 1988-03-17 JP JP63064596A patent/JPH01237737A/en active Pending
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2006038394A1 (en) * | 2004-10-04 | 2006-04-13 | Matsushita Electric Industrial Co., Ltd. | Source code inspection device, method, program, and recording medium |
| US8020153B2 (en) | 2004-10-04 | 2011-09-13 | Panasonic Corporation | Source code checker, source code checking method, program for causing execution of the method, and storage medium for storing the program |
| JP2018049565A (en) * | 2016-09-23 | 2018-03-29 | 株式会社東芝 | Software verification system and software verification method |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11263116B2 (en) | Champion test case generation | |
| CN115564322B (en) | Service processing method and device, electronic equipment and storage medium | |
| JP2010140434A (en) | Method for supporting analysis of program, and computer program and computer system therefor | |
| US20150106793A1 (en) | Detecting Byte Ordering Type Errors in Software Code | |
| KR102011725B1 (en) | Whitelist construction method for analyzing malicious code, computer readable medium and device for performing the method | |
| US9134979B2 (en) | Convergence analysis in multithreaded programs | |
| CN109379398A (en) | A kind of method of data synchronization and device | |
| CN108512822B (en) | Risk identification method and device for data processing event | |
| CN114003234A (en) | Small program partial compilation method, apparatus, device and computer-readable storage medium | |
| CN111782443B (en) | Data processing method and device and electronic equipment | |
| CN110989991A (en) | Method and system for detecting source code clone open source software in application program | |
| CN111739046A (en) | Method, apparatus, device and medium for model update and image detection | |
| CN111240967A (en) | Code generation method and device | |
| CN103632099B (en) | The Native api function acquisition methods do not derived and device | |
| JP6880962B2 (en) | Program analyzer, program analysis method and analysis program | |
| JP2020042795A (en) | Uncertainty factor detector for smart contract, method and storage medium | |
| CN106095674A (en) | A kind of website automation test method and device | |
| CN106126670B (en) | Operation data sorting processing method and device | |
| US11481546B2 (en) | Screen discrimination apparatus, screen discrimination method and program | |
| CN116339716B (en) | Flow chart analysis method | |
| CN118426834A (en) | Compilation method, device, equipment, medium and program product of deep learning model | |
| CN115481670B (en) | A model training method, apparatus, device, and readable storage medium | |
| CN105677559B (en) | A kind of detection method and device | |
| CN112612471B (en) | Code processing method, device, equipment and storage medium | |
| JP7367410B2 (en) | Generation program, generation method, and information processing device |