JP2832330B2 - Software remodeling support apparatus and method - Google Patents

Software remodeling support apparatus and method

Info

Publication number
JP2832330B2
JP2832330B2 JP6143133A JP14313394A JP2832330B2 JP 2832330 B2 JP2832330 B2 JP 2832330B2 JP 6143133 A JP6143133 A JP 6143133A JP 14313394 A JP14313394 A JP 14313394A JP 2832330 B2 JP2832330 B2 JP 2832330B2
Authority
JP
Japan
Prior art keywords
program
remodeling
sentence
function
variable
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 - Lifetime
Application number
JP6143133A
Other languages
Japanese (ja)
Other versions
JPH0816381A (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.)
Ei Tei Aaru Tsushin Shisutemu Kenkyusho Kk
Original Assignee
Ei Tei Aaru Tsushin Shisutemu Kenkyusho Kk
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 Ei Tei Aaru Tsushin Shisutemu Kenkyusho Kk filed Critical Ei Tei Aaru Tsushin Shisutemu Kenkyusho Kk
Priority to JP6143133A priority Critical patent/JP2832330B2/en
Publication of JPH0816381A publication Critical patent/JPH0816381A/en
Application granted granted Critical
Publication of JP2832330B2 publication Critical patent/JP2832330B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】この発明は、ソフトウェア改造支
援装置および方法に関し、特に、非改造機能に影響を与
えず、かつ、非改造部分からも影響を受けずに、改造対
象機能について改造を行なうことができるようなソフト
ウェア改造支援装置および方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a software remodeling support apparatus and method, and more particularly to remodeling a function to be remodeled without affecting a non-modification function and without being affected by a non-modification part. The present invention relates to an apparatus and a method for supporting software remodeling.

【0002】[0002]

【従来の技術】従来より、プログラム内で実現されてい
る任意の機能(出力される値など)に対して、その機能
について計算している部分をプログラム内から抽出する
スライス技術が応用されて、ソフトウェアの改造が支援
されている。ある出力文Sに関するスライスとは、以下
に示すデータ依存関係と制御依存関係を辿って、文Sに
到達するすべての文の集合である。
2. Description of the Related Art Conventionally, a slicing technique for extracting a part calculated for a function (an output value or the like) from an arbitrary function implemented in a program from the program has been applied. Software remodeling is supported. The slice relating to a certain output sentence S is a set of all the sentences that reach the sentence S following the data dependency and the control dependency shown below.

【0003】データ依存関係について説明する。たとえ
ば文S1から文S2へのデータ依存関係があるとは、文
S1におけるある変数vの定義が変数vを使用している
文Sへ到達する場合である。すなわち、文S1で変数v
の値が設定されて、文S1から文S2に至るパスで変数
vの値が再設定されないものがあり、文S2で変数vの
値が参照される場合である。
[0003] The data dependency will be described. For example, the data dependency from the statement S1 to the statement S2 means that the definition of a certain variable v in the statement S1 reaches the statement S using the variable v. That is, the variable v
Is set and the value of the variable v is not reset in the path from the sentence S1 to the sentence S2, and the value of the variable v is referred to in the sentence S2.

【0004】次に、制御依存関係について説明する。た
とえば文S1から文S2への制御依存関係があるとは、
文S1は制御文(分岐文など)であり、文S1の制御移
行結果が文S2の実行の有無を決定する場合である。
Next, the control dependency will be described. For example, there is a control dependency from the statement S1 to the statement S2.
The statement S1 is a control statement (such as a branch statement), in which case the result of control transfer of the statement S1 determines whether to execute the statement S2.

【0005】改造対象機能のスライスが求められれば、
プログラム内で改造対象機能について計算している部分
がわかるため、改造作業が容易になる。
If a slice of the function to be remodeled is required,
Since the part of the program that calculates the function to be remodeled is known, the remodeling work is facilitated.

【0006】また、ソフトウェアを改造する場合には、
改造対象でない部分に影響を与えないように改造を行な
うことが重要である。
[0006] When modifying software,
It is important to make modifications so as not to affect parts that are not to be modified.

【0007】図7は、従来のソフトウェア改造支援装置
の概略ブロック図である。図7を参照して、従来のソフ
トウェア改造支援装置1は、改造対象でない部分に影響
を与えないように改造するため、スライス獲得部3と、
改造制御部5とを備えていた。スライス獲得部3は、改
造前のプログラム7から、改造対象機能について計算し
ている部分(改造対象機能のスライス)および非改造機
能について計算している部分(非改造機能のスライス)
を抽出する。改造制御部5は、非改造機能のスライスに
影響を与えないように、改造対象機能のスライスの改造
を行なう。これによって、改造後のプログラム9が作成
される。
FIG. 7 is a schematic block diagram of a conventional software remodeling support device. Referring to FIG. 7, a conventional software remodeling support device 1 includes a slice acquisition unit 3 for remodeling so as not to affect a part that is not a remodeling target.
And a modification control unit 5. The slice obtaining unit 3 calculates, from the program 7 before remodeling, a part for calculating the remodeling target function (slice of the remodeling target function) and a part for calculating the non-remodeling function (slice of the non-remodeling function).
Is extracted. The modification control unit 5 modifies the slice of the modification target function so as not to affect the slice of the non-modification function. Thereby, the program 9 after the modification is created.

