JPH1083327A - Device and method for generating test pattern - Google Patents

Device and method for generating test pattern

Info

Publication number
JPH1083327A
JPH1083327A JP8261375A JP26137596A JPH1083327A JP H1083327 A JPH1083327 A JP H1083327A JP 8261375 A JP8261375 A JP 8261375A JP 26137596 A JP26137596 A JP 26137596A JP H1083327 A JPH1083327 A JP H1083327A
Authority
JP
Japan
Prior art keywords
state
variable
test pattern
external input
condition
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
JP8261375A
Other languages
Japanese (ja)
Inventor
Riyuuta Terajima
立太 寺嶌
Noriyoshi Sano
範佳 佐野
Toshihiro Wakita
敏裕 脇田
Yutaka Inamori
豊 稲森
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.)
Toyota Central R&D Labs Inc
Original Assignee
Toyota Central R&D Labs Inc
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 Toyota Central R&D Labs Inc filed Critical Toyota Central R&D Labs Inc
Priority to JP8261375A priority Critical patent/JPH1083327A/en
Publication of JPH1083327A publication Critical patent/JPH1083327A/en
Pending legal-status Critical Current

Links

Landscapes

  • Test And Diagnosis Of Digital Computers (AREA)
  • Tests Of Electronic Circuits (AREA)
  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To generate a test pattern for a program which changes an operation state by dividing the program into process units, finding a state before certain state, and tracing states up to the initial state and generating the test pattern. SOLUTION: An element 'S2 =0' or 'S9 =1' needed to meet conditions described in specification 1 is specified as operated data at previous time and tracing from the specification 1 is carried out in inverse order of time to find specification where the conditions are described. The condition that S3 =1 when 'i1 ' is 1 successively three times is described in specification 3, which is searched for. When external input i1 is 1 at previous times 3 to 1, S3 =1 at the previous time 1 and the conditions regarding S3 of the specification 1 are met, so external input i1 at the times 3 to is determined and stores in a test pattern memory. Then a generating process for a test pattern for placing other variable in desired states is started.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、プログラムの機能
テスト(試験)で用いられるテストパターン(テストデ
ータ)を生成するための装置と方法に関する。本発明の
装置又は方法によると、内部状態の変化に対応して動作
する(状態を変える)プログラム用のテストパターンを
も生成することができる。
The present invention relates to an apparatus and a method for generating a test pattern (test data) used in a functional test (test) of a program. According to the apparatus or method of the present invention, a test pattern for a program that operates in response to a change in the internal state (changes the state) can also be generated.

【0002】[0002]

【従来の技術】プログラムに対して適切な外部入力(テ
ストパターン)を与え、その出力を期待値と比較するこ
とで、プログラムが正常に動作するか否かを検査する、
いわゆるプログラムテストが行われている。かかるプロ
グラムテストでは、プログラムに対して外部入力される
テストパターンの良否が、プログラムテストの信頼性を
左右する。近年、プログラムの複雑度が増すにつれて、
テストパターンの生成に長時間を要するようになってき
ている。このため、複雑なプログラムに関して良質なテ
ストパターンを簡易に生成する技術が望まれている。
2. Description of the Related Art An appropriate external input (test pattern) is given to a program, and its output is compared with an expected value to check whether the program operates normally.
So-called program tests are being conducted. In such a program test, the quality of a test pattern externally input to the program determines the reliability of the program test. In recent years, as program complexity has increased,
It takes a long time to generate a test pattern. Therefore, a technique for easily generating a high-quality test pattern for a complicated program is desired.

【0003】特開昭60−77248号公報には、プロ
グラムに対応する状態遷移図に基づいてテストパターン
(テストデータ)を生成する装置が開示されている。こ
の公報の装置では、初期状態から途中状態を経て初期状
態に戻るパスを辿るように外部入力が選ばれる。次に、
未だ辿られていないパスを有する途中状態が検出されて
該途中状態に戻り、該途中状態から未だ辿られていない
パスを辿るように外部入力が選ばれる。以下、同様の手
順で操作が繰り返されて全てのパスが辿られ終わると、
外部入力のデータ系列が、テストデータとして生成され
る。
Japanese Patent Laying-Open No. 60-77248 discloses an apparatus for generating a test pattern (test data) based on a state transition diagram corresponding to a program. In the device of this publication, an external input is selected so as to follow a path returning from the initial state to the initial state through the intermediate state. next,
An intermediate state having a path that has not been traced is detected, the state returns to the intermediate state, and an external input is selected so as to follow a path that has not been traced from the intermediate state. Hereinafter, when the operation is repeated in the same procedure and all the paths are completed,
An external input data series is generated as test data.

【0004】[0004]

