JPH01229341A - Program test method - Google Patents

Program test method

Info

Publication number
JPH01229341A
JPH01229341A JP63053491A JP5349188A JPH01229341A JP H01229341 A JPH01229341 A JP H01229341A JP 63053491 A JP63053491 A JP 63053491A JP 5349188 A JP5349188 A JP 5349188A JP H01229341 A JPH01229341 A JP H01229341A
Authority
JP
Japan
Prior art keywords
program
change
coverage information
source code
information
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
JP63053491A
Other languages
Japanese (ja)
Inventor
Hiroyuki Suzuki
啓之 鈴木
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP63053491A priority Critical patent/JPH01229341A/en
Publication of JPH01229341A publication Critical patent/JPH01229341A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To obtain a program test system which considerably reduces a re-test operation by setting only coverage information in a range which is affected by means of a change when there is the change in a program, and succeeding other coverage information after the change. CONSTITUTION:The succeeding processing of coverage information is to map program execution history information recorded in a hardware mechanism 1, namely, extracted coverage information MT1 on an object code like OT1. Next, a program change influence range (AT1 of analysis processing mechanism 2 on a source code group ST2 after the change of the program is grasped. Coverage information beyond the range of change influence (coverage information corresponding to OBJ1 and OBJ2 of OT2) is succeeded on the object code of OT2 after the change of the program. Next, coverage information on the succeeded object code is mapped in a program execution history MT2 after the hardware mechanism 1 has information-succeeded coverage information.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はデータ処理システムにおけるプログラムテスト
方式に係り、特にプログラムの一部を変更した場合のカ
バレジ情報の継承に好適なプログラムテスト方式に関す
る。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a program test method in a data processing system, and particularly to a program test method suitable for inheritance of coverage information when a part of the program is changed.

〔従来の技術〕[Conventional technology]

プログラムのテストにおいては、ノ)−ドウエア機構を
用いて、機械コードレベルでの命令実行、分岐実行の有
無を把握するテスト力Aレジの概念が一般的になってい
る。この場合、従来はプログラムの一部に変更があり、
ソースコードの一部力を変わり、メモリ上にローディン
グされる機械語のメモリロケーシ式ンが変化すると、変
更前のプログラム全体のカバレジ情報をすべて無効とし
、全テストを再実行していた。なお、プログラムのテス
トとして関連するものには、例えば特開昭58−181
152号公報が挙げられる。
In program testing, the concept of a test force A register that uses a hardware mechanism to determine whether instructions are executed or branches are executed at the machine code level has become common. In this case, traditionally there was a change in part of the program,
When a part of the source code was changed and the memory location of the machine language loaded into memory was changed, all coverage information for the entire program before the change was invalidated and all tests were re-executed. In addition, related to program testing, for example, Japanese Patent Application Laid-Open No. 58-181
No. 152 is mentioned.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

通常、プログラム開発においては、一部分のソースコー
ドが変化する不良修正が数多く発生する。
Normally, during program development, many defective corrections that change part of the source code occur.

従来技術においては、このような場合も変更前のプログ
ラム全体のカバレジ情報をすべて無効とし、テストを繰
返すこと\なるため、テストの作業効率が悪いという問
題があった。
In the prior art, even in such a case, all the coverage information of the entire program before the change is invalidated and the test is repeated, which has the problem of poor test efficiency.

本発明の目的は、プログラムの変更があった場合、変更
で影響を受ける範囲のカバレジ情報のみ無効とし、他の
カバレジ情報は変更後に継承できるようにして、再テス
ト作業を大幅に減少させるプログラムテスト方式を提供
することにある。
An object of the present invention is to provide a program test in which, when a program is changed, only the coverage information affected by the change is invalidated, and other coverage information can be inherited after the change, thereby significantly reducing re-testing work. The goal is to provide a method.

〔課題を解決するための手段〕[Means to solve the problem]