【0008】図8は、改造前のプログラムの一例を示し
た図であり、図9は、図8のプログラムを改造するため
に、スライスについて説明するための図であり、図10
は、改造後のプログラムの一例を示した図である。
FIG. 8 is a diagram showing an example of a program before remodeling. FIG. 9 is a diagram for explaining slices for remodeling the program of FIG.
FIG. 3 is a diagram showing an example of a program after remodeling.

【0009】図8を参照して、改造前のプログラム7
は、4つの点A,B,C,Dが与えられた場合に、変数
sl,dが求められることを示したプログラムである。
文1から文4までは、点A=(ax,ay)、点B=
(bx,by)、点C=(cx,cy)、点D=(d
x,dy)が得られることをそれぞれ示している。文5
および文6は、ベクトルABのx成分およびy成分をそ
れぞれ示している。文7および文8は、ベクトルCDの
x成分およびy成分をそれぞれ示している。文9および
分13は、ベクトルABおよびベクトルCDの長さをそ
れぞれ示している。文10および文11は、ベクトルA
BとベクトルCDとの合成ベクトルのx成分およびy成
分をそれぞれ示している。文12は、ベクトルABとベ
クトルCDとの合成ベクトルの長さを示している。文1
4は、ベクトルABの長さとベクトルCDの長さの和を
示している。
Referring to FIG. 8, program 7 before remodeling is performed.
Is a program showing that variables sl and d are obtained when four points A, B, C and D are given.
From sentence 1 to sentence 4, point A = (ax, ay), point B =
(Bx, by), point C = (cx, cy), point D = (d
x, dy) are obtained. Statement 5
And sentence 6 show the x and y components of the vector AB, respectively. Sentences 7 and 8 show the x and y components of the vector CD, respectively. Sentence 9 and minute 13 indicate the lengths of vector AB and vector CD, respectively. Sentence 10 and sentence 11 are vectors A
The x and y components of the combined vector of B and vector CD are shown, respectively. Statement 12 indicates the length of the combined vector of vector AB and vector CD. Sentence 1
4 indicates the sum of the length of the vector AB and the length of the vector CD.

【0010】このような文1から文14によって、文1
5に示される変数slはベクトルABの長さとベクトル
CDの長さの和で設定され、その値が出力される。同様
に、文1から文14によって、文16に示される変数d
はベクトルABとベクトルCDの合成ベクトルの長さと
して設定され、その値が出力される。
The sentence 1 to the sentence 14 form the sentence 1
The variable sl shown in 5 is set by the sum of the length of the vector AB and the length of the vector CD, and the value is output. Similarly, the variable d shown in the sentence 16 by the sentence 1 to the sentence 14
Is set as the length of the combined vector of the vector AB and the vector CD, and the value is output.

【0011】次に、変数slの値が求められる代わり
に、ベクトルABとベクトルCDを2辺とする平行四辺
形の面積areaが求められるように、プログラム7が
改造される場合について説明する。
Next, a case will be described in which the program 7 is modified so that the area of a parallelogram having two sides of the vector AB and the vector CD is obtained instead of obtaining the value of the variable sl.

【0012】図9を参照して、改造前のプログラム7に
おいて、変数slの値が出力されることを示す文15に
関してのスライスは、文1〜文9,文13,文14,文
15である。すなわち、文10〜文12および文16以
外が文15に関してのスライスである。このような文1
5に関してのスライス部分が修正されて、面積area
が求められるように改造が行なわれる。改造する上で、
非改造機能である文16に関してのスライスに影響が与
えられてはいけない。そのため、非改造機能のスライス
である文1〜文8,文10〜文12,文16の修正は禁
止され、かつ、非改造スライスで使用されている変数が
定義されるような文の挿入も禁止される。
Referring to FIG. 9, in program 7 before modification, slices relating to statement 15 indicating that the value of variable sl is to be output are sentence 1 to sentence 9, sentence 13, sentence 14, and sentence 15. is there. That is, slices other than the sentences 10 to 12 and the sentence 16 are slices related to the sentence 15. Such a sentence 1
The slice part for the area 5 is modified to have the area area
Modifications are made as required. In remodeling,
Slices for sentence 16, which is a non-modification function, must not be affected. Therefore, modification of the non-modifying function slices 1 to 8, statement 10 to statement 12, and statement 16 is prohibited, and insertion of a statement that defines a variable used in the non-modifying slice is also prohibited. It is forbidden.