【発明が解決しようとする課題】特開昭60−7724
8号公報の装置では、外部入力を適切に選ぶことで、全
てのパスが辿られている。換言すれば、上記公報の装置
は、外部入力に応じて動作を一義的に定め得るプログラ
ムを対象として、そのテストパターンを作成する装置で
ある。このため、外部入力のみならず、内部状態の変化
にも対応して動作するプログラム用のテストパターンの
生成には適していない。本発明は、内部状態の変化に対
応して状態を変えるプログラムのテストに適したテスト
パターンを生成できるようにすることを目的とする。
Problems to be Solved by the Invention JP-A-60-7724
In the device disclosed in Japanese Patent Application Laid-Open No. 8-203, all paths are traced by appropriately selecting an external input. In other words, the device disclosed in the above publication is a device that creates a test pattern for a program whose operation can be uniquely defined according to an external input. Therefore, it is not suitable for generating a test pattern for a program that operates in response to a change in internal state as well as an external input. SUMMARY OF THE INVENTION It is an object of the present invention to generate a test pattern suitable for testing a program that changes a state in response to a change in an internal state.

【0005】[0005]

【課題を解決するための手段】本発明は、1の変数の状
態を変化させ得る処理単位にテスト対象のプログラムを
分割して各処理単位を各々代数的に記述して成る各仕様
を当該プログラム中での実行順に記憶している仕様記憶
手段と、各変数とその状態を各々記憶する状態記憶手段
と、テストパターン生成対象の変数Xと該変数Xがとる
べき状態Sを最終時刻の***作データとして指定する対
象指定手段と、***作データとして指定された変数を指
定された状態にするための条件が記述されている仕様を
探し出す仕様探索手段と、探索された仕様の前記条件の
要素として外部入力が記述されている場合は該外部入力
がとるべき状態を記憶するテストパターン記憶手段と、
探索された仕様の前記条件の要素として変数が記述され
ている場合は該変数と該変数がとるべき状態を前時刻の
***作データとして指定し且つ前記状態記憶手段に該変
数の状態を記憶する指定記憶手段と、前記仕様探索手段
による仕様探索操作を最終時刻の***作データから時刻
の逆順に実行させる操作制御手段と、前記状態記憶手段
に記憶されている各変数の状態を監視する監視手段と、
各変数が各々初期状態をとり得るようになった旨が前記
監視手段により検出されると前記変数Xを前記状態Sに
するためのテストパターン生成過程を終了させる対象解
除手段と、を有するテストパターン生成装置である。
According to the present invention, a program to be tested is divided into processing units capable of changing the state of one variable, and each specification which is described algebraically with each processing unit is written in the program. Specification storage means for storing the execution order of the test patterns, state storage means for storing each variable and its state, and a variable X for which a test pattern is to be generated and a state S to be taken by the variable X are operated at the final time. Target specifying means for specifying as data, specification searching means for searching for a specification describing a condition for setting a variable specified as operated data to a specified state, and an element of the condition of the searched specification. Test pattern storage means for storing a state to be taken by the external input when the external input is described;
When a variable is described as an element of the condition of the searched specification, the variable and a state to be taken by the variable are designated as operated data at a previous time, and the state of the variable is stored in the state storage means. Designation storage means, operation control means for executing a specification search operation by the specification search means in the reverse order of time from operated data at the last time, and monitoring means for monitoring the state of each variable stored in the state storage means When,
A target canceling unit for terminating a test pattern generation process for setting the variable X to the state S when the monitoring unit detects that each variable can take an initial state. It is a generating device.

【0006】テストパターン生成対象の変数Xがとるべ
き状態Sが最終時刻の***作データとして指定される
と、該変数Xを上記状態Sにするためのテストパターン
の生成過程が、最終時刻から時刻の逆順に開始される。
まず、上記変数Xを上記状態Sにするための条件が記述
されている仕様が探索され、該探索された仕様中に記述
されている変数がとるべき状態が、前時刻の***作デー
タとして指定され、且つ、記憶される。また、探索され
た仕様中に記述されている外部入力がとるべき状態が、
上記変数Xを上記状態Sにするためのテストパターンの
構成データとして記憶される。次に、前時刻の***作デ
ータに関して、同様に処理が行われる。
When a state S to be taken by a variable X for which a test pattern is to be generated is specified as operated data at the last time, a process of generating a test pattern for bringing the variable X into the above-mentioned state S is performed from the last time to a time from the last time. Are started in reverse order.
First, a specification in which a condition for changing the variable X to the state S is described is searched, and a state to be taken by the variable described in the searched specification is designated as operated data at the previous time. And stored. Also, the state that the external input described in the searched specification should take,
The variable X is stored as configuration data of a test pattern for setting the state to the state S. Next, the same processing is performed on the operated data at the previous time.

【0007】上記処理が時刻の逆順に遂行された結果、
各変数の状態が初期状態をとるに到った場合は、上記変
数Xを上記状態Sにするためのテストパターンの導出に
成功した場合であり、当該テストパターンの生成過程が
終了される。また、上記処理が時刻の逆順に遂行された
結果、全ての変数の状態が周期的に変化するに到った場
合や、外部入力によって変数の状態を変化させ得なくな
るに到った場合は、上記変数Xを上記状態Sにするため
のテストパターンの導出に失敗した場合である。この場
合に於いて、上記変数Xを上記状態Sにするための条件
が記述されている仕様が他に在る場合には、該他の仕様
について同様にテストパターンの生成過程を開始するよ
うに構成することもできる。上記変数Xを上記状態Sに
するためのテストパターンを生成する過程が終了する
と、次の変数を或る所望の状態にするためのテストパタ
ーンの生成過程が同様に開始される。なお、次の変数が
無い場合には、当該プログラムに関するテストパターン
の生成が終了される。
As a result of the above processing being performed in reverse order of time,
When the state of each variable reaches the initial state, it means that a test pattern for changing the variable X to the state S has been successfully derived, and the process of generating the test pattern ends. Also, as a result of performing the above processing in reverse order of time, if the state of all variables changes periodically, or if it becomes impossible to change the state of variables by external input, This is a case where the derivation of a test pattern for changing the variable X to the state S has failed. In this case, if there is another specification in which a condition for setting the variable X to the state S is described, the process of generating a test pattern is similarly started for the other specification. It can also be configured. When the process of generating a test pattern for changing the variable X to the state S is completed, the process of generating a test pattern for changing the next variable to a desired state is also started. If there is no next variable, the generation of the test pattern related to the program ends.

