JPH01118937A - Measurement system for program comprehension rate - Google Patents

Measurement system for program comprehension rate

Info

Publication number
JPH01118937A
JPH01118937A JP62276359A JP27635987A JPH01118937A JP H01118937 A JPH01118937 A JP H01118937A JP 62276359 A JP62276359 A JP 62276359A JP 27635987 A JP27635987 A JP 27635987A JP H01118937 A JPH01118937 A JP H01118937A
Authority
JP
Japan
Prior art keywords
address
branch
instruction
executed
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
Application number
JP62276359A
Other languages
Japanese (ja)
Inventor
Kenichi Murakami
健一 村上
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.)
NEC Corp
Original Assignee
NEC Corp
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 NEC Corp filed Critical NEC Corp
Priority to JP62276359A priority Critical patent/JPH01118937A/en
Publication of JPH01118937A publication Critical patent/JPH01118937A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To accurately grasp the degree of evaluation of a program to be evaluated by applying a system where the ratio is measured for the instructions carried out at least once or more during evaluation of said program. CONSTITUTION:A system comprises an input device 1 which performs the input operations, a program comprehension rate measuring device 2, a CPU 3, a main memory 4, and an output device 5. The executed instruction area information is successively stored in the executing process of a program PR to be evaluated by means of a branch instruction interruption. Then the ratio of the executed instructions of the PR after execution of the PR based on the stored executed instruction area information. Thus the ratio of the number of executed instructions is measured as a program comprehension rate. In such a way, the degree of evaluation of the PR can be accurately grasped. Furthermore the address of an unexecuted instruction is converted into a module name and an intra-module relative address for output. Thus an unexecuted instruction can be specified in a simple and accurate way.

Description

【発明の詳細な説明】 、 〔産業上の利用分野〕 本発明は計算機システムにおけるプログラム網羅率測定
方式に関し、特に複数のモジュールから構成される評価
対象プログラムを実行した場合において、少なくとも1
回以上実行された命令の全命令数に対する比率を測定す
る方式に関する。
[Detailed Description of the Invention] [Field of Industrial Application] The present invention relates to a method for measuring program coverage in a computer system, and in particular, when a program to be evaluated consisting of multiple modules is executed, at least one
This invention relates to a method for measuring the ratio of instructions executed more than once to the total number of instructions.

〔従来の技術〕[Conventional technology]

プログラムを新規に開発した場合などにおいては、その
プログラムが所期の目的を達成しているか否かを確認す
るために、試験データなどを用いてそのプログラムを評
価することが行なわれる。
When a new program is developed, the program is evaluated using test data or the like in order to confirm whether the program achieves its intended purpose.

通常、このプログラムの評価は、評価担当者が評価対象
プログラム内の全命令を1il羅できるように幾つかの
評価項目を予め考え、これらの評価項目について試験を
行なε)、全ての評価項目で満足する結果が得られたと
き、評価完了と判断していた。
Normally, when evaluating this program, the person in charge of evaluation considers several evaluation items in advance so that all instructions in the program to be evaluated can be covered, and tests are performed on these evaluation items. The evaluation was considered complete when a satisfactory result was obtained.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

しかしながら、評価対象プログラム内の全命令を網羅で
きるような評価項目を事前に考えることは極めて困難で
あり、従って、予め考えた評価項目を全て満足したこと
をもって、評価対象プログラムの評価が済んだとは言え
ないという問題点があった・ 本発明はこのような事情に鑑みて為されたものであり、
その目的は、評価対象プログラムの評価中に少なくとも
1回以上実行された命令の比率を測定する方式を提供す
ることより、評価対象プログラムの評価度合を正確に知
ることができるようにすることにある。
However, it is extremely difficult to think of evaluation items in advance that can cover all the instructions in the program to be evaluated, and therefore it is considered that the evaluation of the program to be evaluated is complete when all the evaluation items that have been considered in advance are satisfied. The present invention was made in view of these circumstances,
The purpose of this is to provide a method for measuring the ratio of instructions executed at least once during the evaluation of a program to be evaluated, thereby making it possible to accurately determine the degree of evaluation of the program to be evaluated. .

〔問題点を解決するための手段〕[Means for solving problems]