【0013】改造後のプログラム9の一例が図10に示
されている。文14,文15が削除され、文R1,文R
2が挿入されている。文R1は、ベクトルABとベクト
ルCDを2辺とする平行四辺形の面積areaを示して
いる。文R2は、設定された変数areaの値が出力さ
れることを示している。改造機能である文R2に関して
のスライス部分は、文1〜9,13,R1,R2であ
り、この改造により、面積areaの値が正しく計算さ
れている。また、この改造は、文16に示される変数d
を出力する非改造機能には影響を与えていない。すなわ
ち、文16に示される変数dのその値は、改造前のプロ
グラム実行と全く同じプログラム実行によって出力され
る。
FIG. 10 shows an example of the program 9 after the modification. Statements 14 and 15 are deleted, and statements R1 and R
2 has been inserted. The sentence R1 indicates an area area of a parallelogram having the vector AB and the vector CD as two sides. The statement R2 indicates that the value of the set variable area is output. The slice portion relating to the sentence R2, which is a remodeling function, is sentences 1 to 9, 13, R1, and R2, and the value of the area area is correctly calculated by the remodeling. This remodeling is performed by using the variable d
Does not affect the non-modification function that outputs. That is, the value of the variable d shown in the statement 16 is output by executing the same program as the program before the modification.

【0014】[0014]

【発明が解決しようとする課題】しかしながら、改造さ
れた文R1で使用されている変数vx,vyについて
は、非改造機能のスライス(文1〜文8,文10,文1
1,文12,文16)内で定義されているため、文5,
文6で定義した値が使用されるのではなく、文10,文
11で定義された値が使用されてしまう。したがって、
文R1は、面積areaを正しく計算しない。このよう
に、非改造機能には影響を与えないように改造機能に関
してのスライスを改造できたが、逆に、非改造機能のス
ライスから改造部分(文R1,文R2)が影響を受けて
しまうという問題がある。
However, regarding the variables vx and vy used in the modified statement R1, the slices of the non-modified function (statements 1 to 8, statement 10, statement 1)
1, sentence 12, sentence 16), the sentence 5,
Instead of using the value defined in statement 6, the values defined in statements 10 and 11 are used. Therefore,
The statement R1 does not correctly calculate the area area. As described above, the slice relating to the remodeling function could be remodeled so as not to affect the non-remodeling function. Conversely, the remodeling portion (sentence R1, sentence R2) is affected by the slice of the non-modification function. There is a problem.

【0015】ゆえに、本発明の目的は、非改造機能には
影響を与えず、かつ、改造部分が非改造部分から影響を
受けることがないようなソフトウェア改造支援装置およ
び方法を提供することである。
SUMMARY OF THE INVENTION It is therefore an object of the present invention to provide a software remodeling support apparatus and method which does not affect the non-modification function and does not affect the remodeled part from the non-remodeled part. .

【0016】[0016]

【課題を解決するための手段】請求項1の発明に係るソ
フトウェア改造支援装置は、ソフトウェアのプログラム
を改造するソフトウェア改造支援装置であって、改造対
象機能について計算している第1のプログラム部分およ
び非改造機能について計算している第2のプログラム部
分のそれぞれをプログラムから抽出する抽出手段と、抽
出手段によって抽出された第1のプログラム部分を抽出
された第2のプログラム部分に与える影響を排除しつつ
改造する改造手段と、改造された第1のプログラム部分
が抽出された第2のプログラム部分から受ける影響を除
去する影響除去手段とを備えて構成される。
According to a first aspect of the present invention, there is provided a software remodeling support apparatus for remodeling a software program, the first program part calculating a function to be remodeled, and Extraction means for extracting each of the second program parts calculated for the non-modification function from the program, and eliminating the influence of the first program parts extracted by the extraction means on the extracted second program parts. It comprises a remodeling means for remodeling while remodeling, and an influence removing means for removing the influence of the remodeled first program part from the extracted second program part.

【0017】請求項2の発明に係るソフトウェア改造支
援装置では、請求項1の第1のプログラム部分は第1の
固有部分と共通部分とを含み、第2のプログラム部分は
第2の固有部分と前記共通部分とを含み、改造手段は第
1の固有部分を改造し、影響除去手段は改造された第1
の固有部分に含まれる変数が第2の固有部分において定
義し直されていることに応じて、共通部分に変数に代え
て新たな変数を再定義して第1の固有部分が共通部分か
ら受ける影響を除去する。
According to a second aspect of the present invention, the first program portion includes a first unique portion and a common portion, and the second program portion includes a second unique portion. And the modification means modifies the first unique part, and the influence removing means modifies the modified first part.
Is redefined in the second eigenpart, a new variable is redefined instead of the variable in the eigenpart, and the first eigenpart receives from the common part Eliminate the effects.

【0018】請求項3に係る発明は、ソフトウェアのプ
ログラムを改造するソフトウェア改造支援装置の処理
法であって、改造対象機能について計算している第1の
プログラム部分および非改造機能について計算している
第2のプログラム部分のそれぞれを獲得手段を用いて
ログラムから抽出し、抽出された第1のプログラム部分
改造手段を用いて第1のステップで抽出された第2の
プログラム部分に与える影響を排除しつつ改造し、改造
された第1のプログラム部分が第1のステップで抽出さ
れた第2のプログラム部分から受ける影響を影響除去手
段によって除去する。
According to a third aspect of the present invention, there is provided a processing method of a software remodeling support apparatus for remodeling a software program, wherein a first program part calculating a function to be remodeled and a non-modification function are calculated. Each of the second program parts that are calculated for are extracted from the program using the acquisition means, and the extracted first program parts are extracted in the first step using the modification means . the effect on the second program part modified while eliminating, remodeled first second influence the effect removal hand received from program parts which the program part is extracted in the first step
It removed by stage.