【0008】前記処理単位とは、外部入力の状態を定め
ることにより、着目した1の変数の状態を一義的に定め
得る単位をいう。前記仕様とは、前記処理単位を代数的
に記述したものである。即ち、変化する状態と、該状態
に変化させるための条件及び操作を、形式的に記述した
ものである。代数系の意味に従って仕様を解釈すると、
分割された仕様の全体が、テスト対象のプログラムと同
じ動作をする。この仕様が、本発明では、時刻の逆順に
辿られることで、テストパターンが生成される。なお、
テスト対象のプログラムは、非同期な割り込みが無い、
又は、非同期な割り込みを用いないでモデル化できるプ
ログラムであるものとする。
The above-mentioned processing unit is a unit that can uniquely determine the state of one variable of interest by determining the state of an external input. The specification is an algebraic description of the processing unit. That is, a state that changes and a condition and operation for changing to the state are described in a formal manner. Interpreting the specification according to the algebraic semantics,
The entire specification thus divided behaves the same as the program under test. In the present invention, a test pattern is generated by following the specification in reverse order of time. In addition,
The test target program has no asynchronous interrupt,
Alternatively, it is assumed that the program can be modeled without using an asynchronous interrupt.

【0009】前述の本発明の構成に於いて、前記操作制
御手段が、1の***作データに関して複数の仕様が探索
された場合には、所定の規則に従って選択した1の仕様
について前記操作制御を実行するとともに他の仕様を記
憶しておき、前記変数Xを前記状態Sにするためのテス
トパターンの導出に失敗した場合には、次に、記憶して
いる残りの仕様の中から所定の規則に従って選択した1
の仕様について前記操作制御を実行し、以下、同様に前
記操作制御を繰り返して実行するテストパターン生成装
置として構成することもできる。
In the configuration of the present invention described above, when a plurality of specifications are searched for one piece of operated data, the operation control means performs the operation control for one specification selected according to a predetermined rule. When the execution is performed and other specifications are stored, and the derivation of a test pattern for setting the variable X to the state S fails, a predetermined rule is selected from the remaining stored specifications. 1 selected according to
The above-described operation control may be performed for the specifications described above, and the test pattern generation device may be configured to repeatedly execute the operation control in the same manner.

【0010】また、前述の本発明の構成に於いて、前記
テストパターン記憶手段が、LIFO(Last In, First
Out)メモリに前記状態を記憶し、テストパターン生成
対象の全変数について処理が終了した後に、該LIFO
メモリからデータ系列を読み出してテストパターンとし
て出力するテストパターン生成装置として構成すること
もできる。
[0010] In the above-described configuration of the present invention, the test pattern storage means may include a LIFO (Last In, First In, First Out).
Out) The state is stored in a memory, and after the processing is completed for all variables for which a test pattern is to be generated, the LIFO
The present invention can also be configured as a test pattern generation device that reads out a data series from a memory and outputs it as a test pattern.

【0011】また、本発明は、1の変数の状態を変化さ
せ得る処理単位にテスト対象のプログラムを分割して各
々代数的に記述する各仕様を実行順に配列し、テストパ
ターン生成対象の変数Xと該変数Xがとるべき状態Sを
最終時刻の***作データとして指定し、***作データと
して指定された変数を指定された状態にするための条件
が記述されている仕様を探索し、探索された仕様の前記
条件の要素として外部入力が記述されている場合は該外
部入力がとるべき状態をテストパターンの構成データと
して記憶し、探索された仕様の前記条件の要素として変
数が記述されている場合は該変数と該変数がとるべき状
態を前時刻の***作データとして指定するとともに該変
数の状態を記憶し、最終時刻の***作データから時刻の
逆順に前記***作データを前記仕様探索用に供給し、記
憶している各変数の状態を監視して各変数が各々初期状
態をとり得るようになった場合は前記変数Xを前記状態
Sにするためのテストパターン生成過程を終了させる、
テストパターン生成方法である。
Further, according to the present invention, a program to be tested is divided into processing units capable of changing the state of one variable, and specifications each algebraically described are arranged in the order of execution, and a variable X to be tested is generated. And a state S to be taken by the variable X is specified as operated data at the last time, and a specification in which a condition for changing the variable specified as the operated data to the specified state is described is searched. If an external input is described as an element of the condition of the specified specification, a state to be taken by the external input is stored as test pattern configuration data, and a variable is described as an element of the condition of the searched specification. In this case, the variable and the state to be taken by the variable are designated as the operated data at the previous time, and the state of the variable is stored. A test for supplying the data for the specification search, monitoring the state of each stored variable, and setting each of the variables X to the state S when each of the variables can take an initial state. End the pattern generation process,
This is a test pattern generation method.