上記目的は、メモリ上にローディングされるプログラム
のソースコード情報、該ソースコードとの命令対応情報
を含むオブジェクトコード情報を表わすテーブルを備え
、プログラムの変更があった場合、変更前のソースコー
ドと変更後のソースコードからプログラムの変更影響範
囲を解析し、変更前のプログラム実行履歴情報を、変更
後のオブジェクトコード上に変更影響範囲の履歴情報を
除いて継承することにより達成される。
The above purpose is to provide a table representing object code information including source code information of a program to be loaded into memory and instruction correspondence information with the source code, and when there is a change in the program, the source code before the change and the changed This is achieved by analyzing the scope of program change influence from the subsequent source code, and inheriting the program execution history information before the change to the object code after the change, excluding the history information of the change influence scope.

〔作 用〕[For production]

本発明では、機械語レベルでのプログラム履歴情報即ち
カバレジ情報とソースコードとの対応をとり、ソースコ
ード上で把握したプログラムの変更影響範囲を除いた部
分のカバレジ情報を継承している。それによって、プロ
グラムの変更影響範囲は、機械語レベルで単に命令が変
った部分のみを無効とするとか、変更のあったセクショ
ンすべてを無効とするとかではなく、ソースコード上で
論理的な制御フロー、データフローによって把握するこ
とが可能となるので、カバレジ情報の継承範囲を正確な
ものとすることができる。
In the present invention, program history information at the machine language level, that is, coverage information, corresponds to the source code, and the coverage information of the part excluding the program change influence range grasped on the source code is inherited. As a result, the scope of program change is not simply invalidating only the part where the instructions have changed at the machine language level, or invalidating all sections where the change has been made, but rather , it is possible to grasp the data flow, so the inheritance range of coverage information can be made accurate.

〔実施例〕〔Example〕

以下、本発明の一実施例について図面により説明する。 An embodiment of the present invention will be described below with reference to the drawings.

第1図は本発明の一実施例の概念図である。第1図で、
1はプログラムの実行履歴を採取し記録するハードウェ
ア機構、2はソースコード変更影響範囲解析処理機41
5を示す。MTIはカバレジ情報継承前のプログラム実
行履歴情報、MT2はカバレジ情報継承後のプログラム
実行履歴情報で。
FIG. 1 is a conceptual diagram of an embodiment of the present invention. In Figure 1,
1 is a hardware mechanism that collects and records program execution history; 2 is a source code change influence range analysis processor 41;
5 is shown. MTI is program execution history information before coverage information is inherited, and MT2 is program execution history information after coverage information is inherited.

ハードウェア機構1が保持する。OTIはプログラム変
更前のオブジェクトコードテーブル、OT2はプログラ
ム変更後のオブジェクトコードテーブル、ATLは変更
影響範囲のソースコード群、STIはプログラム変更前
のソースコード群、ST2はプログラム変更後のソース
コード群である。
The hardware mechanism 1 holds it. OTI is the object code table before the program change, OT2 is the object code table after the program change, ATL is the source code group affected by the change, STI is the source code group before the program change, and ST2 is the source code group after the program change. be.

各テーブル中のOB J iはオブジェクトコード、S
iはソースコードを表わす。
OB J i in each table is an object code, S
i represents source code.

今、プログラム変更前のソースコードとオブジェクトコ
ードとメモリ上のロケ−シコンとの対応は、OTIで表
わすごとく、Slはロケーション0の0BJIとロケー
ション1の0BJ2とに対応し、S2はロケーション2
の0BJ3と対応し。
Now, the correspondence between the source code, object code, and location controllers on memory before the program change is as shown by OTI. Sl corresponds to 0BJI at location 0 and 0BJ2 at location 1, and S2 corresponds to location 2.
Corresponds to 0BJ3.