【0019】[0019]

【作用】請求項1の発明に係るソフトウェア改造支援装
置は、抽出手段が改造対象機能について計算している第
1のプログラム部分および非改造機能について計算して
いる第2のプログラム部分のそれぞれを抽出し、改造手
段が抽出手段によって抽出された第1のプログラム部分
を、第2のプログラム部分に与える影響を排除しつつ改
造し、影響除去手段が改造手段によって改造された第1
のプログラム部分が抽出手段によって抽出された第2の
プログラム部分から受ける影響を除去し、ソフトウェア
のプログラムを改造する。
According to a first aspect of the present invention, there is provided a software remodeling support apparatus for extracting a first program part calculated for a function to be remodeled and a second program part calculated for a non-remodeled function. The modifying means modifies the first program portion extracted by the extracting means while eliminating the influence on the second program portion, and the influence removing means modifies the first program portion by the modifying means.
Of the second program part extracted by the extracting means, and remodeling the software program.

【0020】請求項2の発明に係るソフトウェア改造支
援装置は、改造手段が第1のプログラム部分に含まれる
第1の固有部分を改造し、改造された第1の固有部分に
含まれる変数が第2の固有部分において定義し直されて
いることに応じて、共通部分に変数に代えて新たな変数
を再定義して第1の固有部分が共通部分から受ける影響
を除去する。
According to a second aspect of the present invention, in the software remodeling support device, the remodeling means remodels the first unique part included in the first program part, and the variable included in the remodeled first unique part is the first unique part. In response to the re-definition in the second unique part, a new variable is redefined in place of the variable in the common part to remove the influence of the first unique part from the common part.

【0021】請求項3の発明に係るソフトウェア改造支
装置の処理方法は、改造対象機能について計算してい
る第1のプログラム部分および非改造機能について計算
している第2のプログラム部分のそれぞれをプログラム
から抽出し、抽出された第1のプログラム部分を、抽出
された第2のプログラム部分に与える影響を排除しつつ
改造し、改造された第1のプログラム部分が抽出された
第2のプログラム部分から受ける影響を除去してソフト
ウェアのプログラムを改造する。
According to a third aspect of the present invention, there is provided a processing method of a software remodeling support apparatus, wherein a first program part calculating for a function to be remodeled and a second program part calculating for a non-remodeling function are programmed. And remodeling the extracted first program portion while eliminating the influence on the extracted second program portion, and reconstructing the reconstructed first program portion from the extracted second program portion. Modify the software program to remove the effects.

【0022】[0022]

【実施例】図1は、この発明の一実施例によるソフトウ
ェア改造支援装置の概略ブロック図であり、図2は、図
1に示したソフトウェア改造支援装置の動作を説明する
ためのフローチャートである。
FIG. 1 is a schematic block diagram of a software remodeling support device according to one embodiment of the present invention, and FIG. 2 is a flowchart for explaining the operation of the software remodeling support device shown in FIG.

【0023】図3は、図7に示した改造前のプログラム
が図1に示したソフトウェア改造支援装置によって改造
された後のプログラムの一例を示した図である。
FIG. 3 is a diagram showing an example of a program after the program before remodeling shown in FIG. 7 is remodeled by the software remodeling support device shown in FIG.

【0024】図1を参照して、この実施例のソフトウェ
ア改造支援装置21は、スライス獲得部3と、改造制御
部5とを含み、さらに影響除去部23とを含む。スライ
ス獲得部3および改造制御部5は、従来例と同様であ
り、影響除去部23が本装置で新たに加わった構成であ
る。
Referring to FIG. 1, the software remodeling support device 21 of this embodiment includes a slice obtaining unit 3, a remodeling control unit 5, and further includes an influence removing unit 23. The slice acquisition unit 3 and the modification control unit 5 are the same as in the conventional example, and have a configuration in which the influence removing unit 23 is newly added in the present apparatus.

【0025】図2に示すように、スライス獲得部3は、
ステップ(図面ではSで表わす)1に含まれるステップ
11において改造対象機能Aについて計算している部分
(改造対象機能のスライス)を求めて、SA とし、プロ
グラムから抽出する。さらにスライス獲得部3は、非改
造機能Bについて計算している部分(非改造対象機能の
スライス)を求めて、SB とし、プログラムから抽出す
る。図8に示す改造前のプログラム7においては、前述
したように改造対象機能のスライスSA は、文1〜文
9,文13〜文15であり、非改造機能のスライスSB
は、文1〜文8,文10〜文12,文16である。ここ
で、改造対象機能のスライスSA は、固有部分(文9,
文13〜文15)と、非改造機能のスライスSB と共通
の共通部分(文1〜文8)とを含んでいる。同様に、非
改造機能のスライスSB も固有部分(文10〜文12,
文16)と、改造対象機能のスライスSA に共通の共通
部分(文1〜文8)とを含んでいる。
As shown in FIG. 2, the slice acquiring unit 3
In step 11 included in step (represented by S in the drawing), a part (slice of the function to be remodeled) calculated for the function to be remodeled A is obtained, and is extracted as S A from the program. Further slice acquisition unit 3, seeking moiety that is calculated for the non-modified function B (slices of the non-modified object function), and S B, extracted from the program. In the program 7 before remodeling shown in FIG. 8, as described above, the slices S A of the function to be remodeled are sentence 1 to sentence 9 and sentence 13 to sentence 15, and the slice S B of the non-remodeled function.
Are statements 1 to 8, statements 10 to 12, and statement 16. Here, the slice S A of the function to be remodeled is a unique part (statement 9,
A statement 13 to statement 15), and a slice S B a common intersection of the non-modified function (statement 1 to statement 8). Similarly, slice S B also specific portion of the non-modified function (statement 10 statement 12,
A statement 16), and a common intersection slice S A remodeled object function (statement 1 to statement 8).