【0012】[0012]

【発明の実施の形態】以下、図面を参照して、本発明の
実施の形態を説明する。図1(a)は本実施の形態の対
象とされるプログラムの外部入力i1 と動作状態S1
3 を示すデータ入出力図、図1(b)は上記プログラ
ムを分割して代数的に記述した仕様を実行順に配した説
明図である。ここで、図1(b)の仕様1〜仕様3が各
々請求項の処理単位に相当する。図2は動作状態S1
1になるように、外部入力i1 と動作状態S2 ,S3
最終時刻から図1(b)の仕様に即して時刻の逆順に決
定する様子を示す説明図である。ここで、内部状態S1
〜S3 は、仕様によって決定される順に左から右へ記述
されている。図3は本実施の形態の装置の機能的構成を
示す機能ブロック図である。
Embodiments of the present invention will be described below with reference to the drawings. FIGS. 1 (a) External input i 1 of the program to which the present embodiment and the operation state S 1 ~
Data input and output diagram illustrating the S 3, FIG. 1 (b) are explanatory views arranged in the order of executing the specification algebraically described by dividing the program. Here, the specifications 1 to 3 in FIG. 1B each correspond to a processing unit in claims. FIG. 2 shows a state in which the external input i 1 and the operating states S 2 and S 3 are determined in the reverse order of the time from the final time according to the specification of FIG. 1B so that the operating state S 1 becomes 1. FIG. Here, the internal state S 1
~S 3 is described from left to right in the order in which they are determined by the specification. FIG. 3 is a functional block diagram showing a functional configuration of the device according to the present embodiment.

【0013】図3に於いて、対象プログラムの動作を代
数的に記述する仕様が本テストパターン生成装置に入力
されると、上記対象プログラムの仕様はコントロール部
によって処理単位に分割される。処理単位とは、変数や
外部入力の状態を定めることで、着目した1の変数の状
態を一義的に定め得る単位をいう。分割された各処理単
位を代数的に記述する各仕様は、仕様メモリに図1
(b)の如く実行順に記憶される。なお、外部入力i1
は、仕様1の直前に入力されるものとする。
In FIG. 3, when the specification describing the operation of the target program algebraically is input to the test pattern generation device, the specification of the target program is divided into processing units by the control unit. The processing unit is a unit that can uniquely determine the state of one focused variable by determining the state of a variable or an external input. Each specification that algebraically describes each divided processing unit is stored in the specification memory as shown in FIG.
They are stored in the order of execution as shown in FIG. Note that the external input i 1
Is input immediately before specification 1.

【0014】また、プログラム中で用いられる各変数と
その初期状態とが、変数状態メモリに記憶される。変数
状態メモリには、各変数とその初期状態を記憶する領域
の他に、図2に示す如く、最終時刻から時刻の逆順に定
められる状態を記憶するための領域が設けられている。
なお、図2の最左欄(外部入力i1 の欄)は、テストパ
ターンメモリの領域を示す。
Each variable used in the program and its initial state are stored in a variable state memory. The variable state memory is provided with an area for storing states determined in reverse order from the last time to the time, as shown in FIG. 2, in addition to an area for storing each variable and its initial state.
Note that the leftmost column (column of external input i 1) of FIG. 2 shows the area of the test pattern memory.

【0015】対象プログラムの分割仕様と変数とその初
期状態が記憶されると、コントロール部から対象指定部
に対して、テストパターン作成対象の変数Xとその状態
Sを最終時刻の***作データとして指定すべき旨が命令
される。これに応じて、対象指定部は、上記変数Xと上
記状態Sとを最終時刻の***作データとして指定して仕
様探索部に送る。ここでは、変数S1 と状態「1」と
が、最終時刻の***作データとして指定される。これに
応じて、変数状態メモリ内には、図2(a)に示すよう
に、変数S1 の最終時刻0の欄に、状態「1」が書き込
まれる。
When the division specifications, variables, and their initial states of the target program are stored, the control unit specifies the variable X for which the test pattern is to be generated and its state S as the operated data at the last time to the target specifying unit. It is ordered to do so. In response to this, the target specifying unit specifies the variable X and the state S as the operated data at the last time and sends the data to the specification search unit. Here, the variable S 1 and the state “1” are designated as the operated data at the last time. In response to this, in the variable-state memory, as shown in FIG. 2 (a), in the column of the last time 0 of the variable S 1, the state "1" is written.