本発明は上記目的を達成するために、 分岐命令割込みモードの設定に応答して、プログラム中
の分岐命令の実行により、分岐後最初の命令が実行され
る前に分岐前アドレスと分岐後アドレスとを保持して内
部割込みを発生させる分岐命令割込機構を有する計算機
システムにおいて、評価対象プログラムを構成する全モ
ジュールのモジエール名、絶対アドレスで表現された先
頭アドレス及び終了アドレスを含む制御情報を保持する
制御情報保持手段と、 該制御情報保持手段によって保持された前記制御情報を
参照して絶対アドレスをモジュール名とモジュール内相
対アドレスとに変換するアドレス変換手段と、 前記分岐後アドレスを記憶する分岐後アドレス記憶手段
と、 実行済命令領域情報記憶、手段と、 前記分岐命令割込機構による内部割込み発生時、前記分
岐命令割込機構に保持された分岐前アドレスと、前記分
岐後アドレス記憶手段に記憶された分岐後アドレスとで
示される範囲を実行済命令領域情報として前記実行済命
令領域情報記憶手段に記憶させると共に、前記分岐命令
割込機構に保持された分岐後アドレスを前記分岐後アド
レス記憶手段に記憶させる網羅率測定制御手段と、主記
憶上での評価対象プログラムの全命令語のアドレスを得
る命令語解析手段と、 該命令語解析手段で得られた評価対象プログラムの全命
令語のアドレスと、前記実行済命令領域情報記憶手段に
記憶された実行済命令領域情報とに基づいて、評価対象
プログラムにおける実行済命令の比率をプログラムy4
羅率として算出して出力装置から出力すると共に、実行
済命令と未実行命令とが識別できるように且つ前記アド
レス変換手段によりモジュール名とモジュール内相対ア
ドレスとに変換した命令語のアドレスを前記出力装置か
ら出力する測定結果編集出力制御手段とを有する。
In order to achieve the above object, the present invention executes a branch instruction in a program in response to the setting of a branch instruction interrupt mode, and sets a pre-branch address and a post-branch address before the first instruction after the branch is executed. In a computer system that has a branch instruction interrupt mechanism that stores internal interrupts and generates internal interrupts, it stores control information including module names, start addresses expressed as absolute addresses, and end addresses of all modules that make up the program to be evaluated. control information holding means; address conversion means for converting an absolute address into a module name and an intra-module relative address by referring to the control information held by the control information holding means; and a post-branch address for storing the post-branch address. address storage means; executed instruction area information storage means; when an internal interrupt occurs by the branch instruction interrupt mechanism, a pre-branch address held in the branch instruction interrupt mechanism and a pre-branch address stored in the post-branch address storage means; The range indicated by the post-branch address is stored as executed instruction area information in the executed instruction area information storage means, and the post-branch address held in the branch instruction interrupt mechanism is stored in the post-branch address storage means. a coverage measurement control means for storing the addresses of all the instruction words of the program to be evaluated on the main memory; and the executed instruction area information stored in the executed instruction area information storage means, calculate the ratio of executed instructions in the program to be evaluated.
outputting from the output device the address of the instruction word which has been converted into a module name and an intra-module relative address by the address conversion means so that executed instructions and unexecuted instructions can be distinguished. and measurement result editing/output control means for outputting from the device.

〔作用〕[Effect]

評価対象プログラム中の分岐命令が実行されると、分岐
命令割込機構によって分岐前アドレスと分岐後アドレス
とが保持されて内部割込みが発生される。この内部割込
みが発生すると、′fR羅率車側制御手段は、分岐命令
割込機構に保持された分岐前アドレスと、分岐後アドレ
ス記憶手段に記憶されていた前回の分岐後アドレスとで
示される範囲を実行済命令領域情報として実行済命令領
域情報記憶手段に記憶させると共に、分岐命令割込機構
に今回保持された分岐後アドレスを分岐後アドレス記憶
手段に記憶させる。このような処理は、評価対象プログ
ラム中の分岐命令が実行される毎に行なわれ、その結果
、評価対象プログラムの実行終了時には、評価対象プロ
グラムの領域のうち実行済命令の領域を示す情報が実行
済命令領域情報記憶手段に記憶されることになる。その
後、測定結果編集出力制御手段によって、命令語解析手
段から得た評価対象プログラムの全命令語のアドレスと
、実行済命令領域情報記憶手段に記憶された実行済命令
領域情報とに基づいて、評価対象プログラムにおける実
行済命令の比率がプログラム網羅率として算出されると
共に、実行済命令と未実行命令とが識別できるように且
つアドレス変換手段によりモジュール名とモジュール内
相対アドレスとに変換された命令語のアドレスが出力装
置から出力される。
When a branch instruction in the program to be evaluated is executed, the branch instruction interrupt mechanism holds the pre-branch address and post-branch address and generates an internal interrupt. When this internal interrupt occurs, the ``fR control'' vehicle side control means uses the pre-branch address held in the branch instruction interrupt mechanism and the previous post-branch address stored in the post-branch address storage means. The range is stored as executed instruction area information in the executed instruction area information storage means, and the post-branch address held this time by the branch instruction interrupt mechanism is stored in the post-branch address storage means. Such processing is performed every time a branch instruction in the program to be evaluated is executed, and as a result, when the program to be evaluated finishes execution, information indicating the area of executed instructions in the area of the program to be evaluated is It will be stored in the completed instruction area information storage means. Thereafter, the measurement result editing output control means performs evaluation based on the addresses of all instructions of the evaluation target program obtained from the instruction word analysis means and the executed instruction area information stored in the executed instruction area information storage means. The ratio of executed instructions in the target program is calculated as the program coverage rate, and the instruction word is converted into a module name and an intra-module relative address by an address conversion means so that executed instructions and unexecuted instructions can be distinguished. address is output from the output device.

〔実施例〕〔Example〕

次に本発明の実施例について図面を参照して説明する。 Next, embodiments of the present invention will be described with reference to the drawings.

第1図は本発明のプログラム網羅率測定方式の一実施例
のブロック図である。本実施例のプログラム網羅率測定
方式は、入力操作が行なわれる入力装置1と、プログラ
ム網羅率測定装置11t2と、中央処理装置3と、主記
憶装置4と、出力装置5とで構成されている。
FIG. 1 is a block diagram of an embodiment of the program coverage measurement method of the present invention. The program coverage measurement method of this embodiment is composed of an input device 1 on which input operations are performed, a program coverage measurement device 11t2, a central processing unit 3, a main storage device 4, and an output device 5. .