S3はロケーション3の0BJ4とロケーション4の0
BJ5とに対応するものとする。また、プログラム変更
後のソースコードとオブジェクトコードとメモリ上のロ
ケーションとの対応は、OT2で表わすごとく、Slは
ロケーションOの0BJ1とロケーション1の0BJ2
とに対応し、82′はロケーション2の0BJ3’ と
ロケーション3のOB J 3 ”とに対応し、S3は
ロケーション4の0BJ4とロケーション5の0BJ5
に対応するものとする。プログラムはソースコードが8
2から32’ に変更したとし、プログラムの変更影響
範囲、すなわち再テストが必要なソースコード上での範
囲はS2’及びS3であったとし、MTIでのプログラ
ムの実行法ロケーションは0゜1.2.3とする。
S3 is location 3 0BJ4 and location 4 0
It corresponds to BJ5. Also, the correspondence between the source code, object code, and memory locations after the program change is as shown by OT2, where Sl is 0BJ1 at location O and 0BJ2 at location 1.
82' corresponds to 0BJ3' of location 2 and OB J 3' of location 3, and S3 corresponds to 0BJ4 of location 4 and 0BJ5 of location 5.
shall correspond to The program has 8 source codes
2 to 32', and the affected range of the program, that is, the range on the source code that requires retesting, is S2' and S3, and the program execution method location in MTI is 0°1. 2.3.

以下、第2図にしたがいカバレジ情報の継yA処理につ
いて説明する。なお、カバレジ情報の採取それ自体の処
理は周知であり、また1本発明の要旨とは直接関係がな
いので説明を省略する。
The coverage information relay process will be described below with reference to FIG. Note that the process of collecting coverage information itself is well known and is not directly related to the gist of the present invention, so a description thereof will be omitted.

ステップ11 ハードウェア機構1に記録されているプログラム実行履
歴情報、すなわち、既採取カバレジ情報MTIをオブジ
ェクトコード上にOTIのごとくマツピングする。
Step 11 Map the program execution history information recorded in the hardware mechanism 1, that is, the collected coverage information MTI, onto the object code like OTI.