【0016】最終時刻の***作データが指定されると、
指定された変数S1 を指定された状態「1」にするため
の条件の記述されている仕様が、仕様メモリから探し出
される。図1(b)に示すように、仕様1には、「i1
=1,且つ,S2 =0,且つ,S3 =1ならば、S1
1である」という条件が記述されている。このため、こ
こでは、仕様1が探し出される。また、探し出された仕
様1に基づいて、変数状態メモリ内には、図2(a)に
示すように、変数S2 の前時刻1の欄に状態「0」が、
変数S3 の前時刻1の欄に状態「1」が、各々書き込ま
れ、同様に、テストパターンメモリ内には、外部入力i
1 の最終時刻0の欄に状態「1」が書き込まれる。ここ
で、変数S2 と変数S3 は、仕様1の実行時までに上述
の状態になっていることが必要であるため、前時刻1の
欄に書き込まれる。また、外部入力i1 は仕様1の実行
直前に入力されるため、最終時刻0の欄に書き込まれ
る。なお、図2に於いて、例えば(S1 0=1)とは、S
1 が時刻0に於いて1になるようにするために決定され
たことを意味する。
When the operated data at the last time is designated,
Written by that specification condition for a specified a specified variable S 1 state "1" is sought from the specification memory. As shown in FIG. 1B, the specification 1 includes “i 1
= 1, S 2 = 0 and S 3 = 1, then S 1 =
1 "is described. Therefore, here, the specification 1 is searched. Further, based on the found Specifications 1, in the variable-state memory, as shown in FIG. 2 (a), the state "0" in the column of the previous time of the variables S 2,
State "1" in the column of the previous time of the variables S 3, written respectively, Similarly, the test pattern in memory, an external input i
The state “1” is written in the last time 0 column of “1”. Here, since the variables S 2 and S 3 need to be in the above-mentioned state by the time of the execution of the specification 1, they are written in the column of the previous time 1. Further, since the external input i 1 is input immediately before the execution of the specification 1, it is written in the column of the last time 0. Incidentally, in FIG. 2, for example, a (S 1 0 = 1) is, S
This means that 1 was determined to be 1 at time 0.

【0017】また、仕様1に記述されている条件を満た
すために必要な要素「S2 =0」又は「S3 =1」が、
前時刻の***作データとして指定される。これにより、
仕様1から時刻の逆順に仕様が辿られて、「S2 =0」
又は「S3 =1」にするための条件が記述されている仕
様が探し出される。仕様3には、「i1 が連続して3回
『i1 =1』であれば、S3 =1である」という条件が
記述されている。このため、ここでは、仕様3が探し出
される。また、探し出された仕様3に基づき、テストパ
ターンメモリ内には、図2(b)に示すように、外部入
力i1 の前時刻1〜前時刻3の各欄に各々状態「1」が
書き込まれる。即ち、前時刻3・前時刻2・前時刻1に
於いて外部入力i1 =1であれば、前時刻1に於いてS
3 =1となり、仕様1のS3 に関する条件を満たすた
め、上述の如く前時刻3〜前時刻1に於ける外部入力i
1 が決定されて、テストパターンメモリに記憶される。
The element “S 2 = 0” or “S 3 = 1” necessary to satisfy the condition described in the specification 1 is
It is specified as the operated data of the previous time. This allows
The specification is traced from specification 1 in the reverse order of the time, and “S 2 = 0”
Alternatively, a specification describing a condition for setting “S 3 = 1” is searched for. The specification 3, "if it is to i 1 is three consecutive times" i 1 = 1 ", S 3 = 1" condition that has been described. Therefore, here, the specification 3 is searched. Further, based on the found specification 3, the state “1” is stored in each column of the previous time 1 to the previous time 3 of the external input i 1 in the test pattern memory as shown in FIG. Written. That is, if the external input i 1 = 1 at the previous time 3, the previous time 2, and the previous time 1, S
3 = 1, satisfies the condition relating to S 3 of the specification 1, in external input i before time 3 before time 1 as described above
1 is determined and stored in the test pattern memory.

【0018】さらに、仕様3から時刻の逆順に仕様が辿
られて、残りの要素「S2 =0」を満たすための条件が
記述されている仕様が探し出される。仕様2には、「i
1 =1,且つ,S3 =1ならば、S2 =1」という条件
が記述されている。このため、ここでは、仕様2が探し
出される。また、探し出された仕様2に基づいて、変数
状態メモリ内には、図2(c)に示すように、変数S3
の前時刻2の欄に状態「0」が書き込まれる。即ち、前
時刻2に於いて変数S3 =0であれば、前時刻1の外部
入力i1 にかかわりなく、前時刻1に於ける変数S2
0となり、仕様1のS2 に関する条件を満たすため、上
述の如く前時刻2に於ける変数S3 が決定されて記憶さ
れる。
Further, the specification is traced in reverse order of the time from the specification 3 to find a specification in which a condition for satisfying the remaining element “S 2 = 0” is described. Specification 2 includes "i
If 1 = 1 and S 3 = 1, the condition S 2 = 1 ”is described. Therefore, here, the specification 2 is searched. Further, based on the found specification 2, the variable S 3 is stored in the variable state memory as shown in FIG.
The state “0” is written in the column of the previous time 2 of “1”. That is, if the variable S 3 = 0 at the previous time 2, regardless of the external input i 1 at the previous time 1, the variable S 2 =
0, for satisfying about S 2 specifications 1, is in the variable S 3 before time 2 as described above is stored is determined.