【0026】したがって、改造制御部5は、図2に示す
ステップ2に含まれるステップ21において、独立部分
I(=SA −SB )を求める。この独立部分Iは、改造
対象機能のスライスSA の固有部分に対応し、文9,文
13〜文15である。そして、改造制御部5は、図2に
示すステップ22において非改造機能のスライスSB
影響を与えないような、改造機能のスライスの改造のみ
を許可する。すなわち、改造制御部5は、非改造機能の
スライスに含まれる文の修正、および非改造機能のスラ
イスで使用されている変数を定義する文の挿入を禁止す
るとともに、独立部分Iを改造する。
Therefore, the modification control unit 5 obtains an independent part I (= S A -S B ) in step 21 included in step 2 shown in FIG. This independent part I corresponds to a unique portion of the slice S A remodeled object function, statement 9, a statement 13 to statement 15. The modified control unit 5, which does not affect the slice S B of the non-modified function in step 22 shown in FIG. 2, only allow reconstruction slice of the reconstruction function. That is, the remodeling control unit 5 prohibits modification of a sentence included in the slice of the non-modification function, insertion of a statement defining a variable used in the slice of the non-modification function, and remodels the independent part I.

【0027】影響除去部23は、ステップ3において改
造された独立部分Iが非改造機能BのスライスSB から
受ける影響を除去する。
The effects removal unit 23, revamped independent part I in step 3 to remove the influence from the slice S B of the non-modified functional B.

【0028】図10に示すように文R1で使用されてい
る変数vx,vyは、非改造機能のスライスSB の固有
部分(文10〜文12,文16)である集合C(=SB
−S A )内の文で定義されているため、集合SA 内の文
で定義された値を使用できない。そこで、変数vx,v
yを定義している集合SA 内の文5,文6の直後に、各
々、文A1“vx 1:=vx;”,文A2“vy
2:=vy;”を挿入する。さらに、文R1で使用され
ている変数vx,vyが、各々vx 1,vy 2に変更
される。最後に、新たに導入した変数vx 1,vy
2の各々が、変数vx,vyの直後に挿入されて、図3
に示すような改造後のプログラム25が作成される。
[0028] As shown in FIG.
Variables vx and vy are the slices S of the non-modified function.BUnique
Set C (= S) which is a part (sentence 10 to sentence 12, sentence 16)B
-S A), The set SAStatement in
Cannot use the value defined in. Therefore, the variables vx, v
the set S defining yAImmediately after sentence 5 and sentence 6 in
Each sentence A1 “vx 1: = vx; ", sentence A2" vy
2: = vy; ". Also used in sentence R1
Variables vx and vy are vx 1, vy Change to 2
Is done. Finally, the newly introduced variable vx 1, vy
2 are inserted immediately after the variables vx and vy, and FIG.
A modified program 25 is created as shown in FIG.

【0029】図4および図5は、図2のステップ3の詳
細なフローチャートである。次に、図4および図5を用
いて、図2に示したステップ3について詳しく説明す
る。ステップ301において、独立部分Iに挿入した独
立変数へ値を設定する代入文の集合がSとされる。ここ
で、独立変数とは、非改造のスライスSB で使用されて
ない変数を意味する。したがって、たとえば図10にお
ける集合Sは、文R1,文R2となる。ステップ302
において、集合CがSB −SA として求められる。この
集合Cは、たとえば図10の文10〜文12,文16で
ある。
FIGS. 4 and 5 are detailed flowcharts of step 3 in FIG. Next, step 3 shown in FIG. 2 will be described in detail with reference to FIGS. In step 301, a set of assignment statements for setting values to the independent variables inserted in the independent part I is set to S. Here, the independent variable, means a variable that has not been used in slices S B of the non-modified. Therefore, for example, the set S in FIG. 10 is a sentence R1 and a sentence R2. Step 302
, The set C is obtained as S B -S A. The set C is, for example, sentences 10 to 12, and 16 in FIG.