ハードウェア機構1で採取したカバレジ情報MT1は、
ロケーション0〜3にローディングされた機械語が既に
テストで実行法(論理値(# I 11で示す)で、ロ
ケーション4にローディングされた機械語が未実行(論
理値“0″で示す)であったことを示している。まず、
ローディング情報からオブジェクトコードとロケーショ
ンを対応付ける。
The coverage information MT1 collected by the hardware mechanism 1 is
If the machine language loaded in locations 0 to 3 has already been tested and executed (indicated by a logical value of #I11), the machine language loaded in location 4 has not yet been executed (indicated by a logical value of “0”). First,
Associate object code and location from loading information.

例えば、ロケーション0にローディングされ、実行され
た機械語は0BJI、ロケーション4にローディングさ
れ未実行である機械語は0BJ5である。さらに、プロ
グラム変更前のソースコード群のコンパイル時にコンパ
イラから得られるソースコードとオブジェクトコードと
の対応情報をもったオブジェクトコード情報から、ソー
スコードとオブジェクトコードを対応付ける。例えば、
オブジェクトコードBOJ 1.OBJ 2はソースコ
ードS1のオブジェクト展開コードである。この場合、
コンパイラの最適化により、ひとつのオブジェクトコー
ドが複数のソースコードと対応することもある。
For example, the machine language loaded at location 0 and executed is 0BJI, and the machine language loaded at location 4 and not executed is 0BJ5. Further, the source code and the object code are associated with each other from object code information having correspondence information between the source code and the object code obtained from the compiler when the source code group before program change is compiled. for example,
Object code BOJ 1. OBJ 2 is an object expansion code of the source code S1. in this case,
Due to compiler optimization, one object code may correspond to multiple source codes.

以上のようにして、プログラム変更前のソースコード、
オブジェクトコード、ロケーション、カバレジ情報の対
応を示したテーブルOTIを得る。
As described above, the source code before program change,
A table OTI showing the correspondence between object code, location, and coverage information is obtained.

ステップ12 プログラム変更後のソースコード群ST2上でのプログ
ラム変更影響範囲(解析処理機構2のATl)を把握す
る。プログラムの変更前のソースコード群STIは、プ
ログラムの変更後のソースコード群ST2と、プログラ
ムの変更時に蓄積する変更差分ソースコード群から得る
こともできる。
Step 12: Ascertain the program change influence range (ATl of the analysis processing mechanism 2) on the source code group ST2 after the program change. The source code group STI before the program change can also be obtained from the source code group ST2 after the program change and the changed difference source code group accumulated when the program is changed.

こ\では、プログラムの変更により、ソースコードS2
はS2’ に変更されたものとし、ソースコードS1及
びS3は変更がなかったものとする。
In this case, source code S2 is changed due to program change.
It is assumed that S2' has been changed to S2', and that source codes S1 and S3 have not been changed.

まず、ソースコード変更影響範囲解析処理機構2では、
プログラム変更前のソースコード群ST1とプログラム
変更後のソースコード群ST2とから、変更ソースコー
ドS2’ を把握する。さらに、プログラム変更後のソ
ースコード群ST2を、例えば制御フロー解析やデータ
フロー解析を実行することにより、82′以外のソース
コード変更影響範囲(ATLでの83)を把握する。即
ち、制御フロー解析では、変更となったソースコード(
ATLでの82′)に加え、変更となったソースコード
(S2’)の実行後に制御が移る可能性のあるソースコ
ード(ATLでの33)を変更影響範囲とする。データ
フロー解析では、変更となったソースコード(ATLで
の82′)に加え、変更となったソースコード(S2’
)で使われた変数を使用しているソースコード(ATL
での83)を変更影響範囲とする。
First, in the source code change influence range analysis processing mechanism 2,
The changed source code S2' is grasped from the source code group ST1 before the program change and the source code group ST2 after the program change. Furthermore, by performing, for example, control flow analysis or data flow analysis on the source code group ST2 after the program change, the source code change influence range other than 82' (83 in ATL) is grasped. In other words, in control flow analysis, the changed source code (
In addition to the source code (82') in ATL, the source code (33 in ATL) to which control may be transferred after execution of the changed source code (S2') is set as the scope of change influence. In data flow analysis, in addition to the changed source code (82' in ATL), the changed source code (S2'
) source code (ATL) that uses the variables used in
83) is the scope of change influence.

ステップ13 プログラム変更後のオブジェクトコード(OT2のオブ
ジェクトコード)上に、変更影響範囲外のカバレジ情報
(OT2の0BJI、0BJ2に対応するカバレジ情報
)を継承する。
Step 13 Inherit coverage information outside the range of change influence (coverage information corresponding to 0BJI and 0BJ2 of OT2) on the object code after the program change (object code of OT2).

まず、OT2上に、プログラム変更後のソースコード群
のコンパイル時にコンパイラから得られるソースコード
とオブジェクトコードとの対応情報をもったオブジェク
トコード情報からソースコードとオブジェクトコードを
対応付ける。例えば、0BJ3’ 、0BJ3”はソー
スコードS2’ のオブジェクト展開コードである。こ
の場合、コンパイラの最適化により、ひとつのオブジェ
クトコードが複数のソースコードと対応することもある
First, source code and object code are associated on OT2 from object code information having correspondence information between source code and object code obtained from a compiler when compiling a source code group after a program change. For example, 0BJ3' and 0BJ3'' are object expansion codes of source code S2'. In this case, one object code may correspond to multiple source codes due to compiler optimization.

OT2における変更影響範囲(傘で示す)は、AT1情
報から得る。
The change influence range (indicated by an umbrella) in OT2 is obtained from the AT1 information.

カバレジ情報は、OTlとOT2とのソースコード及び
オブジェクトコードを対応させることにより継承する。
Coverage information is inherited by associating the source code and object code of OT1 and OT2.

例えば、OT2におけるソースコードS1に対応する0
BJI、OBJ2のカバレジ情報は、Slが変更影響範
囲のソースコードではないため、そのま\継承する(O
Tlのカバレジ情報が1であればOT2のカバレジ情報
を1、OTIのカバレジ情報がOであればOT2のカバ
レジ情報をOとする)、一方、OT2におけるソースコ
ードS2’S3に対応する0BJ3’ 、OBJ 3”
 、0BJ4.OBJ 5のカバレジ情報は、S2’及
びS3が変更影響範囲のソースコードであるため、カバ
レジ情報は無効とし、継承しない(OT2のカバレジ情
報をOとする)。
For example, 0 corresponding to source code S1 in OT2
The coverage information of BJI and OBJ2 is inherited as is (O
If the coverage information of Tl is 1, the coverage information of OT2 is set to 1, and if the coverage information of OTI is O, the coverage information of OT2 is set to O).On the other hand, 0BJ3' corresponding to source code S2'S3 in OT2, OBJ 3”
, 0BJ4. As for the coverage information of OBJ 5, since S2' and S3 are the source code in the scope of change influence, the coverage information is invalidated and is not inherited (the coverage information of OT2 is set to O).

OT2のカバレジ情報は、変更影響範囲外を1、変更影
響範囲をOで表わし、各オブジェクトコード毎にOTI
のカバレジ情報(OTlに対応のないオブジェクトコー
ドのカバレジ情報は0とする)との論理積を演算するこ
とにより得られる。コンパイラの最適化により、ひとつ
のオブジェクトコードが複数のソースコードと対応する
場合は、いずれかのソースコードが変更影響範囲であれ
ば、対応するオブジェクトコードが変更影響範囲である
とみなす。
The coverage information of OT2 is expressed as 1 for outside the change influence range and O for change influence range, and OTI for each object code.
(Coverage information for object codes that do not correspond to OTl is set to 0) with the coverage information of . When one object code corresponds to multiple source codes due to compiler optimization, if any source code is within the change-affected range, the corresponding object code is considered to be within the change-affected range.

ステップ14 継承されたオブジェクトコード上のカバレジ情報をハー
ドウェア機構1のカバレジ情報継承後のプログラム実行
履歴情報MT2にマツピングする。
Step 14 Map the coverage information on the inherited object code to the program execution history information MT2 of the hardware mechanism 1 after the inheritance of the coverage information.

こ\で、MTIとMT2は同一のハードウェア上のメモ
リアドレスに対応するプログラム実行履歴情報であって
も良い。まず、ローディング情報がらOT2のオブジェ
クトコードとロケーションとの対応が得られる。さらに
1例えば、OT2の情報からMT2のロケーションOに
は1を、ロケーション2にはOをマツピングする。
Here, MTI and MT2 may be program execution history information corresponding to memory addresses on the same hardware. First, the correspondence between the OT2 object code and location is obtained from the loading information. Furthermore, for example, 1 is mapped to location O of MT2 and O is mapped to location 2 from the information of OT2.

本実施例によれば、MTIのロケーション0及びロケー
ション1にローディングされていた機械語レベルのカバ
レジ情報を、MT2のロケーションO及びロケーション
1にローディングされた機械語レベルのカバレジ情報に
継承することができ、M’r2にロケーションO及びロ
ケーション1が既に実行法で再テスト不要であることを
示す機械語レベルのカバレジ情報を得ることができる。
According to this embodiment, the machine language level coverage information loaded into locations 0 and 1 of MTI can be inherited by the machine language level coverage information loaded into locations O and 1 of MT2. , M'r2, it is possible to obtain machine language level coverage information indicating that location O and location 1 are already executed and do not require retesting.

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

以上説明したように、本発明によれば、プログラムのテ
ストにおいて、機械語レベルで採取したカバレジ情報は
、プログラムの変更後においても、ソースコードレベル
でのプログラム影響範囲情報に基づいて継承できるので
、プログラムの変更によって再テストが必要な範囲のカ
バレジ情報は漏れなく無効化し、かつ、カバレジ情報の
無効化を最小限に押えたカバレジ情報の継承ができ、再
テスト作業の大幅な減少が可能になる。
As explained above, according to the present invention, coverage information collected at the machine language level during program testing can be inherited based on program influence range information at the source code level even after the program is changed. Coverage information in a range that requires retesting due to program changes can be invalidated without omission, and coverage information can be inherited with minimal invalidation of coverage information, making it possible to significantly reduce retesting work. .

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

第1図は本発明の一実施例の概念図、第2図は第1図に
よりカバレジ情報の継承処理を説明するためのフローチ
ャートである。 MTI・・・カバレジ情報継承前のプログラム実行履歴
情報、 MT2・・・カバレジ情報継承後のプログラム
実行履歴情報、 ○T1・・・プログラム変更前のオブ
ジェクトコードテーブル、OT2・・・プログラム変更
後のオブジェクトコードテーブル、 ATL・・・変更
影響範囲のソースコード群、  STI・・・プログラ
ム変更前のソースコード群、  Sr1・・・プログラ
ム変更後のソースコード群。
FIG. 1 is a conceptual diagram of an embodiment of the present invention, and FIG. 2 is a flowchart for explaining coverage information inheritance processing based on FIG. 1. MTI...Program execution history information before coverage information inheritance, MT2...Program execution history information after coverage information inheritance, ○T1...Object code table before program change, OT2...Object after program change Code table, ATL... Source code group in the change affected range, STI... Source code group before program change, Sr1... Source code group after program change.

Claims (1)

【特許請求の範囲】[Claims] (1)プログラムをテストし、その実行履歴を記録する
プログラムテスト方式において、プログラムのソースコ
ード情報、該ソースコードとの命令対応情報を含むオブ
ジェクトコード情報を表わすテーブルを備え、 プログラムの変更があった場合、変更前のソースコード
と変更後のソースコードからプログラムの変更影響範囲
を解析し、変更前のプログラム実行履歴情報を、変更後
のオブジェクトコード上に変更影響範囲の履歴情報を除
いて継承することを特徴とするプログラムテスト方式。
(1) In a program test method that tests a program and records its execution history, it is equipped with a table that represents object code information including program source code information and instruction correspondence information with the source code, and when a program change occurs. In this case, analyze the scope of program changes from the source code before the change and the source code after the change, and inherit the program execution history information before the change to the object code after the change, excluding the history information of the scope of change influence. A program testing method characterized by:
JP63053491A 1988-03-09 1988-03-09 Program test method Pending JPH01229341A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63053491A JPH01229341A (en) 1988-03-09 1988-03-09 Program test method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63053491A JPH01229341A (en) 1988-03-09 1988-03-09 Program test method

Publications (1)

Publication Number Publication Date
JPH01229341A true JPH01229341A (en) 1989-09-13

Family

ID=12944311

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63053491A Pending JPH01229341A (en) 1988-03-09 1988-03-09 Program test method

Country Status (1)

Country Link
JP (1) JPH01229341A (en)

Similar Documents

Publication Publication Date Title
US9274923B2 (en) System and method for stack crawl testing and caching
US6247146B1 (en) Method for verifying branch trace history buffer information
US6173395B1 (en) Mechanism to determine actual code execution flow in a computer
EP3387536A1 (en) Method and device for non-intrusively collecting function trace data
IE842859L (en) Self-testing of floating point accelerator processors
JPH03188535A (en) Program error detection method
EP1171821A1 (en) Method and apparatus for automated software testing
JPH0749799A (en) Automation device and method
US20040034852A1 (en) Simulation method and simulation system of instruction scheduling
US10593419B1 (en) Failing read count diagnostics for memory built-in self-test
US20040093536A1 (en) System and method for providing coherency during the evaluation of a multiprocessor system
CN118519842B (en) Automatic debugging method based on hardware virtualization
JP7770613B2 (en) Traceability information extraction device and traceability information verification device
JPS6324425A (en) Test comprehensive state detection system
WO2025203152A1 (en) Trace target signal selection device and trace target signal selection method
JPH05324402A (en) Program test status measurement method
JP3012618B1 (en) Debugging method of inspected program and its debugging method
JPS59195751A (en) Diagnostic system of information processing device
JPH0264822A (en) Error detecting method for file processing
JPH02242439A (en) Program load control system
JPS6269329A (en) Detecting system for breakage position of memory
JPH0411894B2 (en)
JPS6240550A (en) Program debug device
JPS6371738A (en) Program test managing and processing system
JPH02115953A (en) Simulator