中央処理装置3内には、プログラム走行時の優先レベル
の指定を含む分岐命令割込みモードの設定に応答して、
前記指定された優先レベルのプログラム中の分岐命令の
実行により、分岐後最初の命令が実行される前に前記優
先レベルと分岐前アドレスと分岐後アドレスとを保持し
て内部割込みを発生させる分岐命令割込機構30が設け
られている。また、プログラム網羅率測定装置2は、入
力情報解析部20と、網羅率測定制御部21と、優先レ
ベル毎に分岐後アドレスを格納し得る分岐後アドレス記
憶部22と、実行済命令領域情報記憶部23と、測定結
果編集出力制御部24と、命令語解析部25と、w4i
率算出部26と、アドレス変換部27と、モジエール制
御情報部2日とを有する。
In the central processing unit 3, in response to the setting of the branch instruction interrupt mode including the specification of the priority level during program execution,
A branch instruction that maintains the priority level, pre-branch address, and post-branch address and generates an internal interrupt before the first instruction after the branch is executed by executing a branch instruction in the program with the specified priority level. An interrupt mechanism 30 is provided. The program coverage measurement device 2 also includes an input information analysis section 20, a coverage measurement control section 21, a post-branch address storage section 22 that can store post-branch addresses for each priority level, and an executed instruction area information storage section. unit 23, measurement result editing output control unit 24, instruction word analysis unit 25, w4i
It has a rate calculation section 26, an address conversion section 27, and a mosier control information section 2.

主記憶装置4には、複数のモジュール4L 42゜・・
・、 4nから構成される評価対象プログラムPRが存
在し、それぞれのモジュール4L 42.−・・、 4
nの先頭アドレスは31,32.・・・、Sn番地であ
り、同じく終了アドレスはEl、E2.・・・、 En
番地である。なお、評価対象プログラムPRのプログラ
ム走行時の優先レベルは(1)とする。
The main storage device 4 includes a plurality of modules 4L 42°...
・There is an evaluation target program PR consisting of 4n, and each module 4L 42. -..., 4
The starting address of n is 31, 32. . . , the Sn address, and the ending address is El, E2 . ..., En
It is a street address. Note that the priority level of the evaluation target program PR during program running is (1).

プログラム網羅率測定装置2内のモジュール制御情報部
28には、モジエール41.42.・・・、 4nのモ
ジュール名(aaaaa、bbbbb、 ”’、nnn
rln)と、モジュール41.42. ・”、 4nの
先頭アドレス(31,S2゜−・・、Sn)と、モジュ
ール41.42.−、4nの終了アドレス(El、E2
.・・・、En)とが制御情報として登録されており、
アドレス変換部27によりて参照されるようになってい
る。
The module control information section 28 in the program coverage measuring device 2 contains modules 41, 42. ..., 4n module name (aaaaa, bbbbb, "', nnn
rln) and modules 41.42.・”, the start address of module 4n (31, S2゜-..., Sn) and the end address of module 41.42.-, 4n (El, E2
.. ..., En) are registered as control information,
It is referenced by the address conversion unit 27.

次に、このように構成された本実施例のプログラム!i
l!!車側測定方式の動作について説明する。
Next, the program of this example configured in this way! i
l! ! The operation of the vehicle-side measurement method will be explained.

本実施例では、主記憶装置4に存在する複数の評価対象
プログラムのプログラム′IJ4羅率を、各々単独に測
定することもでき、優先レベルの異なる複数の評価対象
プログラムの網羅率を同時に測定することもできる。今
は、一つの評価対象プログラムPRについて、そのプロ
グラム網羅率を測定するものとする。この場合、入力袋
W1からプログラム網羅率測定装置2の入力情報解析部
20を介して、評価対象プログラムPRの優先レベルで
ある(1)を、網羅率測定制御部21に通知する。
In this embodiment, the program 'IJ4 coverage rates of a plurality of evaluation target programs existing in the main storage device 4 can be measured individually, and the coverage rates of a plurality of evaluation target programs with different priority levels can be measured simultaneously. You can also do that. Assume now that the program coverage rate of one evaluation target program PR is to be measured. In this case, the priority level (1) of the evaluation target program PR is notified to the coverage measurement control section 21 from the input bag W1 via the input information analysis section 20 of the program coverage measurement device 2.