【0030】ステップ303において、処理のための変
数noが0とされる。ステップ304において、集合S
から文sが1つ取出される。たとえば、文sは、図10
の文R1である。ステップ305において、文sをすべ
て取出したか否かが判定される。すべて取出された場合
はαを介して処理が終了する。これに対し文sが取出さ
れてない場合には、ステップ306において集合Use
(s)から変数wが1つ取出される。ここで、集合Us
e(s)は、文sで使用されている変数の集合を表わ
す。たとえば、文sが図10の文R1の場合には、集合
Use(s)は、{vl,wl,vx,wx,vy,w
y}であり、変数wはたとえばvxである。続けて、ス
テップ307において、変数wがすべて取出されたか否
か判定される。変数がすべて取出された場合にはステッ
プ304に戻り、変数がすべて取出されてない場合には
ステップ308に進む。
In step 303, the variable no for processing is set to 0. In step 304, the set S
, One sentence s is extracted. For example, the sentence s is shown in FIG.
Is the sentence R1. In step 305, it is determined whether all the sentences s have been fetched. If all are taken out, the process is terminated via α. On the other hand, if the sentence s has not been extracted, the set Use
One variable w is extracted from (s). Where the set Us
e (s) represents a set of variables used in the sentence s. For example, when the sentence s is the sentence R1 in FIG. 10, the set Use (s) is represented by {vl, wl, vx, wx, vy, w
y}, and the variable w is, for example, vx. Subsequently, in step 307, it is determined whether or not all the variables w have been extracted. If all the variables have been extracted, the process returns to step 304; otherwise, the process proceeds to step 308.

【0031】次に、ステップ308において、文sに到
達する変数wの定義が集合C内に存在するか否か判定さ
れる。ここで、文tにおける変数wの定義が文sに到達
するとは、文tで変数wの値が設定されており、かつ、
文tから文sに至るパスが存在し、そのパスの中で変数
wの値が再設定されない場合をいう。たとえば、図6
(a)に示すように、文1がget(x,y);、文2
がmax:=x;、文3がif x<y then、文
4がmax:=y;、文4と文5との間にendi
f;、文5がput(max);の場合には、文2にお
けるmaxの定義は文5に到達している。すなわち、図
6(b)に示すように、文2→文3→文5というパスが
存在し、そのパスの中ではmaxの値が再設定されてい
ない。このような場合が文tにおける変数wの定義や文
sに到達すると呼ばれる。そして、ステップ308にお
ける文sに到達する変数wの定義が集合C内に存在しな
い場合にはステップ306に戻り、存在する場合にはス
テップ309に進む。図10の場合には、変数wとして
のvxを定義する文10が存在するため、ステップ30
9に進む。ステップ309において、SA 内の文で、文
sに到達する変数wの定義をすべて求めて、その集合が
Dとされる。たとえば、文sが文R1とされて、変数w
が変数vxとされた場合には、集合Dは、文5である。
Next, in step 308, it is determined whether or not the definition of the variable w that reaches the sentence s exists in the set C. Here, the definition of the variable w in the sentence t reaches the sentence s means that the value of the variable w is set in the sentence t, and
This refers to a case where a path from the statement t to the statement s exists, and the value of the variable w is not reset in the path. For example, FIG.
As shown in (a), sentence 1 is get (x, y);
Is max: = x; sentence 3 is if x <y then, sentence 4 is max: = y; and endi is between sentence 4 and sentence 5.
f ;, if sentence 5 is put (max) ;, the definition of max in sentence 2 has reached sentence 5. That is, as shown in FIG. 6B, there is a path of sentence 2 → sentence 3 → sentence 5, and the value of max is not reset in that path. Such a case is called to reach the definition of the variable w in the sentence t or the sentence s. If the definition of the variable w that reaches the sentence s in step 308 does not exist in the set C, the process returns to step 306, and if it does, the process proceeds to step 309. In the case of FIG. 10, there is a statement 10 that defines vx as a variable w, so that step 30
Go to 9. In step 309, all the definitions of the variables w that reach the sentence s are obtained from the sentences in S A , and the set is set to D. For example, a sentence s is set as a sentence R1 and a variable w
Is the variable vx, the set D is sentence 5.

【0032】次に、ステップ309は、βを介してステ
ップ310に進む。ステップ310において、処理のた
めの変数noに1加算される。ステップ303において
no=0であったので、ステップ310において、no
=1とされる。ステップ311において、集合Dから文
dが1つ取出される。たとえば、文dは文5である。
Next, step 309 proceeds to step 310 via β. In step 310, 1 is added to the variable no for processing. Since no = 0 in step 303, in step 310, no
= 1. In step 311, one sentence d is extracted from the set D. For example, sentence d is sentence 5.

