JPH0488426A - Program coverage measuring instrument - Google Patents
Program coverage measuring instrumentInfo
- Publication number
- JPH0488426A JPH0488426A JP2197558A JP19755890A JPH0488426A JP H0488426 A JPH0488426 A JP H0488426A JP 2197558 A JP2197558 A JP 2197558A JP 19755890 A JP19755890 A JP 19755890A JP H0488426 A JPH0488426 A JP H0488426A
- Authority
- JP
- Japan
- Prior art keywords
- branch
- instruction
- address
- coverage
- program
- 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
- 238000005259 measurement Methods 0.000 claims description 38
- 230000001186 cumulative effect Effects 0.000 claims description 17
- 238000004458 analytical method Methods 0.000 claims description 16
- 238000004364 calculation method Methods 0.000 claims description 7
- 238000000691 measurement method Methods 0.000 claims description 2
- 238000011156 evaluation Methods 0.000 description 32
- 238000009825 accumulation Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 230000000694 effects Effects 0.000 description 5
- 238000000034 method Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 238000011867 re-evaluation Methods 0.000 description 1
Landscapes
- Executing Machine-Instructions (AREA)
- Debugging And Monitoring (AREA)
- Stored Programmes (AREA)
Abstract
Description
【発明の詳細な説明】
〔産業上の利用分野〕
本発明は、情報処理システムに利用する。特に、評価対
象プログラム内の少な(とも−口辺上実行された命令の
比率を測定するプログラム網羅率測定手段に関する。DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention is utilized in an information processing system. In particular, the present invention relates to a program coverage measuring means for measuring the ratio of instructions that are executed in small numbers in a program to be evaluated.
本発明は、プログラム網羅率を測定する手段において、
分岐命令割込みを利用した網羅情報を記憶し、これに基
づき実行済命令数の比率を自動算出することにより、
プログラム網羅率を客観的に判定することができるよう
にしたものである。The present invention provides means for measuring program coverage, which objectively determines program coverage by storing coverage information using branch instruction interrupts and automatically calculating the ratio of the number of executed instructions based on this information. It has been made possible to do so.
従来、プログラムの評価度合いを知る目安として、評価
対象プログラムに対する評価項目をあらかじめ挙げて置
と、その評価項目をすべて検証し終えて評価完了として
いた。Conventionally, as a measure of the degree of evaluation of a program, evaluation items for the program to be evaluated were listed in advance, and the evaluation was completed after all of the evaluation items had been verified.
このような評価方法の欠点として、
■ 評価項目の作成は、個人の経験や勘に頼ることが多
く、デバッグ度合いに個人差がある、■ プログラムが
大きくなるにつれ、すべて網羅する評価項目を上げるの
が困難になるなどが挙げられ、評価されない部分が予想
される。The disadvantages of this evaluation method are: ■ The creation of evaluation items often relies on individual experience and intuition, and the degree of debugging varies among individuals; ■ As the program grows, it becomes difficult to create evaluation items that cover all It is expected that some areas will not be evaluated as it will be difficult to do so.
本発明は、このような欠点を除去するもので、プログラ
ム網羅率を自動算出することができるプログラム網羅率
測定装置を提供することを目的とする。SUMMARY OF THE INVENTION An object of the present invention is to provide a program coverage measuring device capable of automatically calculating a program coverage rate in order to eliminate such drawbacks.
本発明は、評価対象プログラムの複数個が記憶される主
記憶装置と、この評価対象プログラムが走行される中央
処理装置と、この−評価対象プログラム毎に算定された
プログラム網羅率が経由する出力装置とを備えたプログ
ラム網羅率測定方式において、上記中央処理装置は、分
岐命令の実行により分岐後の最初の命令が実行される前
に、この分岐命令を含むプログラムの走行にかかわる優
先レベノペ分岐前アドレスおよび分岐後アドレスを保持
し、上記優先レベル毎に内部割込みを発生する分岐命令
割込部を備え、この分岐命令割込部の起動および停止を
指令する分岐命令割込モード設定および解除手段と、上
記優先レベルに対応させて上記分岐後アドレスをを記憶
する分岐後アドレス記憶部と、上記分岐命令割込部から
通知される分岐前アドレスおよび上記分岐後アドレス記
憶部に記憶されている当該分岐命令割込み時の優先レベ
ルに対応する分岐後アドレスで示される評(i 対象プ
ログラムの範囲を網羅情報として記憶する網羅情報記憶
部と、上記主記憶装置上の評価対象プログラムのすべて
の命令語のアドレスを得る命令語解析部と、この命令語
解析部で得た命令語のアドレスと上記網羅情報記憶部に
記憶された網羅情報とから実行済命令の比率を算定する
網羅率算出部と、実行済命令と未実行命令とを識別でき
る命令語のアドレスを編集して上記出力装置に与える測
定結果編集出力部とを備えたことを特徴とする。The present invention includes a main storage device in which a plurality of programs to be evaluated are stored, a central processing unit on which the programs to be evaluated are run, and an output device through which the program coverage rate calculated for each program to be evaluated is transmitted. In the program coverage measurement method having and a branch instruction interrupt section that holds a post-branch address and generates an internal interrupt for each of the priority levels, and branch instruction interrupt mode setting and cancellation means that instructs the branch instruction interrupt section to start and stop; A post-branch address storage unit that stores the post-branch address in correspondence with the priority level, and a pre-branch address notified from the branch instruction interrupt unit and the branch instruction stored in the post-branch address storage unit. Evaluation indicated by the post-branch address corresponding to the priority level at the time of interrupt (i) A comprehensive information storage unit that stores the range of the target program as comprehensive information, and the address of all instruction words of the target program in the main memory. a coverage ratio calculation unit that calculates the ratio of executed instructions from the address of the instruction word obtained by the instruction word analysis unit and the coverage information stored in the coverage information storage unit; The present invention is characterized by comprising a measurement result editing/output unit that edits the address of the instruction word that can identify the instruction word and the unexecuted instruction, and provides the edited address to the output device.
ここで、外部記憶装置と、この外部記憶装置に上記網羅
情報記憶部の記憶内容を累積記憶する累積ファイル入出
力制御部とを備えても良い。Here, it is also possible to include an external storage device and a cumulative file input/output control section that cumulatively stores the storage contents of the comprehensive information storage section in the external storage device.
さらに、上記累積ファイル入出力制御部を所定時間間隔
で起動する指示を与える起動手段とを備えても良い。Furthermore, the apparatus may further include a starting means for giving an instruction to start the cumulative file input/output control section at predetermined time intervals.
分岐命令割込み手段で、分岐命令の実行により分岐機最
初の命令が実行される前にこの分岐命令を含むプログラ
ムの走行の優先レベルと分岐前アドレスと分岐後アドレ
スとを保持して内部割込みを発生させる。ここで、この
内部割込みが一個以上の優先レベルごとに発生できる。The branch instruction interrupt means generates an internal interrupt by holding the priority level of the program including the branch instruction, the pre-branch address, and the post-branch address before the first instruction of the branch machine is executed by executing the branch instruction. let Here, this internal interrupt can occur for each of one or more priority levels.
また、分岐後アドレス記憶手段で、優先レベルに対応さ
せて分岐後アドレスを記憶する。網羅情報記憶手段で、
分岐命令割込み手段から通知される分岐前アドレスと分
岐後アドレス記憶手段により既に記憶されていてこの分
岐命令割込み時の優先レベルに対応する分岐後アドレス
とで示される範囲を網羅情報として記憶する。また、命
令語解析手段で、主記憶上での評価対象プログラムの全
命令語のアドレスを得る。測定結果編集出力手段で、こ
の命令語解析手段により得た命令語のアドレスと網羅情
報記憶手段により記憶された網羅情報とから実行済命令
の比率を算出するとともに実行済命令と未実行命令とが
識別できるようにして命令語のアドレスを編集出力する
。Further, the post-branch address storage means stores the post-branch address in correspondence with the priority level. With comprehensive information storage means,
The range indicated by the pre-branch address notified from the branch instruction interrupt means and the post-branch address already stored by the post-branch address storage means and corresponding to the priority level at the time of this branch instruction interrupt is stored as comprehensive information. Further, the instruction word analysis means obtains the addresses of all instruction words of the evaluation target program on the main memory. The measurement result editing output means calculates the ratio of executed instructions from the address of the instruction word obtained by the instruction word analysis means and the exhaustive information stored in the exhaustive information storage means, and also calculates the ratio of executed instructions and unexecuted instructions. Edit and output the address of the instruction word so that it can be identified.
以下、本発明の一実施例について図面を参照して説明す
る。An embodiment of the present invention will be described below with reference to the drawings.
第1図は、この実施例の構成を示すブロック図である。FIG. 1 is a block diagram showing the configuration of this embodiment.
この実施例は、入力操作が行われる入力装置1と、入力
情報解析部20、網羅率測定制御部21、分岐後アドレ
ス記憶部22、網羅情報記憶部23、測定結果編集出力
制御部24、命令語解析部25、網羅率算出部26、累
積ファイル人出力制御部27および自動累積指示部28
を含むプログラム網羅率測定装置2と、分岐命令の実行
により分岐機最初の命令が実行される前に優先レベルと
分岐前アドレスと分岐後アドレスとを保持して内部割込
みを発生させる分岐命令割込部30を含む中央処理装置
3と、評価対象プログラムを記憶する主記憶装置4と、
測定結果リストが出力される出力装置5と、網羅情報記
憶部23からの内容を累積記憶するた於の累積ファイル
が存在する外部記憶装置6と、自動累積間隔を得るため
に自動累積指示部28によって参照される時刻装置7と
から構成される。This embodiment includes an input device 1 through which input operations are performed, an input information analysis section 20, a coverage rate measurement control section 21, a post-branch address storage section 22, a coverage information storage section 23, a measurement result editing output control section 24, and an instruction Word analysis section 25, coverage rate calculation section 26, cumulative file person output control section 27, and automatic accumulation instruction section 28
a program coverage measuring device 2 including a program coverage measurement device 2, and a branch instruction interrupt that holds a priority level, a pre-branch address, and a post-branch address and generates an internal interrupt before the first instruction of the branch machine is executed by executing the branch instruction. A central processing unit 3 including a section 30, a main storage device 4 that stores an evaluation target program,
An output device 5 for outputting a measurement result list, an external storage device 6 in which a cumulative file exists for cumulatively storing the contents from the exhaustive information storage section 23, and an automatic accumulation instruction section 28 for obtaining an automatic accumulation interval. and a time device 7 referenced by.
この実施例は、第1図に示すように、評価対象プログラ
ムの複数個が記憶される主記憶装置4と、この評価対象
プログラムが走行される中央処理装置3と、この評価対
象プログラム毎に算定されたプログラム網羅率が経由す
る出力装置5とを備えたプログラム網羅率測定方式にお
いて、中央処理装置3は、分岐命令の実行により分岐後
の最初の命令が実行される前に、この分岐命令を含むプ
ログラムの走行にかかわる優先レベル、分岐前アドレス
および分岐後アドレスを保持し、上記優先レベル毎に内
部割込みを発生する分岐命令割込部30を備え、この分
岐命令割込部30の起動および停止を指令する分岐命令
割込モード設定および解除手段である入力情報解析部2
0および入力装置1と、上記優先レベルに対応させて上
記分岐後アドレスを記憶する分岐後アドレス記憶部22
と、分岐命令割込部30から通知される分岐前アドレス
および分岐後アドレス言己憶部22に記憶されている当
該分岐命令割込み時の優先レベルに対応する分岐後アド
レスで示される評価対象プログラムの範囲を網羅情報と
して記憶する網羅情報記憶部23と、主記憶装置4上の
評価対象プログラムのすべての命令語のアドレスを得る
命令語解析部25と、この命令語解析部25で得た命令
語のアドレスと網羅情報記憶部23に記憶されたm羅情
報とから実行済命令の比率を算定する網羅率算出部26
と、実行済命令と未実行命令とを識別できる命令語のア
ドレスを編集して出力装置に与える測定結果編集出力手
段!24と、外部記憶装置6と、この外部記憶装置6に
網羅情報記憶部23の記憶内容を累積記憶する累積ファ
イル入出力制御部27と、累積ファイル入出力制御部2
7を所定時間間隔で起動する指示を与える起動手段であ
る自動累積指示部28および時刻装置7とを備える。As shown in FIG. 1, this embodiment includes a main storage device 4 in which a plurality of programs to be evaluated are stored, a central processing unit 3 on which the programs to be evaluated are run, and a calculation process for each program to be evaluated. In the program coverage measuring method, which includes an output device 5 through which the program coverage rate determined, the central processing unit 3 executes the branch instruction before the first instruction after the branch is executed. A branch instruction interrupt unit 30 is provided that holds priority levels, pre-branch addresses, and post-branch addresses related to the running of the included program, and generates internal interrupts for each of the priority levels, and is capable of starting and stopping this branch instruction interrupt unit 30. Input information analysis unit 2 which is a means for setting and canceling branch instruction interrupt mode that commands
0 and input device 1, and a post-branch address storage unit 22 that stores the post-branch address in correspondence with the priority level.
and the pre-branch address and post-branch address address notified from the branch instruction interrupt unit 30. A coverage information storage unit 23 that stores the range as coverage information, an instruction word analysis unit 25 that obtains the addresses of all instruction words of the evaluation target program on the main storage device 4, and an instruction word analysis unit 25 that obtains the addresses of all instruction words of the program to be evaluated on the main storage device 4. a coverage ratio calculation unit 26 that calculates the ratio of executed instructions from the address of the address and the mra information stored in the coverage information storage unit 23;
And a measurement result editing/output means that edits the address of the instruction word that can distinguish between executed and unexecuted instructions and provides it to the output device! 24, an external storage device 6, a cumulative file input/output control section 27 that cumulatively stores the storage contents of the comprehensive information storage section 23 in the external storage device 6, and a cumulative file input/output control section 2.
7 at predetermined time intervals.
次に、この実施例の動作を説明する。Next, the operation of this embodiment will be explained.
主記憶装置4には評価対象プログラム41.421.4
nが存在し、それぞれの先頭アドレスはSl、S2、
、Sn番地で表され、同じく終了アドレスはEl、E2
、 、En番地として表されている。そして、評価対象
プログラム41.421.40の優先レベルは、それぞ
れ1.2、 、nとする。The main storage device 4 contains the evaluation target program 41.421.4.
n exists, and the respective start addresses are Sl, S2,
, Sn addresses, and the end addresses are El, E2.
, , En addresses. The priority levels of the evaluation target programs 41, 421, and 40 are 1.2, , and n, respectively.
まず、評価対象プログラム41を測定する場合に、優先
レベル番号1に対する分岐命令割込みモード設定指令が
、入力装置1からプログラム網羅率測定装置2の入力情
報解析部20を介して、網羅率測定制御部21に通知さ
れる。この通知を受けた網羅率測定制御部21は、分岐
命令割込部30が内部管理する優先レベルごとの分岐命
令割込みモード状況を参照することにより、他の優先レ
ベルで分岐命金側込みモード実行中か否かの判定をする
ことがでと、他の優先レベルで分岐命令割込みモード実
行中でない場合に限って、累積ファイル人出力制御部2
7に対して外部記憶装置6の累積ファイルの内容を網羅
情報記憶部23に復帰させるよう指令する。この指令を
受けて復帰を完了した累積ファイル入出力制御部27は
、網羅率測定制御部21に復帰完了通知を行う。この後
に、網羅率測定制御部21は、優先レベル番号1を分岐
命令割込みモードにするよう分岐命令割込部30に指令
すると共に、優先レベル番号1に対応する分岐後アドレ
ス記憶部22内の分岐後アドレスをゼロで初期化する。First, when measuring the evaluation target program 41, a branch instruction interrupt mode setting command for priority level number 1 is sent from the input device 1 to the coverage measurement control unit via the input information analysis unit 20 of the program coverage measurement device 2. 21 will be notified. Upon receiving this notification, the coverage measurement control unit 21 refers to the branch instruction interrupt mode status for each priority level that is internally managed by the branch instruction interrupt unit 30, and executes the branch life capital side-in mode at another priority level. It is possible to judge whether the cumulative file output control unit 2
7 to restore the contents of the cumulative file in the external storage device 6 to the exhaustive information storage section 23. The cumulative file input/output control section 27, which has completed the return upon receiving this command, notifies the coverage rate measurement control section 21 that the return has been completed. After this, the coverage measurement control unit 21 instructs the branch instruction interrupt unit 30 to set the priority level number 1 to the branch instruction interrupt mode, and also stores the branch address in the post-branch address storage unit 22 corresponding to the priority level number 1. Initialize the rear address with zero.
この後に、主記憶装置4内での評価対象プログラム41
が起動されて分岐命令が実行されると、中央処理装置3
の分岐命令割込部30は、分岐先のアドレスで分岐命令
割込みを発生させて、プログラム網羅率測定装置2の網
羅率測定制御部21を動作させる。After this, the evaluation target program 41 in the main storage device 4
is activated and a branch instruction is executed, the central processing unit 3
The branch instruction interrupt unit 30 generates a branch instruction interrupt at the branch destination address to operate the coverage measurement control unit 21 of the program coverage measurement device 2.
網羅率測定制御部21は、分岐命令割込部3oによって
優先レベル番号1と、評価対象プログラム41内の分岐
命令自身のアドレスである分岐前アドレスと、この分岐
命令による分岐先である分岐後アドレスとを受は取り、
分岐後アドレス記憶部22内の優先レベル番号1に対応
する分岐後アドレスからこの分岐命令割込み時通知され
た分岐前アドレスまでの範囲を網羅情報として網羅情報
記憶部23内に記憶するとともに、この分岐命令割込み
時に通知された分岐後アドレスを優先レベル番号1に対
応させて分岐後アドレス記憶部22内に記憶しておく。The coverage measurement control unit 21 uses the branch instruction interrupt unit 3o to obtain the priority level number 1, the pre-branch address that is the address of the branch instruction itself in the evaluation target program 41, and the post-branch address that is the branch destination of this branch instruction. And the receiver takes the
The range from the post-branch address corresponding to priority level number 1 in the post-branch address storage unit 22 to the pre-branch address notified at the time of this branch instruction interrupt is stored as comprehensive information in the comprehensive information storage unit 23, and this branch The post-branch address notified at the time of instruction interrupt is stored in the post-branch address storage unit 22 in correspondence with priority level number 1.
なお、amm測測定制御部21、優先レベル番号1に対
応する分岐後アドレス記憶部22内の分岐後アドレスが
ゼロで初期化されている最初の分岐命令割込み時には、
分岐命令割込部30から通知された分岐後アドレスを優
先レベル番号1に対応させて分岐後アドレス記憶部22
に記憶するだけであって、網羅情報を網羅情報記憶部2
3内に記憶することはしない。In addition, at the time of the first branch instruction interrupt in which the post-branch address in the post-branch address storage unit 22 corresponding to the priority level number 1 of the amm measurement control unit 21 is initialized to zero,
The post-branch address notified from the branch instruction interrupt unit 30 is associated with the priority level number 1 and stored in the post-branch address storage unit 22.
The comprehensive information storage unit 2 only stores the comprehensive information in the comprehensive information storage unit 2.
It will not be stored within 3.
以上の動作を行った後に、網羅率測定制御121は、評
価対象プログラム41での分岐後アドレスからの実行再
開を分岐命令割込部30に指示し、次の分岐命令割込み
待ち状態になる。After performing the above operations, the coverage rate measurement control 121 instructs the branch instruction interrupt unit 30 to resume execution from the post-branch address in the evaluation target program 41, and enters the next branch instruction interrupt wait state.
第2図は、評価対象プログラム41のアドレスPOから
アドレスP4までのルーチンを例にとって、網羅情報を
網羅情報記憶部23に記憶するときの関連図である。評
価対象プログラム41で、アドレスPO1P1、P2、
P3、P4は分岐命令の分岐先アドレスであり、アドレ
スBL 82、B3、B4は分岐命令自身のアドレスで
ある。まず、評価対象プログラム41のアドレスPOに
分岐する分岐命令が実行されると、分岐命令割込部30
によって分岐命令割込みが発生し、網羅率測定制御部2
1が動作する。網羅率測定制御部21は、分岐命令割込
部30から通知される分岐後アドレスPOを優先レベル
番号1に対応させて分岐後アドレス記憶部22に記憶す
る(ここではアドレスPOに分岐する前の網羅情報の記
憶手順の説明を省略する)。次に、評価対象プログラム
41のアドレスB1での分岐命令が実行され、分岐先で
あるアドレスP1で分岐命令割込みが発生する。このと
きに、網羅率測定制御部21は、分岐命令割込部30か
ら通知される分岐前アドレスB1と、このとき分岐後ア
ドレス記憶部22が記憶しているアドレスPOとの範囲
(アドレスPOからアドレスB1まで)を網羅情報Ml
として網羅情報記憶部23に記憶し、さらに通知された
分岐後アドレスP1を優先レベル番号1に対応させて分
岐後アドレス記憶部22に記憶する。FIG. 2 is a related diagram when comprehensive information is stored in the comprehensive information storage unit 23, taking as an example the routine from address PO to address P4 of the evaluation target program 41. In the evaluation target program 41, addresses PO1P1, P2,
P3 and P4 are the branch destination addresses of the branch instruction, and addresses BL82, B3, and B4 are the addresses of the branch instruction itself. First, when a branch instruction that branches to address PO of the evaluation target program 41 is executed, the branch instruction interrupt unit 30
A branch instruction interrupt occurs, and the coverage measurement control unit 2
1 works. The coverage measurement control unit 21 stores the post-branch address PO notified from the branch instruction interrupt unit 30 in the post-branch address storage unit 22 in correspondence with the priority level number 1 (here, the address PO before branching to the address PO is stored in the post-branch address storage unit 22). (The explanation of the procedure for storing exhaustive information is omitted.) Next, a branch instruction at address B1 of the evaluation target program 41 is executed, and a branch instruction interrupt occurs at address P1, which is the branch destination. At this time, the coverage rate measurement control unit 21 determines the range between the pre-branch address B1 notified from the branch instruction interrupt unit 30 and the address PO stored in the post-branch address storage unit 22 at this time (from address PO to (Up to address B1) Coverage information Ml
Further, the notified post-branch address P1 is stored in the post-branch address storage unit 22 in correspondence with the priority level number 1.
同様に、アドレスB2、B3、B4の分岐命令の実行に
よってそれぞれアドレスP2、P3、P4で分岐命令割
込みが発生し、網羅率測定制御部21によってそれぞれ
網羅情報M2、M3、M4とが網羅情報記憶823に記
憶される。Similarly, branch instruction interrupts occur at addresses P2, P3, and P4 due to execution of branch instructions at addresses B2, B3, and B4, respectively, and coverage information M2, M3, and M4 are stored in coverage information memory by the coverage rate measurement control unit 21, respectively. 823.
第3図は、網羅情報記憶823の記憶内容の一例を示す
図である。FIG. 3 is a diagram showing an example of the storage contents of the exhaustive information storage 823.
網羅情報記憶部23は、アドレスをビット単位で記憶す
る方法である(0番地一ビツト番号0,100番地→ビ
ット番号100のように対応し、実行済命令の番地は対
応するビットがオンである)。そこで評価対象プログラ
ム41の主記憶上での先頭アドレスが81番地で終了ア
ドレスがE1番地であるため、評価対象プログラム41
の網羅情報は網羅情報記憶部230ビット番号S1から
ビット番号E1の範囲に記憶されている網羅情報23M
になる。網羅情報23Mには、第2図での説明で示した
#8羅情報M1、M2、M3、財が存在し、かつ網羅情
報M1、M2、M3、M4に含まれるすべてのビットは
オン状態である。また、網羅情報23Mには網羅情報M
1、M2、M3、M4と同様に、評価対象プログラム4
1での実行された命令領域に対応するビットはオン状態
になって記憶されている。The exhaustive information storage unit 23 stores addresses in bit units (address 0, bit number 0, address 100 → bit number 100), and the address of the executed instruction has the corresponding bit turned on. ). Therefore, since the start address of the evaluation target program 41 on the main memory is address 81 and the end address is address E1, the evaluation target program 41
The coverage information is the coverage information 23M stored in the range from bit number S1 to bit number E1 of the coverage information storage unit 230.
become. The coverage information 23M includes the #8 information M1, M2, M3, and goods shown in the explanation in FIG. 2, and all bits included in the coverage information M1, M2, M3, and M4 are in the ON state. be. In addition, comprehensive information 23M includes comprehensive information M
1. Similar to M2, M3, and M4, evaluation target program 4
The bit corresponding to the executed instruction area at 1 is stored in the on state.
最後に評価が終了し、優先レベル番号1に対す、る分岐
命令割込みモード解除指令が、入力装置1から入力情報
解析部20を介して網羅率測定制御部21に通知される
。この通知を受けた網羅率測定制御部21は、累積ファ
イル入出力制御部27に対して網羅情報記憶部23の内
容を外部記憶装置6の累積ファイルに待避させるよう指
令する。この指令を受けて待避を完了した累積ファイル
入出力制御部27は、網羅率測定制御部21に待避完了
通知を行う。Finally, the evaluation is completed, and a branch instruction interrupt mode cancellation command for priority level number 1 is notified from the input device 1 to the coverage measurement control section 21 via the input information analysis section 20. Upon receiving this notification, the coverage rate measurement control unit 21 instructs the cumulative file input/output control unit 27 to save the contents of the comprehensive information storage unit 23 to the cumulative file in the external storage device 6. The cumulative file input/output control section 27, which has completed the evacuation upon receiving this command, notifies the coverage rate measurement control section 21 of the evacuation completion.
この後に、網羅率測定制御部21は、優先レベル番号1
の分岐命令割込みモードを解除するよう分岐命令割込部
30に指令すると共に、評価対象プログラム41に対す
る測定結果を編集出力するように測定結果編集出力制御
部24に指示する。この指示を受けた測定結果編集出力
制御部24は、命令語解析部25に対して81番地から
E1番地までの全命令語のアドレスを報告するように指
示する。命令語解析部25は、81番地からE1番地ま
での全命令語を解釈して全命令語のアドレスを測定結果
編集出力制御部24に逐次報告する。この後に、測定結
果編集出力制御部24は、命令語解析部25によって逐
次報告される命令語のアドレスを出力装置5に出力する
際に、報告される命令語のアドレスに対応する網羅情報
記憶部23内のビットがオフ状態である未実行命令のア
ドレスだけを出力する。さらに、測定結果編集出力制御
部24は、命令語解析部25によって逐次報告される命
令語のアドレスと網羅情報記憶部23とから実行済命令
語数と全命令語数とを知ることがでと、これによって実
行済命令語数の全命令語数に対する比率の算出を網羅率
算出部26に指示するとともに、この算出結果を評価対
象プログラム41に対するプログラム網羅率として出力
装置5に出力する。After this, the coverage measurement control unit 21 selects the priority level number 1.
It instructs the branch instruction interrupt section 30 to cancel the branch instruction interrupt mode of , and also instructs the measurement result editing output control section 24 to edit and output the measurement results for the evaluation target program 41 . Upon receiving this instruction, the measurement result editing output control section 24 instructs the instruction word analysis section 25 to report the addresses of all instruction words from address 81 to address E1. The instruction word analysis section 25 interprets all instruction words from address 81 to address E1 and sequentially reports the addresses of all instruction words to the measurement result editing output control section 24. Thereafter, when the measurement result editing output control section 24 outputs the addresses of the instruction words sequentially reported by the instruction word analysis section 25 to the output device 5, the measurement result editing output control section 24 outputs the comprehensive information storage section corresponding to the address of the instruction words to be reported. Only the addresses of unexecuted instructions whose bits in 23 are off are output. Furthermore, the measurement result editing output control section 24 can know the number of executed instruction words and the total number of instruction words from the address of the instruction word successively reported by the instruction word analysis section 25 and the exhaustive information storage section 23. Instructs the coverage calculation unit 26 to calculate the ratio of the number of executed instruction words to the total number of instruction words, and outputs the calculation result to the output device 5 as the program coverage rate for the evaluation target program 41.
ところで、網羅情報記憶部23の内容(網羅情報)は、
分岐命令割込みモード解除指令が入力装置1により入力
されたときに累情ファイルに待避されるようになってい
る。これとは別に、自動累積指示部28は、一定時間間
隔で累積ファイル入出力制御部27に対して網羅情報の
累積を指示する。この指示によって、網羅情報記憶部2
3の網羅情報を外部記憶装置6の累積ファイルに自動的
に待避することが可能である。By the way, the contents of the exhaustive information storage section 23 (exhaustive information) are as follows.
When a branch instruction interrupt mode release command is input through the input device 1, it is saved in the cumulative information file. Separately, the automatic accumulation instruction section 28 instructs the accumulation file input/output control section 27 to accumulate exhaustive information at regular time intervals. With this instruction, the comprehensive information storage unit 2
It is possible to automatically save the comprehensive information of No. 3 to the cumulative file of the external storage device 6.
なお、分岐後アドレス記憶部22内の分岐後アドレスは
優先レベルに対応させて記憶できるので、以上述べた優
先レベル1で走行する評価対象プログラム41単独の測
定だけでなく、複数の優先レベルを同時に測定すること
が可能である。Note that since the post-branch address in the post-branch address storage unit 22 can be stored in correspondence with the priority level, it is possible to measure not only the evaluation target program 41 running at priority level 1 described above, but also multiple priority levels at the same time. It is possible to measure.
さらに、他の優先レベルで分岐命令割込みモードが実行
中か否かの判定を、分岐命令割込部30が内部管理する
優先レベルごとの分岐命令割込みモード状況を参照する
ことにより判定するとしたが、プログラム網羅率測定装
置2内に優先レベルごとの分岐命令割込みモード状況を
構成するようにしてもよい。また、網羅情報を優先レベ
ルごとに区分するように構成して、他の優先レベルで分
岐命令割込みモードが実行中か否かをなくすようにして
もよい。Furthermore, it is assumed that whether or not the branch instruction interrupt mode is being executed at another priority level is determined by referring to the branch instruction interrupt mode status for each priority level that is internally managed by the branch instruction interrupt unit 30. A branch instruction interrupt mode status for each priority level may be configured in the program coverage measuring device 2. Further, the comprehensive information may be configured to be classified by priority level, so that it is possible to eliminate whether or not the branch instruction interrupt mode is being executed at other priority levels.
また、本実施例では分岐命令割込みモード解除指令が入
力装置1から入力されたとき測定結果の編集出力が行わ
れるようになっているが、網羅情報が累積ファイルに待
避されているため測定結果の編集出力指令が人力装置1
から入力されたときとしてもよい。Furthermore, in this embodiment, when a branch instruction interrupt mode cancellation command is input from the input device 1, the measurement results are edited and output, but since the exhaustive information is saved in the cumulative file, the measurement results cannot be edited. Edit output command is human-powered device 1
It may also be used when input from .
分岐命令割込みモード解除指令の受は取り時や自動累積
指示部28による累積指示とは別に、網羅情報の累積が
評価対象プログラムの終了時に自動的に行えるように評
価対象プログラムの終了通知をオペレーティングシステ
ムから貰えるように構成してもよい。In addition to receiving a branch instruction interrupt mode release command and instructing accumulation by the automatic accumulation instruction unit 28, the operating system sends a termination notification of the program to be evaluated so that comprehensive information can be accumulated automatically at the end of the program to be evaluated. It may be configured so that it can be received from
本発明は、以上説明したように、分岐命令割込みを利用
して網羅情報を記憶し、評価対象プログラムの実行後に
記憶されたm羅情報をもとに実行済命令数の比率(プロ
グラム網羅率)を算出することがでと、これによってプ
ログラムの網羅度が客観的に判定でと、かつプログラム
の品質尺度が経験年数などと無関係に統一でと、さらに
、未実行命令のアドレスを出力することにより次の評価
ステップでは未実行命令に着目した評価ができるので、
評価対象プログラムに細工しないでプログラムの品質を
効率良く向上できる効果がある。As explained above, the present invention stores coverage information using branch instruction interrupts, and calculates the ratio of the number of executed instructions (program coverage rate) based on the information stored after execution of the program to be evaluated. By calculating the coverage of the program, the degree of coverage of the program can be determined objectively, and the quality measure of the program can be unified regardless of the number of years of experience.Furthermore, by outputting the addresses of unexecuted instructions, In the next evaluation step, evaluation can be performed focusing on unexecuted instructions, so
This has the effect of efficiently improving the quality of a program without modifying the program to be evaluated.
また、網羅情報を外部記憶装置に累積するように構成し
ているので、評価の中断と継続が自由にでき効率よく評
価ができる効果がある。Furthermore, since the comprehensive information is configured to be accumulated in the external storage device, evaluation can be freely interrupted and continued, which has the effect of allowing efficient evaluation.
さらに、本発明では一定時間間隔で自動的に網羅情報を
累積できるよう構成しているので、分岐命令割込みモー
ド解除指令の忘れやプログラム網羅率測定装置の更新な
どに−よって網羅情報が累積されず、再評価が必要にな
ることがない効果がある。Furthermore, since the present invention is configured to automatically accumulate coverage information at fixed time intervals, coverage information will not be accumulated due to forgetting a branch instruction interrupt mode release command or updating the program coverage measurement device. , which has the effect of not requiring re-evaluation.
第1図は本発明実施例の構成を示すブロック図。
第2図は網羅情報を網羅情報記憶部に記憶するときの関
連図。
第3図は網羅情報記憶部の記憶内容の一例を示す図。
1・・・入力装置、2・・・プログラム網羅率測定装置
、3・・・中央処理装置、4−・・主記憶装置、5・・
・出力装置、6・・・外部記憶装置、7・・・時刻装置
。FIG. 1 is a block diagram showing the configuration of an embodiment of the present invention. FIG. 2 is a related diagram when comprehensive information is stored in the comprehensive information storage unit. FIG. 3 is a diagram showing an example of the contents stored in the exhaustive information storage section. DESCRIPTION OF SYMBOLS 1... Input device, 2... Program coverage measurement device, 3... Central processing unit, 4-... Main storage device, 5...
- Output device, 6... external storage device, 7... time device.
Claims (1)
置と、この評価対象プログラムが走行される中央処理装
置と、この評価対象プログラム毎に算定されたプログラ
ム網羅率が経由する出力装置とを備えたプログラム網羅
率測定方式において、上記中央処理装置は、分岐命令の
実行により分岐後の最初の命令が実行される前に、この
分岐命令を含むプログラムの走行にかかわる優先レベル
、分岐前アドレスおよび分岐後アドレスを保持し、上記
優先レベル毎に内部割込みを発生する分岐命令割込部を
備え、 この分岐命令割込部の起動および停止を指令する分岐命
令割込モード設定および解除手段と、上記優先レベルに
対応させて上記分岐後アドレスをを記憶する分岐後アド
レス記憶部と、 上記分岐命令割込部から通知される分岐前アドレスおよ
び上記分岐後アドレス記憶部に記憶されている当該分岐
命令割込み時の優先レベルに対応する分岐後アドレスで
示される評価対象プログラムの範囲を網羅情報として記
憶する網羅情報記憶部と、 上記主記憶装置上の評価対象プログラムのすべての命令
語のアドレスを得る命令語解析部と、この命令語解析部
で得た命令語のアドレスと上記網羅情報記憶部に記憶さ
れた網羅情報とから実行済命令の比率を算定する網羅率
算出部と、実行済命令と未実行命令とを識別できる命令
語のアドレスを編集して上記出力装置に与える測定結果
編集出力部と を備えたことを特徴とするプログラム網羅率測定装置。 2、外部記憶装置と、この外部記憶装置に上記網羅情報
記憶部の記憶内容を累積記憶する累積ファイル入出力制
御部とを備えた請求項1記載のプログラム網羅率測定装
置。 3、上記累積ファイル入出力制御部を所定時間間隔で起
動する指示を与える起動手段とを備えた請求項2記載の
プログラム網羅率測定装置。[Claims] 1. A main storage device in which a plurality of programs to be evaluated are stored, a central processing unit in which the programs to be evaluated run, and a program coverage rate calculated for each program to be evaluated. In the program coverage measurement method, the central processing unit determines the priority level of the program including the branch instruction before the first instruction after the branch is executed by executing the branch instruction. , a branch instruction interrupt section that holds a pre-branch address and a post-branch address and generates an internal interrupt for each of the above priority levels, and a branch instruction interrupt mode setting and command to start and stop this branch instruction interrupt section. a release means, a post-branch address storage unit that stores the post-branch address in correspondence with the priority level, and a pre-branch address notified from the branch instruction interrupt unit and the post-branch address stored in the post-branch address storage unit. a coverage information storage unit that stores, as coverage information, the range of the program to be evaluated indicated by the post-branch address corresponding to the priority level at the time of the branch instruction interrupt; an instruction word analysis unit that obtains an address; a coverage rate calculation unit that calculates a ratio of executed instructions from the address of the instruction word obtained by the instruction word analysis unit and the coverage information stored in the coverage information storage unit; A program coverage measurement device comprising: a measurement result editing/output unit that edits the address of an instruction word that can distinguish between completed instructions and unexecuted instructions and provides the edited instruction to the output device. 2. The program coverage measuring device according to claim 1, further comprising: an external storage device; and a cumulative file input/output control section that cumulatively stores the contents of the coverage information storage section in the external storage device. 3. The program coverage measuring device according to claim 2, further comprising a starting means for giving an instruction to start the cumulative file input/output control section at predetermined time intervals.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2197558A JPH0488426A (en) | 1990-07-25 | 1990-07-25 | Program coverage measuring instrument |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2197558A JPH0488426A (en) | 1990-07-25 | 1990-07-25 | Program coverage measuring instrument |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH0488426A true JPH0488426A (en) | 1992-03-23 |
Family
ID=16376495
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2197558A Pending JPH0488426A (en) | 1990-07-25 | 1990-07-25 | Program coverage measuring instrument |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0488426A (en) |
-
1990
- 1990-07-25 JP JP2197558A patent/JPH0488426A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JPH0488426A (en) | Program coverage measuring instrument | |
| JPH056213A (en) | Industrial robot control method and apparatus | |
| JP3389745B2 (en) | Apparatus and method for measuring program performance | |
| JP7548464B1 (en) | Programmable logic controller, support device, and logging method | |
| JPH04257934A (en) | System for measuring comprehensive rate of program | |
| US20240403141A1 (en) | Method for processing data using a data processing network comprising a plurality of data processing modules, data processing module and data processing network | |
| JPS62162105A (en) | Flow chart type programmable controller | |
| JP3549383B2 (en) | PMC controller | |
| JPH02220145A (en) | Program tracing system | |
| JPH07152578A (en) | Maximum stack usage detection method | |
| JPH0337201B2 (en) | ||
| KR100538282B1 (en) | Method for debugging realtime parallel program using check point | |
| JPS62293305A (en) | Software developing device for fa controller | |
| JPH0566967A (en) | Measuring system for program comprehension rate | |
| JPS63300334A (en) | Measurement system for number of times of instruction execution of program | |
| JPH0477840A (en) | Collection system for fault analysis system | |
| JPS6324425A (en) | Test comprehensive state detection system | |
| JPS63289654A (en) | Program branching instruction monitoring system | |
| JPH03268034A (en) | Program execution monitoring method | |
| JPS63300335A (en) | Measurement system for number of times of instruction execution of program | |
| JPH01205348A (en) | Program debugging system | |
| JPH01130234A (en) | Fault search method | |
| JPH0314040A (en) | Program transportable support device | |
| JPH02118855A (en) | Processing control system | |
| JPH02148203A (en) | Sequence controller |