この通知を受けた網羅率測定制御部21は、優先レベル
(11を分岐命令割込みモードにして分岐命令割込機構
30を起動すると共に、優先レベル+11に対応する分
岐後アドレス記憶部22内の分岐後アドレスをゼロに初
期化する。この後、主記憶装置4内での評価対象プログ
ラムPRが起動される。
Upon receiving this notification, the coverage measurement control unit 21 sets the priority level (11) to the branch instruction interrupt mode and activates the branch instruction interrupt mechanism 30, and also sets the priority level (11) to the branch instruction interrupt mode and activates the branch instruction interrupt mechanism 30. The rear address is initialized to 0. After this, the evaluation target program PR in the main storage device 4 is started.

評価対象プログラムPRの実行中、分岐命令が実行され
ると、中央処理装置3の分岐命令割込機構30は、走行
中の優先レベル(1)1分岐後アドレス。
When a branch instruction is executed during execution of the evaluation target program PR, the branch instruction interrupt mechanism 30 of the central processing unit 3 receives the running priority level (1) 1 post-branch address.

分岐前アドレスを保持して分岐先のアドレスで分岐命令
割込みを発生させ、プログラム網羅率測定装置2の網羅
率測定制御部21を動作させる。
The pre-branch address is held, a branch instruction interrupt is generated at the branch destination address, and the coverage measurement control unit 21 of the program coverage measurement device 2 is operated.

網羅率測定制御部21は、分岐命令割込機構30に保持
された優先レベルil+と分岐命令自身のアドレスであ
る分岐前アドレスとこの分岐命令の分岐先である分岐後
アドレスとを分岐命令割込機構30から受取り、分岐後
アドレス記憶部22内のその優先レベル(11に対応す
る分岐後アドレスから今回受取った分岐前アドレスまで
の範囲を実行済命令領域情報として実行済命令領域情報
記憶部23内に記憶すると共に、今回受取った分岐後ア
ドレスを今回受取った優先レベル(1)に対応する分岐
後アドレス記憶部22内の場所に記憶する。なお、y4
羅車側定制御部21は、優先レベル番号に対応する分岐
後アドレス記憶部22内の分岐後アドレスがゼロに初期
化されている最初の分岐命令割込み時には、分岐命令割
込機構30から通知された分岐後アドレスを今回の優先
レベルに対応させて分岐後アドレス記憶部22に記憶す
るだけであって、実行済命令領域情報を実行済命令領域
情報記憶部23に記憶することはしない0以上の動作を
行なった後、w4羅車側定制御部21は、評価対象プロ
グラムPRでの分岐後アドレスからの実行再開を分岐命
令割込機構30に指示し、次の分岐命令割込み待ちとな
る。
The coverage measurement control unit 21 uses the priority level il+ held in the branch instruction interrupt mechanism 30, the pre-branch address which is the address of the branch instruction itself, and the post-branch address which is the branch destination of this branch instruction as a branch instruction interrupt. The range from the post-branch address corresponding to the priority level (11) to the currently received pre-branch address in the post-branch address storage unit 22 is stored as executed instruction area information in the executed instruction area information storage unit 23. At the same time, the currently received post-branch address is stored in the location within the post-branch address storage unit 22 corresponding to the currently received priority level (1).
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 is initialized to zero, the branch-side specific control unit 21 receives a notification from the branch instruction interrupt mechanism 30. The post-branch address corresponding to the current priority level is simply stored in the post-branch address storage unit 22, and the executed instruction area information is not stored in the executed instruction area information storage unit 23. After performing the operation, the w4 vehicle side control unit 21 instructs the branch instruction interrupt mechanism 30 to resume execution from the post-branch address in the evaluation target program PR, and waits for the next branch instruction interrupt.

第2図は評価対象プログラムPRを構成する一つのモジ
ュール41のアドレスPOからアドレスP4までのルー
チンを例にとって、実行済命令領域情報を実行済命令領
域情報記憶部23に記憶する際の動作を説明した図であ
る。モジュール41において、アドレスPG、P1.P
2.P3.P4は分岐命令の分岐先アドレス(分岐後ア
ドレス)であり、アドレスBl、B2.B3.B4は分
岐命令自身のアドレス(分岐前アドレス)である。まず
、モジュール41のアドレスPOに分岐する分岐命令が
実行されると、分岐命令割込機構30によって分岐命令
割込みが発生し、網羅率測定制御部21が動作する。w
4fI率測定制御部21は分岐命令割込機構30から通
知される分岐後アドレスPOを分岐後アドレス記憶部2
2に優先レベル+11に対応して記憶する(ここでは、
アドレスPOに分岐する前の実行済命令領域情報の記憶
手順の説明は省略している)。
FIG. 2 explains the operation when storing executed instruction area information in the executed instruction area information storage unit 23, taking as an example the routine from address PO to address P4 of one module 41 that constitutes the evaluation target program PR. This is a diagram. In module 41, addresses PG, P1 . P
2. P3. P4 is the branch destination address (post-branch address) of the branch instruction, and addresses B1, B2 . B3. B4 is the address of the branch instruction itself (pre-branch address). First, when a branch instruction to branch to the address PO of the module 41 is executed, a branch instruction interrupt is generated by the branch instruction interrupt mechanism 30, and the coverage measurement control section 21 operates. lol
The 4fI rate measurement control unit 21 stores the post-branch address PO notified from the branch instruction interrupt mechanism 30 in the post-branch address storage unit 2.
2 is stored in correspondence with the priority level +11 (here,
(The explanation of the procedure for storing executed instruction area information before branching to address PO is omitted.)

次に、モジュール41のアドレスB1での分岐命令が実
行され、分岐先であるアドレスP1で分岐命令割込みが
発生すると、網羅率測定制御部21は分岐命令割込機構
30から通知される分岐前アドレスB1と、このとき分
岐後アドレス記憶部22に優先レベル(11対応に記憶
されたアドレスPOとの範囲を、実行済命令領域情報M
1として実行済命令領域情報記憶部23に記憶し、その
後分岐前アドレスB1とともに通知された分岐後アドレ
スP1を分岐後アドレス記憶部22の優先レベル+11
対応の位置へ記憶する。同様に、アドレスB2.B3.
B4の分岐命令の実行によってそれぞれアドレスP2゜
P3.P4で分岐命令割込みが発生し、網羅率測定制御
部21によってそれぞれ実行済命令領域情報M2.M3
.M4が実行済命令領域情軸記憶部23に記憶される。
Next, when the branch instruction at address B1 of the module 41 is executed and a branch instruction interrupt occurs at address P1, which is the branch destination, the coverage measurement control unit 21 receives the pre-branch address notified from the branch instruction interrupt mechanism 30. The range between B1 and the address PO stored in the post-branch address storage unit 22 in correspondence with the priority level (11) is stored in the executed instruction area information M.
1 in the executed instruction area information storage unit 23, and then the post-branch address P1 notified together with the pre-branch address B1 is set to the priority level of the post-branch address storage unit 22+11.
Store in the corresponding location. Similarly, address B2. B3.
By executing the branch instruction B4, addresses P2, P3, . A branch instruction interrupt occurs at P4, and the coverage measurement control unit 21 records executed instruction area information M2. M3
.. M4 is stored in the executed instruction area information storage section 23.

第3図は実行済命令領域情報記憶部23の記憶内容の一
例を示す図である。この実施例の実行済命令領域情報記
憶部23は、主記憶の各番地と1対1で対応するビット
を有し、例えばビット番号00ビツトは主記憶上の0番
地に、ビット番号100のビットは主記憶上の100番
地に対応している。
FIG. 3 is a diagram showing an example of the stored contents of the executed instruction area information storage section 23. As shown in FIG. The executed instruction area information storage unit 23 of this embodiment has bits that correspond one-to-one with each address in the main memory. For example, the bit number 00 bit is stored at address 0 in the main memory, and the bit number 100 corresponds to address 100 on the main memory.

そして、実行法命令の番地に対応するビット番号のビッ
トはオンにされ、′未実行命令の番地に対応するピント
はオフにされるように使用される。例えば、モジュール
41を例にすると、その主記憶上での先頭アドレスは8
1番地で終了アドレスはE1番地であるため、モジュー
ル41の実行済命令領域情報は、第3図の実行済命令領
域情報記憶部23のビット番号S1からビット番号E1
の範囲の記憶エリア23−1に記憶される。実行済命令
領域情報記憶エリア23−1には、第2図で説明した実
行済命令領域情報M1.M2.M3.M4が存在し且つ
実行済命令領域情報M1.M2.M3.M4に含まれる
全てのビットはオンである。同様に、実行済命令領域情
報記憶エリア23−1のうち、モジs−ル41の実行さ
れた他の命令領域に対応するビットも、実行済命令領域
情報Ml、 M2. M3. M4と同様にオンであり
、その他のビット即ちモジュール41の未実行の命令領
域に対応するビットはオフになっている。
Then, the bit of the bit number corresponding to the address of the execution method instruction is turned on, and the bit corresponding to the address of the unexecuted instruction is turned off. For example, taking module 41 as an example, its starting address on main memory is 8.
1 and the end address is address E1, the executed instruction area information of the module 41 is from bit number S1 to bit number E1 of executed instruction area information storage section 23 in FIG.
It is stored in the storage area 23-1 in the range of . The executed instruction area information storage area 23-1 stores executed instruction area information M1. M2. M3. M4 exists and executed instruction area information M1. M2. M3. All bits contained in M4 are on. Similarly, bits corresponding to other executed instruction areas of the module 41 in the executed instruction area information storage area 23-1 are also stored as executed instruction area information M1, M2. M3. Like M4, it is on, and the other bits, ie, the bits corresponding to the unexecuted instruction area of module 41, are off.

さて、第1図において、評価対象プログラムPRの実行
終了後、優先レベルfilの分岐命令割込みモード解除
指令が入力装置1から入力情報解析部20を介してy4
羅車側定制御部21に通知されると、WIfI率測定制
御部21は、優先レベル(1)の分岐命令割込みモード
を解除して分岐命令割込機構30を停止すると共に、優
先レベル(1)の評価対象プログラムPRに対する測定
結果を編集出力するように測定結果[集出力制御部24
に指示する。
Now, in FIG. 1, after the execution of the evaluation target program PR is completed, a branch instruction interrupt mode release command of priority level fil is sent from the input device 1 via the input information analysis unit 20 to y4.
When the WIFI rate measurement control unit 21 is notified, the WIfI rate measurement control unit 21 cancels the branch instruction interrupt mode of the priority level (1) and stops the branch instruction interrupt mechanism 30, and also cancels the branch instruction interrupt mode of the priority level (1). ) to edit and output the measurement results for the evaluation target program PR.
instruct.

この指示を受けた測定結果編集出力制御部24は、命令
語解析部25に対して811番左らEn番地までの全命
令語のアドレスを報告するように指示する。命令語解析
部25はこれに応答して、311番左らEn番地までの
全命令語を解釈して全命令語のアドレスを測定結果編集
出力制御部24に逐次報告する。
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 811th left to address En. In response to this, the instruction word analysis section 25 interprets all the instruction words from the left of No. 311 to address En, and sequentially reports the addresses of all the instruction words to the measurement result editing output control section 24.

測定結果編集出力制御部24は、命令語解析部25から
命令語のアドレスが報告されると、その報告されたアド
レスと、実行済命令領域情報記憶部23内のビットの状
態とに基づき、ビットがオフであるアドレス即ち未実行
命令のアドレスだけを出力すべきアドレスとして選択す
る。この選択されたアドレスは絶対アドレスであり、後
述するようにアドレス変換部27を使用して、その絶対
アドレスをモジュール名とモジュール内相対アドレスに
変換し、出力袋W5から出力する。
When the instruction word address is reported from the instruction word analysis section 25, the measurement result editing output control section 24 edits the bit based on the reported address and the state of the bit in the executed instruction area information storage section 23. Only addresses for which OFF is selected, that is, addresses of unexecuted instructions, are selected as addresses to be output. This selected address is an absolute address, and as will be described later, the address converter 27 is used to convert the absolute address into a module name and an intra-module relative address, and output from the output bag W5.

更に、測定結果編集出力制御部24は、命令語解析部2
5により逐次報告される命令語の個数をカウントすると
共に、報告された命令語のアドレスに対応する実行済命
令領域情報記憶エリアのビットがオンである回数つまり
実行法命令語数をカウントしており、最後にそれらのカ
ウント値に基づいて実行法命令語数の全命令語数に対す
る比率を網羅率算出部26に求めさせる。網羅率算出部
26は、上記のカウント値に基づき、例えば実行法命令
語数を全命令語数で除算した結果を百分率などの形式で
求め、測定結果編集出力制御部24に通知する。
Furthermore, the measurement result editing output control section 24 controls the instruction word analysis section 2.
5 counts the number of instruction words that are sequentially reported, and also counts the number of times the bit in the executed instruction area information storage area corresponding to the address of the reported instruction word is on, that is, the number of execution method instruction words. Finally, based on these count values, the coverage calculation unit 26 calculates the ratio of the number of execution method command words to the total number of command words. The coverage calculation unit 26 calculates the result of dividing the number of execution method command words by the total number of command words, for example, in the form of a percentage based on the above-mentioned count value, and notifies the measurement result editing output control unit 24 .

測定結果編集出力制御部24は、この算出結果を評価対
象プログラム41に対するプログラム網羅率として出力
装置5に出力する。
The measurement result editing output control unit 24 outputs this calculation result to the output device 5 as a program coverage rate for the evaluation target program 41.

次に、絶対アドレスをモジュール名とモジエール内相対
アドレスに変換する際の動作を、仮に、モジエール41
の先頭アドレスS1が1000番地で、モジュール42
の先頭アドレスS2が1500番地であるとし、絶対ア
ドレス1234番地を変換する場合を例に挙げて説明す
る。
Next, we will explain the operation when converting an absolute address into a module name and a relative address within the module.
The start address S1 of the module is 1000, and the module 42
Assuming that the start address S2 of the file is address 1500, an example will be explained in which the absolute address address 1234 is to be converted.

測定結果編集出力制御部24は、絶対アドレス1234
番地を変換する場合、その絶対アドレス1234番地を
アドレス変換部27に通知して変換を指示する。この指
示が与えられると、アドレス変換部27は、モジュール
制御情報部28内の先頭アドレスSt、32.・・・、
3nと終了アドレスEl。
The measurement result editing output control unit 24 uses the absolute address 1234
When converting an address, the absolute address 1234 is notified to the address conversion unit 27 to instruct conversion. When this instruction is given, the address converter 27 converts the start addresses St, 32 . ...,
3n and end address El.

E2.・・・、Enとを参照して、絶対アドレス123
4番地を含むモジュール41のモジュール名(aaaa
a)及び先頭アドレスS1を取得し、モジュール内相対
アドレス234 (=1234−3l)番地を算出して
先頭アドレスS1と共に測定結果編集出力制御部24に
通知する。
E2. . . , with reference to En, the absolute address 123
Module name of module 41 including address 4 (aaaa
a) and the start address S1, calculate the intra-module relative address 234 (=1234-3l), and notify the measurement result editing output control unit 24 together with the start address S1.

測定結果編集出力制御部24は、以上のような処理を、
未実行命令の全ての絶対アドレスに対し繰返し行なうも
のである。
The measurement result editing output control unit 24 performs the above processing,
This is repeated for all absolute addresses of unexecuted instructions.

上述のようにして求められた評価対象プログラムPRの
プログラム網羅率、及び未実行命令のモジュール内相対
アドレスとモジュール名とは、測定結果編集出力制御部
24で編集された後、例えば第4図に示すような形式で
出力装置5から出力される。
The program coverage rate of the evaluation target program PR and the intra-module relative address and module name of unexecuted instructions obtained as described above are edited by the measurement result editing output control unit 24, and then are shown in FIG. 4, for example. It is output from the output device 5 in the format shown.

以上の動作は、一つの評価対象プログラム網羅率独の測
定例であるが、本実施例では分岐後アドレス記憶部22
に分岐後アドレスを優先レベル毎に記憶させることがで
きるため、入力装置1から複数の優先レベルを指定する
ことにより、複数の異なる!先しベルの評価対象プログ
ラムについて同時にプログラム網羅率等の測定が可能で
ある。このとき、複数の評価対象プログラムの実行終了
後、入力装置1から複数の優先レベルの分岐命令割込み
モード解除指令が入力されることにより、mnn測測定
制御部21逐次各評価対象プログラムのプログラム網羅
率、未実行命令アドレスの算出処理を制御するものであ
る。
The above operation is an example of measuring the coverage rate of one evaluation target program, but in this embodiment, the post-branch address storage unit 22
Since the post-branch address can be stored for each priority level, by specifying multiple priority levels from the input device 1, multiple different addresses can be stored. It is possible to simultaneously measure the program coverage rate, etc. of the programs to be evaluated in advance. At this time, after the execution of the plurality of evaluation target programs is completed, branch instruction interrupt mode release commands of a plurality of priority levels are input from the input device 1, so that the mnn measurement control unit 21 sequentially updates the program coverage rate of each evaluation target program. , which controls the calculation process of unexecuted instruction addresses.

〔発明の効果〕〔Effect of the invention〕

以上説明したように、本発明は、分岐命令割込みを利用
して実行済命令領域情報を評価対象プログラムの実行過
程で逐次記憶し、評価対象プログラムの実行終了後、そ
の記憶された実行済命令領域情報をもとに、評価対象プ
ログラムの実行済命令の比率を算出するようにしたもの
であり、評価対象プログラムに細工を行なうことなく、
実行済命令数の比率をプログラム網羅率として測定する
ことができる。従って、評価対象プログラムの評価度合
を正確に把握することができる効果がある。
As explained above, the present invention uses branch instruction interrupts to sequentially store executed instruction area information during the execution process of the evaluation target program, and after the execution of the evaluation target program is completed, the executed instruction area information is stored in the stored executed instruction area. Based on the information, the ratio of executed instructions of the program to be evaluated is calculated, without any modification to the program to be evaluated.
The ratio of the number of executed instructions can be measured as the program coverage rate. Therefore, it is possible to accurately grasp the evaluation level of the program to be evaluated.

また、評価対象プログラムの実行済命令数の比率を出力
する以外に、実行済命令と未実行命令とが識別できるよ
うにして命令語のアドレスを併せて出力したことにより
、評価対象プログラムのどの命令が未実行命令であるか
等の判別ができる。
In addition to outputting the ratio of the number of executed instructions in the program to be evaluated, we also output the address of the instruction word so that executed instructions and unexecuted instructions can be distinguished. It is possible to determine whether the command is an unexecuted instruction, etc.

従って、次の評価ステップでは未実行命令に着目した評
価を行なうことができ、効率良くプログラムの評価度合
を向上することができる。
Therefore, in the next evaluation step, evaluation can be performed focusing on unexecuted instructions, and the degree of evaluation of the program can be efficiently improved.

更に、未実行命令のアドレスは、モジエール名とモジュ
ール内相対アドレスとに変換した形式で出力しているの
で、リンカによって出力されるアドレスマツプからモジ
ュールの先頭アドレスを捜した後、モジュール内相対ア
ドレスを人手によって計算する必要がなくなり、より一
層簡単且つ正確に未実行命令の特定が可能となる。
Furthermore, since the address of an unexecuted instruction is output in a format converted into a module name and a relative address within the module, after searching for the start address of the module from the address map output by the linker, the relative address within the module is output. There is no need for manual calculation, and unexecuted instructions can be identified more easily and accurately.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の実施例のブロック図、第2図は実行済
命令領域情報を実行済命令領域情報記憶部23に記憶す
る際の動作説明図、第3図は実行済命令領域情報記憶部
23の記憶内容の一例を示す図および、 第4図は測定結果の出力例を示す図である。 図において、 l・・・入力装置 2・・・プログラム網羅率測定装置 3・・・中央処理装置 4・・・主記憶装置 5・・・出力装置 20・・・入力情報解析部 21・・・網羅率測定制御部 22・・・分岐後アドレス記憶部 23・・・実行済命令領域情報記憶部 24・・・測定結果編集出力制御部 25・・・命令語解析部 26・・・M@羅車側出部 27・・・アドレス変換部 28・・・モジエール制御情報部 30・・・分岐命令割込機構 41〜4n・・・モジュール PR・・・評価対象プログラム
FIG. 1 is a block diagram of an embodiment of the present invention, FIG. 2 is an explanatory diagram of the operation when storing executed instruction area information in the executed instruction area information storage section 23, and FIG. 3 is an executed instruction area information storage FIG. 4 is a diagram showing an example of the storage contents of the unit 23, and FIG. 4 is a diagram showing an example of output of measurement results. In the figure, l...Input device 2...Program coverage measurement device 3...Central processing unit 4...Main storage device 5...Output device 20...Input information analysis unit 21... Coverage rate measurement control unit 22...Post-branch address storage unit 23...Executed instruction area information storage unit 24...Measurement result editing output control unit 25...Instruction word analysis unit 26...M@L Vehicle side output section 27...Address conversion section 28...Mosier control information section 30...Branch instruction interrupt mechanism 41 to 4n...Module PR...Evaluation target program

Claims (1)

【特許請求の範囲】 分岐命令割込みモードの設定に応答して、プログラム中
の分岐命令の実行により、分岐後最初の命令が実行され
る前に分岐前アドレスと分岐後アドレスとを保持して内
部割込みを発生させる分岐命令割込機構を有する計算機
システムにおいて、評価対象プログラムを構成する全モ
ジュールのモジュール名、絶対アドレスで表現された先
頭アドレス及び終了アドレスを含む制御情報を保持する
制御情報保持手段と、 該制御情報保持手段によって保持された前記制御情報を
参照して絶対アドレスをモジュール名とモジュール内相
対アドレスとに変換するアドレス変換手段と、 前記分岐後アドレスを記憶する分岐後アドレス記憶手段
と、 実行済命令領域情報記憶手段と、 前記分岐命令割込機構による内部割込み発生時、前記分
岐命令割込機構に保持された分岐前アドレスと、前記分
岐後アドレス記憶手段に記憶された分岐後アドレスとで
示される範囲を実行済命令領域情報として前記実行済命
令領域情報記憶手段に記憶させると共に、前記分岐命令
割込機構に保持された分岐後アドレスを前記分岐後アド
レス記憶手段に記憶させる網羅率測定制御手段と、 主記憶上での評価対象プログラムの全命令語のアドレス
を得る命令語解析手段と、 該命令語解析手段で得られた評価対象プログラムの全命
令語のアドレスと、前記実行済命令領域情報記憶手段に
記憶された実行済命令領域情報とに基づいて、評価対象
プログラムにおける実行済命令の比率をプログラム網羅
率として算出して出力装置から出力すると共に、実行済
命令と未実行命令とが識別できるように且つ前記アドレ
ス変換手段によりモジュール名とモジュール内相対アド
レスとに変換した命令語のアドレスを前記出力装置から
出力する測定結果編集出力制御手段とを含むことを特徴
とするプログラム網羅率測定方式。
[Claims] In response to the branch instruction interrupt mode setting, by executing a branch instruction in the program, the pre-branch address and post-branch address are held and internally stored before the first instruction after the branch is executed. In a computer system having a branch instruction interrupt mechanism that generates an interrupt, a control information holding means that holds control information including module names, a start address expressed as an absolute address, and an end address of all modules constituting an evaluation target program; , address conversion means for converting an absolute address into a module name and an intra-module relative address by referring to the control information held by the control information holding means; post-branch address storage means for storing the post-branch address; an executed instruction area information storage means; a pre-branch address held in the branch instruction interrupt mechanism when an internal interrupt occurs by the branch instruction interrupt mechanism; and a post-branch address stored in the post-branch address storage means; Coverage rate measurement in which the range indicated by is stored in the executed instruction area information storage means as executed instruction area information, and the post-branch address held in the branch instruction interrupt mechanism is stored in the post-branch address storage unit. control means; instruction word analysis means for obtaining addresses of all instruction words of the evaluation target program on main memory; addresses of all instruction words of the evaluation target program obtained by the instruction word analysis means; and the executed instructions. Based on the executed instruction area information stored in the area information storage means, the ratio of executed instructions in the evaluation target program is calculated as a program coverage rate and outputted from the output device, and the executed instructions and unexecuted instructions are calculated. and measurement result editing output control means for outputting from the output device the address of the instruction word converted by the address conversion means into a module name and an intra-module relative address so that the instruction word can be identified. Measurement method.
JP62276359A 1987-10-31 1987-10-31 Measurement system for program comprehension rate Pending JPH01118937A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62276359A JPH01118937A (en) 1987-10-31 1987-10-31 Measurement system for program comprehension rate

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62276359A JPH01118937A (en) 1987-10-31 1987-10-31 Measurement system for program comprehension rate

Publications (1)

Publication Number Publication Date
JPH01118937A true JPH01118937A (en) 1989-05-11

Family

ID=17568329

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62276359A Pending JPH01118937A (en) 1987-10-31 1987-10-31 Measurement system for program comprehension rate

Country Status (1)

Country Link
JP (1) JPH01118937A (en)

Similar Documents

Publication Publication Date Title
Cousins Welcome to ros topics [ros topics]
US20030005416A1 (en) Fault search method and apparatus
JP2006260542A (en) Determination of actual amount of time a processor consumes in executing code portion
CN109901549A (en) Automatic driving vehicle test processing method, device and electronic equipment
JPH01118937A (en) Measurement system for program comprehension rate
JPH01118938A (en) Measurement system for program comprehension rate
JPH01118936A (en) Measurement system for program comprehension rate
CN115096605A (en) Automobile test method, system, electronic equipment and storage medium
JPH01118935A (en) Measurement system for program comprehension rate
CN115081366B (en) Modeling method for sudden access of register
JPH04239337A (en) Measuring system for program comprehension rate
JPH04111145A (en) Microcomputer
JPS63300333A (en) Measurement system for number of times of instruction execution of program
JPS63223841A (en) Measuring system for program including rate
JPS63300332A (en) Measurement system for number of times of instruction execution of program
JPH03257548A (en) Measurement system for instruction executing frequency of program
JPS62162105A (en) Flow chart type programmable controller
CN117851150A (en) GPIO drive test system, method, device and storage medium
JP2002374167A (en) Analog input device for monitor control
JP3385790B2 (en) Language converter
JPH04241637A (en) System for measuring number of executed program instruction
JPH05119824A (en) Robot task planning device
JPH0795293B2 (en) Information processing equipment
JPS6337436A (en) Program development backup device
JPH0488426A (en) Program coverage measuring instrument