【0033】ステップ312において、文dがすべて取
出されたか否か判定される。すべて取出せない場合には
ステップ313に進み、すべて取出された場合にはステ
ップ314に進む。ステップ313において、文dの直
後に、文“w Val(no):=w;”が挿入され
る。ここで、Val(no)とは、変数noの値が文字
形式で展開されたものを指す。たとえば、no=1の場
合には、w Val(no)は、w 1を表わす。した
がって、たとえば、図3の文5の直後に、A1“vx
1:=vx;”が挿入される。ステップ313の後はス
テップ311に戻り、ステップ312での判定が行なわ
れる。文dがすべて取出されたので、ステップ314に
おいて、文sが使用している変数wがw Val(n
o)に変更される。たとえば、文R1が使用している変
数vxが、vx 1に変更される。ステップ315にお
いて、変数w Val(no)の宣言が、変数変数wの
宣言の直後に挿入される。たとえば、変数vx 1の宣
言が、変数vxの宣言の直後に図3の上から3行目のよ
うに挿入される。そして、ステップ315から、γを介
してステップ306に戻って、ループ処理が行なわれ
る。
At step 312, it is determined whether or not all the sentences d have been fetched. If all of them cannot be taken out, the process proceeds to step 313. If all of them have been taken out, the process proceeds to step 314. In step 313, immediately after the sentence d, the sentence "w Val (no): = w; "is inserted. Here, Val (no) indicates a value obtained by expanding the value of the variable no in a character format. For example, if no = 1, w Val (no) is w Represents 1. Therefore, for example, immediately after sentence 5 in FIG. 3, A1 “vx
1: = vx; "is inserted. After step 313, the process returns to step 311 to make a determination in step 312. Since all the sentences d have been extracted, the sentence s is used in step 314. Variable w is w Val (n
o). For example, the variable vx used by the statement R1 is vx It is changed to 1. In step 315, the variable w The declaration of Val (no) is inserted immediately after the declaration of the variable w. For example, the variable vx The declaration of 1 is inserted immediately after the declaration of the variable vx as shown in the third line from the top in FIG. Then, the process returns from step 315 to step 306 via γ to perform a loop process.

【0034】このように、この実施例によるソフトウェ
ア改造支援装置は、非改造機能には影響を与えず、か
つ、改造部分が非改造部分から影響を与えないように改
造を行なう。したがって、従来例のソフトウェア改造支
援装置に比べて、改造対象機能について計算している部
分である改造対象機能のスライスにだけ着目して改造作
業を進めることができる。さらに、改造機能の試験もプ
ログラム全体に対して行なうのではなく、改造対象機能
のスライスに対して行なえばよいという利点が得られ
る。
As described above, the software remodeling support device according to the present embodiment performs remodeling so that the non-modification function is not affected and the remodeled portion is not affected by the non-modified portion. Therefore, compared to the conventional software remodeling support device, the remodeling work can be advanced by focusing only on the slice of the remodeling target function, which is a part for calculating the remodeling target function. Furthermore, there is an advantage that the test of the remodeling function is performed not on the entire program but on the slice of the remodeling target function.

【0035】[0035]

【発明の効果】以上のように、この発明によれば、改造
対象機能に関連する第1のプログラム部分を、非改造機
能に関連する第2のプログラム部分に与える影響を排除
しつつ改造し、改造された第1のプログラム部分が第2
のプログラム部分から受ける影響を除去することによ
り、第1のプログラム部分にのみ着目して改造作業を行
なうことができる。
As described above, according to the present invention, the first program portion related to the function to be remodeled is remodeled while eliminating the influence on the second program portion related to the non-remodeling function. The modified first program part is the second
By removing the influence of the program portion, the remodeling work can be performed by focusing only on the first program portion.

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

【図1】この発明の一実施例によるソフトウェア改造支
援装置の概略ブロック図である。
FIG. 1 is a schematic block diagram of a software remodeling support device according to an embodiment of the present invention.

【図2】図1に示したソフトウェア改造支援装置の動作
を説明するためのフローチャートである。
FIG. 2 is a flowchart for explaining the operation of the software remodeling support device shown in FIG.

【図3】図1に示す改造後のプログラムの一例を示した
図である。
FIG. 3 is a diagram showing an example of a program after the modification shown in FIG. 1;

【図4】図2のステップ3の第1の詳細なフローチャー
トである。
FIG. 4 is a first detailed flowchart of step 3 in FIG. 2;

【図5】図2のステップ3の第2の詳細なフローチャー
トである。
FIG. 5 is a second detailed flowchart of step 3 in FIG. 2;

【図6】文tにおける変数wの定義が文sに到達するこ
とを説明するための図である。
FIG. 6 is a diagram for explaining that a definition of a variable w in a sentence t reaches a sentence s.

【図7】従来のソフトウェア改造支援装置の概略ブロッ
ク図である。
FIG. 7 is a schematic block diagram of a conventional software remodeling support device.

【図8】図7の改造前のプログラムの一例を示した図で
ある。
FIG. 8 is a diagram showing an example of a program before remodeling of FIG. 7;

【図9】プログラムの改造を説明するために、スライス
について説明するための図である。
FIG. 9 is a diagram for explaining a slice in order to explain a program modification.

【図10】図7の改造の後のプログラムの一例を示した
図である。
FIG. 10 is a diagram showing an example of a program after the modification of FIG. 7;

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