【0019】仕様1の条件を満たす要素に関する探索が
終了すると、次に、仕様2に記述されている条件を満た
すために必要な要素「S3 =0」が、前時刻の***作デ
ータとして指定され、これにより、仕様2から時刻の逆
順に仕様が辿られて、「S3=0」にするための条件が
記述されている仕様が探し出される。仕様3には、「i
1 が連続して3回『i1 =1』であれば、S3 =1であ
る」という条件が記述されている。このため、ここで
は、仕様3が探し出される。また、探し出された仕様3
に基づき、図2(c)に示すように、テストパターンメ
モリ内の外部入力i1 の前時刻4の欄に状態「0」が書
き込まれる。即ち、前時刻4に於いて外部入力i1 =0
であれば、前時刻2に於いてS3 =0となり、仕様2の
3 に関する条件を満たすため、上述の如く、前時刻4
に於ける外部入力i1 が決定されて、テストパターンメ
モリに記憶される。
When the search for the element satisfying the condition of the specification 1 is completed, the element "S 3 = 0" required to satisfy the condition described in the specification 2 is designated as the operated data at the previous time. As a result, the specifications are traced in reverse order of the time from the specification 2 to find a specification in which a condition for setting “S 3 = 0” is described. Specification 3 includes "i
If 1 is "i 1 = 1" three times in a row, then S 3 = 1 ". Therefore, here, the specification 3 is searched. In addition, the found specification 3
Based on, as shown in FIG. 2 (c), the state "0" in the column of the previous time 4 external input i 1 of the test pattern memory is written. That is, at the previous time 4, the external input i 1 = 0
, S 3 = 0 at the previous time 2 and the condition regarding S 3 of the specification 2 is satisfied.
In external input i 1 is determined and stored in the test pattern memory.

【0020】この時点で、変数S2 と変数S3 は初期状
態「0」となる。また、変数S1 の前時刻1以前の状態
は任意「*」であり、初期状態をとり得る。つまり、各
変数が各々初期状態をとり得るようになっている。この
ようになると、監視部からコントロール部に対して、そ
の旨のデータが送られる。これに応じて、コントロール
部は、変数S1 を状態「1」にするためのテストパター
ン生成過程を終了させるべき旨を対象指定部に対して通
知し、また、これにより、テストパターンメモリに記憶
されている外部入力i1 のデータ系列(変数S1 を状態
「1」にするためのテストパターン)が読み出されて、
装置外部に送られる。即ち、変数S1 を状態「1」にす
るためのテストパターンが得られる。
At this point, the variables S 2 and S 3 are in the initial state “0”. Further, the state before the previous time 1 of the variable S1 is arbitrary “*” and can take an initial state. That is, each variable can take an initial state. In such a case, the monitoring unit sends data to that effect to the control unit. In response to this, the control unit notifies the target designating unit that the test pattern generation process for setting the variable S 1 to the state “1” should be terminated, and thereby stores the test pattern in the test pattern memory. The data sequence of the external input i 1 (the test pattern for setting the variable S 1 to the state “1”) is read out,
Sent outside the device. That is, a test pattern for the variable S 1 to state "1" is obtained.

【0021】なお、変数S1 を状態「1」にするための
テストパターンの生成終了後、引き続いて他の変数を所
望の状態にするためのテストパターンを生成する場合
は、コントロール部から対象指定部に対してその旨が通
知され、これにより、前述の場合と同様にして、該他の
変数を該所望の状態にするためのテストパターンの生成
過程が開始される。
After the generation of the test pattern for setting the variable S 1 to the state “1”, if a test pattern for subsequently setting the other variables to a desired state is to be generated, the control unit specifies the target. The section is notified of this fact, and in the same manner as described above, the process of generating a test pattern for bringing the other variables into the desired state is started.

【0022】上述の説明では、全ての変数が初期状態を
とり得るに到ることで、変数S1 を状態「1」にするた
めのテストパターンの生成過程が終了されている。換言
すれば、テストパターンの導出成功によって、テストパ
ターンの生成過程が終了されている。しかしながら、全
ての変数が周期的に変化するに到った場合や、外部入力
によって変数を変化させ得なくなるに到った場合のよう
に、テストパターンの導出に失敗する場合もあり得る。
このような場合に於いて、前記変数S1 を前記状態
「1」にするための条件が記述されている仕様が他に在
る場合には、該他の仕様について同様にテストパターン
の生成過程が開始される。即ち、テストパターンの導出
に失敗した変数について、テストパターンの再探索が開
始される。なお、本例では、前記変数S1 を前記状態
「1」にするための条件の記述された仕様は、他には無
い。
In the above description, the generation process of the test pattern for changing the variable S 1 to the state “1” is completed when all the variables can take the initial state. In other words, the test pattern generation process has been completed by the successful derivation of the test pattern. However, there may be a case where the derivation of the test pattern fails, such as a case where all the variables change periodically or a case where the variables cannot be changed by an external input.
In this case, the variable if the conditions for the S 1 to the state "1" specification is written there by others, the generation process of similarly test pattern for said other specifications Is started. That is, the re-search of the test pattern is started for the variable for which the derivation of the test pattern has failed. In the present embodiment, the described specification conditions for the variable S 1 to the state "1", no other.

【0023】なお、全ての変数が周期的に変化するに到
る場合としては、例えば、条件の記述された代数式の両
辺に同一の変数が存在する分割仕様が存在するような場
合が考えられる。例えば、「i1 =1,且つ,S1
0,且つ,S3 =1ならば、S1 =1である」の如き仕
様の場合である。かかる仕様が存在するが故に、全ての
変数が周期的に変化するようになった場合には、前記監
視部は、当該変数を所望の状態にするためのテストパタ
ーンの導出に失敗したとして、上述の如くテストパター
ンの生成過程を終了させるべき旨をコントロール部に対
して通知することとなる。
As a case where all the variables periodically change, for example, a case where there is a division specification in which the same variable exists on both sides of the algebraic expression in which the condition is described. For example, “i 1 = 1, and S 1 =
0, and S 1 = 1 if S 3 = 1 ". In the case where all the variables periodically change due to the existence of such a specification, the monitoring unit determines that the derivation of the test pattern for bringing the variables into a desired state has failed, as described above. As described above, the control unit is notified that the test pattern generation process should be terminated.

【0024】[0024]

【発明の効果】以上のように、本発明では、プログラム
を処理単位に分割し、或る状態の前の状態を求めるとい
う操作を順に繰り返して、初期状態まで遡ることにより
テストパターンを生成しているため、内部状態の変化に
よって動作状態を変えるプログラムのテストパターンを
生成することができる。また、状態の変化に影響しない
要因を考慮する必要が無いという効果もある。
As described above, according to the present invention, the operation of dividing a program into processing units and obtaining a state before a certain state is repeated in order, and a test pattern is generated by going back to the initial state. Therefore, it is possible to generate a test pattern of a program that changes an operation state according to a change in an internal state. In addition, there is an effect that it is not necessary to consider a factor that does not affect the change in the state.

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

【図1】(a)は本実施の形態の対象とされるプログラ
ムの外部入力i1 と動作状態S1 〜S3 を示すデータ入
出力図、(b)は上記プログラムを分割して代数的に記
述した仕様を実行順に配した説明図。
[1] (a) data input-output diagram showing the external input i 1 the operating state S 1 to S 3 of the program to which the present embodiment, (b) is algebraically split the program FIG. 3 is an explanatory diagram in which specifications described in FIG.

【図2】動作状態S1 が1になるように、外部入力i1
と動作状態S1 ,S3 を最終時刻から図1(b)の仕様
に即して時刻の逆順に決定する様子を示す説明図。
FIG. 2 shows an external input i 1 so that the operation state S 1 becomes 1
FIG. 4 is an explanatory diagram showing how the operating states S 1 and S 3 are determined in reverse order of time from the last time in accordance with the specifications of FIG.

【図3】実施の形態のテストパターン生成装置の機能的
構成を示す機能ブロック図。
FIG. 3 is a functional block diagram illustrating a functional configuration of the test pattern generation device according to the embodiment;