21 ソフトウェア改造支援装置 3 スライス獲得部 5 改造制御部 23 影響除去部 21 Software Remodeling Support Device 3 Slice Acquisition Unit 5 Remodeling Control Unit 23 Effect Removal Unit

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 ソフトウェアのプログラムを改造するソ
フトウェア改造支援装置であって、 改造対象機能について計算している第1のプログラム部
分および非改造機能について計算している第2のプログ
ラム部分のそれぞれを前記プログラムから抽出する抽出
手段と、 前記抽出手段によって抽出された第1のプログラム部分
を、前記抽出手段によって抽出された第2のプログラム
部分に与える影響を排除しつつ改造する改造手段と、 前記改造された第1のプログラム部分が前記抽出手段に
よって抽出された第2のプログラム部分から受ける影響
を除去する影響除去手段とを備えた、ソフトウェア改造
支援装置。
1. A software remodeling support device for remodeling a software program, wherein a first program part calculating for a function to be remodeled and a second program part calculating for a non-remodeling function are respectively converted into the first program part and the second program part. Extracting means for extracting from the program; modifying means for modifying the first program portion extracted by the extracting means while eliminating an influence on the second program portion extracted by the extracting means; An effect removing unit for removing an influence of the first program part on the second program part extracted by the extracting unit.
【請求項2】 前記第1のプログラム部分は、第1の固
有部分と共通部分とを含み、 前記第2のプログラム部分は、第2の固有部分と前記共
通部分とを含み、 前記改造手段は、前記第1の固有部分を改造し、 前記影響除去手段は、前記改造された第1の固有部分に
含まれる変数が前記第2の固有部分において定義し直さ
れていることに応じて、前記共通部分に前記変数に代え
て新たな変数を再定義して前記第1の固有部分が前記共
通部分から受ける影響を除去する、請求項1記載のソフ
トウェア改造支援装置。
2. The first program portion includes a first unique portion and a common portion; the second program portion includes a second unique portion and the common portion; , Modifying the first unique portion, the influence removing means may determine that the variable included in the modified first unique portion is redefined in the second unique portion, 2. The software remodeling support device according to claim 1, wherein a new variable is redefined in place of the variable in a common portion to remove the influence of the first unique portion from the common portion.
【請求項3】 ソフトウェアのプログラムを改造するソ
フトウェア改造支援装置の処理方法であって、 改造対象機能について計算している第1のプログラム部
分および非改造機能について計算している第2のプログ
ラム部分のそれぞれを獲得手段を用いて前記プログラム
から抽出する第1のステップと、 前記第1のステップで抽出された第1のプログラム部分
を、改造手段を用いて前記第1のステップで抽出された
第2のプログラム部分に与える影響を排除しつつ改造す
る第2のステップと、 前記改造された第1のプログラム部分が前記第1のステ
ップで抽出された第2のプログラム部分から受ける影響
影響除去手段によって除去する第3のステップとを含
む、ソフトウェア改造支援装置の処理方法。
3. A processing method of a software remodeling support device for remodeling a software program, comprising: a first program part calculating for a function to be remodeled; and a second program part calculating for a non-remodeling function. A first step of extracting each of them from the program by using the acquiring means, and a second program part of the first program extracted in the first step by using the remodeling means . A second step of remodeling while eliminating the effect on the program part of the second step, and an influence removing means for effecting the remodeled first program part from the second program part extracted in the first step by an influence removing means. And a third step of removing, the processing method of the software remodeling support device .
JP6143133A 1994-06-24 1994-06-24 Software remodeling support apparatus and method Expired - Lifetime JP2832330B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6143133A JP2832330B2 (en) 1994-06-24 1994-06-24 Software remodeling support apparatus and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6143133A JP2832330B2 (en) 1994-06-24 1994-06-24 Software remodeling support apparatus and method

Publications (2)

Publication Number Publication Date
JPH0816381A JPH0816381A (en) 1996-01-19
JP2832330B2 true JP2832330B2 (en) 1998-12-09

Family

ID=15331691

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6143133A Expired - Lifetime JP2832330B2 (en) 1994-06-24 1994-06-24 Software remodeling support apparatus and method

Country Status (1)

Country Link
JP (1) JP2832330B2 (en)

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
「情報処理」Vol.33,No.9(1992−9)P.1078−1086
「電子情報通信学会技術研究報告」Vol.93,No.244(1993−9)P.33−40

Also Published As

Publication number Publication date
JPH0816381A (en) 1996-01-19

Similar Documents

Publication Publication Date Title
JP2832330B2 (en) Software remodeling support apparatus and method
JP2001044412A (en) Semiconductor simulation apparatus
JP3115042B2 (en) Program resynthesis processing unit when parts are changed
JPH02191038A (en) Compiler input data editing system
JPH06119203A (en) Debugging line deleting device
JP2595815B2 (en) Program correction amount judgment processing device
JP2002082811A (en) Compiling method and recording medium
JPH03235135A (en) Automatic inspection system for program
JPH11327887A (en) Compiler system with automatic parts converting function and recording medium
JPH07319732A (en) Test coverage measuring method
JPH04161869A (en) Program converting method for generating test pattern
JPH0895763A (en) Method for fetching component program in original program
JPH07141178A (en) Object accessing device
JPH0573335A (en) Automatic in-line development system for program
JPH04373020A (en) Function correspondence table preparing device
JPH08166980A (en) Logic circuit simulation method
JPH01287486A (en) Test pattern program generating device
JPH05313910A (en) Machine word instruction generating system
JPH0319041A (en) Automatic control system for control item
JPH04364537A (en) Method, device, and compiler for optimizing program for parallel process
JPH04274518A (en) Device for preparing picture signal processing program by dsp
JPH0580992A (en) Output system for procedure-function relation chart
JPH11353206A (en) Test support system
JPH05100829A (en) Compiling unit management system
JPS60178535A (en) Execution definition type command system for processing

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19980818