───────────────────────────────────────────────────── フロントページの続き (72)発明者 脇田 敏裕 愛知県愛知郡長久手町大字長湫字横道41番 地の1株式会社豊田中央研究所内 (72)発明者 稲森 豊 愛知県愛知郡長久手町大字長湫字横道41番 地の1株式会社豊田中央研究所内 ──────────────────────────────────────────────────続 き Continuing on the front page (72) Inventor Toshihiro Wakita 41-cho, Chuchu-cho, Nagakute-cho, Aichi-gun, Aichi Prefecture Inside Toyota Central Research Institute, Inc. 41 at Yokomichi, Toyota Central Research Laboratory, Inc.

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 1の変数の状態を変化させ得る処理単位
にテスト対象のプログラムを分割して各処理単位を各々
代数的に記述して成る各仕様を、当該プログラム中での
実行順に記憶している仕様記憶手段と、 各変数とその状態を各々記憶する状態記憶手段と、 テストパターン生成対象の変数Xと該変数Xがとるべき
状態Sを最終時刻の***作データとして指定する対象指
定手段と、 ***作データとして指定された変数を指定された状態に
するための条件が記述されている仕様を探し出す仕様探
索手段と、 探索された仕様の前記条件の要素として外部入力が記述
されている場合は、該外部入力がとるべき状態を記憶す
るテストパターン記憶手段と、 探索された仕様の前記条件の要素として変数が記述され
ている場合は、該変数と該変数がとるべき状態を前時刻
の***作データとして指定し、前記状態記憶手段に該変
数の状態を記憶する指定記憶手段と、 前記仕様探索手段による仕様探索操作を最終時刻の***
作データから時刻の逆順に実行させる操作制御手段と、 前記状態記憶手段に記憶されている各変数の状態を監視
する監視手段と、 各変数が各々初期状態をとり得るようになった旨が前記
監視手段により検出されると、前記変数Xを前記状態S
にするためのテストパターン生成過程を終了させる対象
解除手段と、 を有するテストパターン生成装置。
1. A specification in which a program to be tested is divided into processing units capable of changing the state of one variable and each processing unit is algebraically described, and each specification is stored in the order of execution in the program. Specification storage means, state storage means for storing each variable and its state, and object designating means for designating a variable X to be generated as a test pattern and a state S to be taken by the variable X as operated data at the last time. And specification searching means for searching for a specification in which a condition for changing a variable specified as operated data to a specified state is described. An external input is described as an element of the condition of the searched specification. In the case, the test pattern storage means for storing a state to be taken by the external input, and when a variable is described as an element of the condition of the searched specification, the variable and the variable take the A designated state as the operated data of the previous time, a designation storage means for storing the state of the variable in the state storage means, and a specification search operation by the specification search means in the reverse order of the time from the operated data at the last time. Operation control means to be executed; monitoring means for monitoring the state of each variable stored in the state storage means; and when the monitoring means detects that each variable can take an initial state. , The variable X to the state S
And a target canceling means for terminating a test pattern generation process for making a test pattern.
【請求項2】 1の変数の状態を変化させ得る処理単位
にテスト対象のプログラムを分割して各々代数的に記述
する各仕様を実行順に配列し、 テストパターン生成対象の変数Xと該変数Xがとるべき
状態Sを最終時刻の***作データとして指定し、 ***作データとして指定された変数を指定された状態に
するための条件が記述されている仕様を探索し、 探索された仕様の前記条件の要素として外部入力が記述
されている場合は、該外部入力がとるべき状態をテスト
パターンの構成データとして記憶し、 探索された仕様の前記条件の要素として変数が記述され
ている場合は、該変数と該変数がとるべき状態を前時刻
の***作データとして指定するとともに、該変数の状態
を記憶し、 最終時刻の***作データから時刻の逆順に前記***作デ
ータを前記仕様探索用に供給し、 記憶している各変数の状態を監視して各変数が各々初期
状態をとり得るようになった場合は、前記変数Xを前記
状態Sにするためのテストパターン生成過程を終了させ
る、 テストパターン生成方法。
2. A program to be tested is divided into processing units capable of changing the state of one variable, and specifications each algebraically described are arranged in an execution order. The state S to be taken is specified as the operated data at the final time, and a specification that describes a condition for setting the variable specified as the operated data to the specified state is searched. When an external input is described as an element of the condition, the state to be taken by the external input is stored as configuration data of the test pattern, and when a variable is described as an element of the condition of the searched specification, The variable and a state to be taken by the variable are designated as operated data at the previous time, and the state of the variable is stored. When a state of each variable supplied to the specification search and stored is monitored and each variable can take an initial state, a test pattern generation for setting the variable X to the state S is performed. A test pattern generation method that ends the process.
JP8261375A 1996-09-09 1996-09-09 Device and method for generating test pattern Pending JPH1083327A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8261375A JPH1083327A (en) 1996-09-09 1996-09-09 Device and method for generating test pattern

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8261375A JPH1083327A (en) 1996-09-09 1996-09-09 Device and method for generating test pattern

Publications (1)

Publication Number Publication Date
JPH1083327A true JPH1083327A (en) 1998-03-31

Family

ID=17360978

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8261375A Pending JPH1083327A (en) 1996-09-09 1996-09-09 Device and method for generating test pattern

Country Status (1)

Country Link
JP (1) JPH1083327A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010511250A (en) * 2006-11-27 2010-04-08 ハネウェル・インターナショナル・インコーポレーテッド Request-based test generation

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010511250A (en) * 2006-11-27 2010-04-08 ハネウェル・インターナショナル・インコーポレーテッド Request-based test generation
JP2013033487A (en) * 2006-11-27 2013-02-14 Honeywell Internatl Inc Requirements-based test generation

Similar Documents

Publication Publication Date Title
US7055065B2 (en) Method, system, and computer program product for automated test generation for non-deterministic software using state transition rules
US5918037A (en) Generating tests for an extended finite state machine using different coverage levels for different submodels
US20030037317A1 (en) Method and apparatus for debugging in a massively parallel processing environment
US7240258B1 (en) Parallel test system and method
CN109783837A (en) Emulator, analogue system, emulation mode and simulated program
KR102255470B1 (en) Method and apparatus for artificial neural network
JPH1083327A (en) Device and method for generating test pattern
JP2960740B2 (en) Testing digital circuits
JP6169302B2 (en) Specification configuration apparatus and method
JP2017041196A (en) Stub object determination device, method, and program
JP2006202102A (en) Simulation apparatus
Lagartinho-Oliveira et al. GPGPU applied to support the construction of the state-space graphs of IOPT Petri net models
Subashini et al. Test suite reduction based on traceability matrix with association rule mining technique
JPH07254008A (en) Test series generating device
JP4334278B2 (en) Method and program for analyzing sequential system
KR100586303B1 (en) Test apparatus of semiconductor memory device and method of it
US7149663B1 (en) Method and apparatus for restructuring a binary decision diagram
Mandal et al. A design space exploration scheme for data-path synthesis
Melo et al. Visual-MCM: Visualising execution histories on multiple memory consistency models
JP2953029B2 (en) Test method for logic integrated circuits
JPH0728663A (en) Testing device for information processor
JP2003015965A (en) Test system in symmetric multi-processor environment
JPH01287486A (en) Test pattern program generating device
JPH03206531A (en) Automatic generating device for test program
JPH0721013A (en) System generating system