JP2011008628A - Program model inspection method and program model inspection program - Google Patents
Program model inspection method and program model inspection program Download PDFInfo
- Publication number
- JP2011008628A JP2011008628A JP2009152826A JP2009152826A JP2011008628A JP 2011008628 A JP2011008628 A JP 2011008628A JP 2009152826 A JP2009152826 A JP 2009152826A JP 2009152826 A JP2009152826 A JP 2009152826A JP 2011008628 A JP2011008628 A JP 2011008628A
- Authority
- JP
- Japan
- Prior art keywords
- function
- execution
- state
- program
- current state
- 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.)
- Granted
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
Description
本発明は、プログラムモデル検査の検査時間を削減するプログラムモデル検査方法、プログラムモデル検査プログラムに関する。 The present invention relates to a program model checking method and a program model checking program for reducing an inspection time of program model checking.
プログラムモデル検査は、対象プログラムの規模が大きくなるにつれて検査時間が増大する。つまり、対象のプログラムの規模が大きくなると探索する状態遷移グラフが巨大になり、探索時間が膨大になる。 In the program model check, the check time increases as the size of the target program increases. That is, as the scale of the target program increases, the state transition graph to be searched becomes huge, and the search time becomes enormous.
そこで、従来は関数の実行回数に制限を設けることで現実的な時間で計算可能な規模に探索範囲を抑える方法が用いられている。例えば、実行する関数を選択する際、その状態に至る関数実行系列のなかでN回呼び出だされた関数は除外するという制限をいれて規模を抑える技術が知られている。 Therefore, conventionally, a method of limiting the search range to a scale that can be calculated in a realistic time by setting a limit on the number of times the function is executed is used. For example, when a function to be executed is selected, a technique is known that reduces the scale by excluding a function that has been called N times in a function execution sequence that reaches that state.
また以下の2つの例はプログラムモデル検査の例ではないが、関数の実行回数を制限することで処理すべき規模を抑えた技術の例である。例えば、人手によるシミュレーションベクトルの作り直しやソフトウェアの作り直しを必要とせずに、不要なシミュレーションの繰返しを避けることが可能な論理検証の高速化手法が知られている。すなわち、シミュレータのシミュレーションモデルがメインルーチンを動作させることによってソフトウェアのシミュレーションを行い。トレーサがシミュレーションモデルによるメインルーチンの動作をトレースし、同じルーチンが繰返し行われることを検出すると、そのルーチンの代行をエージェントに指示する。エージェントはそのルーチンを代行して実行し、その結果をシミュレーションモデルに渡す。 The following two examples are not examples of program model checking, but are examples of techniques in which the scale to be processed is suppressed by limiting the number of executions of a function. For example, there is known a high-speed logic verification method that can avoid unnecessary repetition of simulation without requiring manual re-creation of simulation vectors or software. In other words, the simulation model of the simulator performs software simulation by operating the main routine. When the tracer traces the operation of the main routine by the simulation model and detects that the same routine is repeated, the tracer instructs the agent to substitute the routine. The agent executes the routine on its behalf and passes the result to the simulation model.
また、プログラムのテスト方法において、テスト対象プログラムに含まれる頻出経路の繰り返しの計測を抑止し、無用なオーバーヘッドを回避する方法が知られている。すなわち、情報処理装置のカバレジ計測制御プログラムは、計測対象プログラムの実行によって通過した各命令あるいは少なくとも分岐命令の通過回数がその測定上限回数に達したか否か判定する。カバレジ計測プログラムは、その命令が測定回数に達していない場合に呼び出され、その命令の通過回数を更新する。 As a program test method, a method is known in which the repeated measurement of frequent paths included in a test target program is suppressed and unnecessary overhead is avoided. In other words, the coverage measurement control program of the information processing apparatus determines whether or not the number of passages of each instruction or at least a branch instruction passed through the execution of the measurement target program has reached the upper limit number of measurements. The coverage measurement program is called when the instruction has not reached the number of measurements, and updates the number of times the instruction has passed.
しかしながら、プログラムモデル検査で関数の実行回数を制限して検査を実施した場合、ある状態から実行する関数の選択順の違いによって、探索の結果できあがる状態遷移グラフが異なる場合がある。例えば、ある状態から2つの関数が実行可能な場合において、一方の関数を先に探索するとすべての関数を実行できるが、他方の関数を先に実行して探索すると一方の関数と他方の関数以外の関数を呼び出す前に実行回数の制限により探索が終了してしまうという場合がある。 However, when checking is performed by limiting the number of executions of a function in program model checking, the state transition graph obtained as a result of the search may differ depending on the selection order of functions to be executed from a certain state. For example, when two functions can be executed from a certain state, if one function is searched first, all functions can be executed, but if the other function is executed first and searched, one function and the other function are not included. In some cases, the search ends due to a limit on the number of executions before calling this function.
プログラムモデル検査で関数の実行回数を制限して検査を実施する状態遷移図と表を図21に示す。図21のA、B、Cに示す例では、実行可能な関数として開始関数、商品選択関数、入力完了関数、購入関数があり、各関数に実行回数の制限回数として1回が予め設定されているとする。 FIG. 21 shows a state transition diagram and a table for performing the inspection by limiting the number of executions of the function in the program model inspection. In the example shown in FIGS. 21A, 21B, and 21C, there are a start function, a product selection function, an input completion function, and a purchase function as executable functions. Each function is preset with a limit of the number of execution times. Suppose that
まず、図21のAでは初期状態において(1)開始関数が実行されると状態1に遷移し、開始関数に関連付けて実行回数1が記録される(Aの表参照)。次に、図21のBでは状態1において、(2)商品選択関数が実行され状態2に移行し、商品選択関数に関連付けて実行回数1が記録される(Bの表参照)。次に、状態2において商品選択関数を実行しようとした場合、既に商品選択関数は実行されているため、予め設定した制限回数1回に基づいて商品選択関数の実行を制限されてしまう。よって、図21のBの状態2では入力完了関数を選択し状態3に遷移する。状態3では購入関数を選択して実行する。
First, in FIG. 21A, in the initial state, (1) when the start function is executed, the state transits to
図21のCに示す例では、初期状態において(1)開始関数が実行して状態1に遷移し、状態1において(3)入力完了関数を実行して状態4に遷移する。このとき開始関数と入力完了関数に関連付けられて実行回数1が記録される(Cの表参照)。この場合、開始関数と入力完了関数は、予め設定した制限回数1回に基づいて開始関数と入力完了関数の実行を制限されてしまうため、(4)商品選択関数を選択し状態2に遷移する。しかし、状態2に遷移したときには開始関数、入力完了関数、商品選択関数は既に1回実行されているため状態3に移行することができなくなる(Cの表参照)。すなわち、制限回数により状態3に遷移しても購入関数が実行することができないため、検査対象の関数が実行されないまま探索が終了してしまい検査を十分に行えない。
In the example shown in FIG. 21C, in the initial state, (1) the start function executes and transitions to
上記のような実情に鑑みてなされたものであり、プログラムモデル検査の探索順序に起因して検査対象の関数が実行されなくなる現象を回避し、関数の実行回数の制限を安全に行うことができ、プログラムモデル検査の実行時間を削減するプログラムモデル検査方法、プログラムモデル検査プログラムを提供することを目的とする。 It was made in view of the above situation, and it is possible to avoid the phenomenon that the function to be checked is not executed due to the search order of the program model checking, and to safely limit the number of times the function is executed. Another object of the present invention is to provide a program model checking method and a program model checking program for reducing the execution time of program model checking.
プログラムモデル検査において、複数の関数実行系列を備える検査対象プログラムにおける各状態から実行可能な関数のうち、該関数実行系列内での実行回数が実行回数上限値未満のものを実行する。現在の状態から実行可能な関数の実行回数が、上記実行回数上限値以上である場合に、該関数の実行を抑止して該関数実行系列の検査を終了し、該関数を該現在の状態に関連付けて実行を抑止する関数を定義した実行抑止関数テーブルに記録する。他の関数実行系列において、現在の状態への遷移がすでに行われているとき、上記実行抑止関数テーブルに該現在の状態と該現在の状態から実行可能な関数との組み合わせがあるか否かを判定し、判定において上記組み合わせがある場合にのみ該関数を実行する。 In the program model check, a function that can be executed from each state in a test target program having a plurality of function execution series is executed with the number of executions within the function execution series being less than the upper limit of execution times. If the number of executions of a function that can be executed from the current state is equal to or greater than the upper limit value of the number of executions, the execution of the function is suppressed and the inspection of the function execution sequence is terminated, and the function is brought into the current state. Record in the execution suppression function table that defines the functions that are associated and suppress execution. In another function execution sequence, when transition to the current state has already been performed, whether or not there is a combination of the current state and a function executable from the current state in the execution suppression function table The function is executed only when there is a combination in the determination.
また、実行抑止関数テーブルにおいて、予め設定した数以上の状態と関連付けられている関数が検出されたときに、該関数の上記実行回数上限値を増加させる。 In addition, when a function associated with a predetermined number or more states is detected in the execution suppression function table, the upper limit value of the number of executions of the function is increased.
プログラムモデル検査の探索順序に起因して検査対象の関数が実行されなくなる現象を回避し、関数の実行回数の制限を安全に行うことができ、プログラムモデル検査の実行時間を削減することができる。 It is possible to avoid the phenomenon that the function to be checked is not executed due to the search order of the program model checking, to safely limit the number of times the function is executed, and to reduce the execution time of the program model checking.
以下図面に基づいて、本発明の実施形態について詳細に説明する。
(実施例1)
(構成)
図1はプログラムモデル検査装置の一例について示した図である。図1はプログラムモデル検査を実施するときに用いる構成例を示す図である。ここで、プログラムモデル検査は、テスト対象システムの振舞いを設計書・仕様書から取り出し、モデル検査の専用言語で記述したソフトウェア(擬似システム)を作成し、当該擬似システムにテストデータを入力することで実施するテストである。プログラムモデル検査を行うためには一般に対象プログラムを動かすドライバとデータベースやネットワークなどの外部環境を抽象化するためのスタブが必要となる。
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
Example 1
(Constitution)
FIG. 1 is a diagram showing an example of a program model checking apparatus. FIG. 1 is a diagram showing a configuration example used when program model checking is performed. Here, program model checking involves extracting the behavior of the test target system from the design document / specification, creating software (pseudo system) described in the model checking dedicated language, and inputting test data to the pseudo system. It is a test to be performed. In order to perform program model checking, a driver for moving the target program and a stub for abstracting an external environment such as a database or a network are generally required.
プログラムモデル検査装置5は、ドライバ1を介してクライアントの代わりに検査対象プログラム2に対してユーザ操作を模倣した入力データ6を検査対象プログラム2に入力して、検査対象プログラム2とデータベーススタブ3とネットワークスタブ4に対して網羅的な検査を行う。そして、プログラムモデル検査装置5は、検査結果がプロパティ7に格納されている内容(機能仕様)を満たしているかをチェックして判定を行う。
なお、プログラムモデル検査装置5は、上記説明したプログラムモデル検査を実行するソフトウェアを、コンピュータ(PCなど)にインストールした装置でもよい。
The program
Note that the program
図2はプログラムモデル検査装置5の構成を示す図である。プログラムモデル検査装置5は、プログラム制御部21、プログラム実行部22、実行可能関数絞込部23、記録部24を備えている。なお、プログラム制御部21、プログラム実行部22、実行可能関数絞込部23は、CPUやプログラマブルなデバイスを用いて実現することもできる。また、プログラム制御部21、プログラム実行部22、実行可能関数絞込部23の機能を実現するソフトウェアを、コンピュータ(PCなど)にインストールしたものでもよい。また、記録部24はCPUに内蔵されているメモリでもよいし外部に設けた記録装置などであってもよい。
FIG. 2 is a diagram showing the configuration of the program
プログラム制御部21は、検査対象プログラムから内部状態と実行可能関数を取得し、実行可能関数絞込部23に実行可能関数の絞込みを指示し、絞り込んだ実行選択肢テーブル26の中から関数を一つ選択し、プログラム実行部22にその関数での実行を指示する。
The
プログラム実行部22は、プログラム制御部21により指示された関数によりプログラムを実行する。
実行可能関数絞込部23は、実行系列テーブル27を参照して実行回数が上限に到達した関数を実行選択肢テーブル26から削除し、実行抑止関数テーブル29に追加する。また、別の実行系列において実行回数の上限に到達せずに実行抑止関数テーブル29に記録されている関数は実行抑止関数テーブル29から削除し、実行選択肢テーブル26に追加する。
The
The executable
記録部24は、状態遷移グラフ管理テーブル25、実行選択肢テーブル26、実行系列テーブル27、実行回数テーブル28、実行抑止関数テーブル29を有している。
状態遷移グラフ管理テーブル25は、状態遷移グラフを「遷移元状態」「実行関数」「遷移先状態」により示すテーブルである。状態遷移グラフ管理テーブル25の「遷移元状態」にはプログラムの関数が実行されるたびに遷移元のプログラムの状態を示す識別番号などが記録され、「実行関数」には実行した関数を識別するために関数名などが記録され、「遷移先状態」には現在のプログラムの状態が記録される。なお、「遷移元状態」「実行関数」「遷移先状態」は、プログラム制御部21により「遷移元状態」に関連付けて「実行関数」と「遷移先状態」が記録される。
The
The state transition graph management table 25 is a table showing a state transition graph by “transition source state”, “execution function”, and “transition destination state”. In the “transition source state” of the state transition graph management table 25, an identification number indicating the state of the transition source program is recorded every time the program function is executed, and the executed function is identified in the “execution function”. Therefore, the function name and the like are recorded, and the current program state is recorded in the “transition destination state”. The “transition source state”, “execution function”, and “transition destination state” are recorded by the
検査対象プログラムを商品注文システムとし、図3のAに示す表示画面から商品を購入する例を用いて状態遷移グラフの生成について説明する。
商品注文システムは、PCなどのディスプレイに表示され商品購入画面31の入力ボックス32に、購入する商品に対応する商品コードを入力して商品を注文するものとする。商品注文システムは、商品コード入力後、ユーザが「商品選択」ボタン33を画面上で押下(選択)すると、「入力完了」ボタン34、「入力変更」ボタン35がアクティブ状態になる。この状態で「入力完了」ボタン34を画面上で押下(選択)すると購入する商品が決定され、「購入」ボタン36がアクティブ状態になり、「購入」ボタン36を画面上で押下(選択)すると、ネットワークを介して注文が発注される。「入力変更」ボタン35を画面上で押下(選択)すると、再度商品コードを入力する状態に遷移する。
The generation of the state transition graph will be described using an example in which the inspection target program is a product ordering system and a product is purchased from the display screen shown in FIG.
In the merchandise ordering system, a merchandise code corresponding to a merchandise to be purchased is entered into an
なお、商品購入画面31により入力された情報(商品コード、「商品選択」ボタン33、「入力完了」ボタン34、「入力変更」ボタン35、「購入」ボタン36、が選択されたときにシステムに入力される情報など)によって決まるシステム内部の状態を内部状態という。
It should be noted that when the information (product code, “product selection”
図3のBに上記説明した商品注文システムの状態遷移を示し、図3のCに商品注文システムの状態遷移グラフ管理テーブル25を示す。
図3のBに示す状態遷移の例であれば、初期状態において「開始」が実行され、現在の状態である「状態1」に遷移する。このとき、状態遷移グラフ管理テーブル25には「遷移元状態」に「初期状態」、「実行関数」に「開始」、「遷移先状態」に「状態1」が記録される。
FIG. 3B shows the state transition of the product ordering system described above, and FIG. 3C shows the state transition graph management table 25 of the product ordering system.
In the example of the state transition shown in FIG. 3B, “Start” is executed in the initial state, and the current state is changed to “
ここで、「状態1」が示す状態とは、ディスプレイに商品購入画面31が表示され、入力ボックス32から購入する商品に対応する商品コードが入力可能になり、商品コードを入力すると「商品選択」ボタン33と「入力完了」ボタン34を選択することが可能な状態である。
Here, the state indicated by “
次に、「状態1」に示す状態からは、「商品選択」ボタン33を選択して「状態2」に遷移する場合と、「入力完了」ボタン34して「状態5」に遷移する場合が考えられる。そのため、図3のCの例では、「遷移元状態」の「状態1」に関連付けて「実行関数」に「商品選択」が記録され、「遷移先状態」に「状態2」が記録される。さらに、「遷移元状態」の「状態1」に関連付けて「実行関数」に「入力完了」が記録され、「遷移先状態」に「状態5」が記録される。また、「遷移元状態」の「状態2」〜「状態5」についても同様に、「遷移元状態」に関連付けて「実行関数」「遷移先状態」の内容が記録される。
Next, from the state shown in “
なお、本例では、記録する内容を「初期状態」「開始」「状態1」などと便宜上記載するが、実際の「遷移元状態」「遷移先状態」に対応するセルには「初期状態」「状態1」・・・などに対応する識別番号またはコードなどが記録される。また、「実行関数」にはプログラムソースで使用されている関数名などを用いる。
In this example, the contents to be recorded are described as “initial state”, “start”, “
実行選択肢テーブル26は、現在の状態を記録する「状態」と、現在の「状態」と関連付けて、現在の状態において実行可能な関数の関数名を記録する「選択肢」を有している。また、実行選択肢テーブル26の「状態」と「選択肢」には、それぞれ状態の識別番号と実行可能な関数の関数名がプログラム制御部21により関連付けられて記録される。
The execution option table 26 has a “state” that records the current state and a “option” that records the function name of a function that can be executed in the current state in association with the current “state”. Further, in the “state” and “option” of the execution option table 26, the state identification number and the function name of the executable function are recorded in association with each other by the
実行系列テーブル27は、初期状態から現在の状態までの関数の実行系列を記録する。実行系列テーブル27は、遷移元の状態を識別する識別番号などを記録する「遷移元状態」と、実行した関数の関数名を記録する「実行関数」と、遷移先の状態を識別する識別番号などを記録する「遷移先状態」を有している。そして、実行系列テーブル27の「遷移元状態」「実行関数」「遷移先状態」に、遷移元状態の識別番号と関連付けて実行可能な関数の関数名と遷移先状態の識別番号がプログラム制御部21により記録される。 The execution sequence table 27 records the execution sequence of functions from the initial state to the current state. The execution sequence table 27 includes an “transition source state” for recording an identification number for identifying a transition source state, an “execution function” for recording a function name of an executed function, and an identification number for identifying a transition destination state. Etc. have a “transition destination state”. Then, in the “transition source state”, “execution function”, and “transition destination state” of the execution sequence table 27, the function name of the function that can be executed in association with the identification number of the transition source state and the identification number of the transition destination state are the program control unit. 21 is recorded.
実行回数テーブル28は、現在の実行系列において各関数の実行された回数を記録する。実行回数テーブル28は、関数の関数名を記録する「関数」と、対象の関数が実行された回数を記録する「実行回数」を有し、「関数」「実行回数」に、実行した関数の関数名と関連付けて対象の関数が実行された回数が、実行可能関数絞込部23により記録される。
The execution count table 28 records the number of times each function is executed in the current execution sequence. The execution count table 28 has a “function” that records the function name of the function and an “execution count” that records the number of times the target function has been executed. The number of times the target function is executed in association with the function name is recorded by the executable
実行抑止関数テーブル29は、各状態において実行回数制約によって実行しなかった関数を記録する。実行抑止関数テーブル29は、現在の状態を識別する識別番号などを記録する「状態」と、選択肢として除外した関数の関数名を記録する「抑止関数」を有する。また、「状態」「実行回数」に、現在の状態の識別番号と関連付けて選択肢として除外した関数の関数名が、実行可能関数絞込部23により記録される。
The execution suppression function table 29 records a function that has not been executed due to the execution frequency restriction in each state. The execution suppression function table 29 has a “state” that records an identification number for identifying the current state, and a “suppression function” that records a function name of a function excluded as an option. In addition, in “state” and “number of executions”, the function name of the function excluded as an option in association with the identification number of the current state is recorded by the executable
(動作説明)
プログラムモデル検査において、プログラム制御部21が、プログラムモデル検査を実行した検査対象プログラムの関数の実行後の状態を、現在の状態まで記録部に記録する。そして、実行可能関数絞込部23が、各状態において関数を実行した回数が予め設定された実行回数上限値以上であるとき、関数が実行を抑止する抑止関数であると判定し、抑止関数を上記状態に関連付けて記録部の実行抑止関数テーブルに記録する。また、関数の実行後の現在の状態がすでに実行済みであるとき、実行抑止関数テーブルの抑止関数と状態に基づいて、該現在の状態において実行可能な関数の実行を抑止したか否かを判定する、実行抑止再評価を行う。
(Description of operation)
In the program model check, the
そして、現在の状態から実行可能な関数を抽出し、抽出した関数を実行した回数が予め設定された実行回数上限値より小であり、実行が抑止されている関数を検出して、現在の状態から検出した関数のうちひとつをプログラム実行部21が実行する。
Then, an executable function is extracted from the current state, the number of times the extracted function is executed is smaller than a preset upper limit of the number of executions, and a function whose execution is suppressed is detected. The
図4にプログラム制御部21の動作を示す図を示す(プログラム制御処理)。
ステップS1では、初期状態から次の状態への遷移するときに、プログラム制御部21が検査対象プログラム2に対してプログラムモデル検査を実行した現在の内部状態を抽出して記録部24に記録する。
FIG. 4 shows the operation of the program control unit 21 (program control processing).
In step S <b> 1, when the transition from the initial state to the next state is made, the
例えば、上記商品注文システム31が、図5のAに示す初期状態で開始関数が実行され状態1に遷移する場合、プログラム制御部21により初期状態で実行可能な関数の情報、入力されたデータなどが、初期状態に対応する内部状態として抽出され、記録部24に記録される。
For example, when the
ステップS2では、プログラム制御部21が現在の状態から実行可能な関数を検出し、現在の状態と関連付けて実行選択肢テーブル26に記録する。
例えば、上記説明した商品注文システムにプログラムモデル検査を行い、現在の状態が図5のAに示す初期状態の場合、プログラム制御部21が「初期状態」に対応する内部状態から実行可能な関数である開始関数を検出する。そして、実行選択肢テーブル26の「選択肢」に「初期状態」に関連付けて開始関数に対応する「開始」を記録する(図5のB)。
In step S2, the
For example, when the program model check is performed on the product ordering system described above and the current state is the initial state shown in FIG. 5A, the
また、後述するステップS10から移行してきた場合、例えば現在の状態が図5のAに示す状態1の場合、プログラム制御部21が「状態1」に対応する内部状態から実行可能な関数である入力選択関数、商品選択関数を検出する。そして、実行選択肢テーブル26の「選択肢」に「状態1」に関連付けて入力選択関数、商品選択関数に対応する「商品選択」「入力完了」を記録する(図5のC)。
Further, when the process proceeds from step S10 described later, for example, when the current state is
ステップS3では、プログラム制御部21が状態遷移グラフ管理テーブル25を参照して、既に実行ずみの状態か、すなわち過去に検査した関数実行系列において該状態への遷移済みかを判定し、実行ずみでなければステップS4に移行し、実行ずみであればステップS5に移行する。
In step S3, the
例えば、状態遷移グラフ管理テーブル25の「遷移元状態」と現在の状態を比較して、一致するものがあるかを検索する。一致する場合、実行ずみであるとしてステップS5に移行する。一致するものがない場合は実行ずみでないとしてステップS4に移行する。 For example, the “transition source state” in the state transition graph management table 25 is compared with the current state to search for a match. If they match, the process proceeds to step S5 because it has been executed. If there is no match, it is determined that it has not been executed and the process proceeds to step S4.
ステップS4(実行可能関数絞込処理)では実行可能関数絞込部23が選択肢の絞込みをする。実行可能関数絞込部23が、プログラムモデル検査時に実行された各関数の実行回数と、予め設定した実行回数上限値を比較して、実行回数上限値に達している関数を検出する。次に、該当する関数をキーにして実行選択肢テーブル26の「選択肢」から対応する関数を検出し、該「選択肢」に関連付けられた「状態」と該「選択肢」の内容を削除する。なお、選択肢の絞込み(実行可能関数絞込処理)の詳細については後述する。
In step S4 (executable function narrowing process), the executable
ステップS5(実行抑止再評価処理)では、実行可能関数絞込部23が関数の実行を抑止したかを判定して、判定結果に基づいて実行選択肢テーブル26、実行抑止関数テーブル29を制御する。なお、実行抑止再評価(実行抑止再評価処理)の詳細については後述する。
In step S5 (execution suppression re-evaluation process), it is determined whether the executable
ステップS6では、プログラム制御部21が現在の状態に対応する実行可能な関数(選択肢)が残っているかを判定し、残っていればステップS7に移行し、残っていなければステップS11に移行する。
In step S6, the
例えば、プログラム制御部21が現在の状態をキーにして実行選択肢テーブル26の「状態」を検索して、対応する状態があれば選択肢が残っているのでステップS7に移行し、対応する状態がなければ選択肢が残っていないのでステップS11に移行する。
For example, the
ステップS7では、プログラム制御部21が現在の状態に対応する実行可能な関数(選択肢)のうちから任意の1つの関数を選択し、選択した関数を実行選択肢テーブル26から削除する。
In step S <b> 7, the
例えば、図5のCに示した実行選択肢テーブル26のような場合、「状態1」に対応付けられた「入力完了」「商品選択」があるので、どちらか一方の関数を選択して選択した関数を実行する指示を、プログラム制御部21からプログラム実行部22にする。その後、例えば「商品選択」を選択したのであれば入力完了関数に対応する状態「状態1」を実行選択肢テーブル26から削除する。
For example, in the case of the execution option table 26 shown in C of FIG. 5, since there is “input completed” and “product selection” associated with “
ステップS8では、プログラム制御部21から検査対象プログラムを実行する指示をプログラム実行部22が受信し、検査対象プログラム2を実行する。
ステップS9では、ステップS8で実行した検査対象プログラム2により変化した現在の内部状態を記録部24に記録する。図6のAに示すように状態1から商品選択関数を実行することにより状態2に遷移した場合、状態2に対応する内部状態(入力データ、実行可能な関数、表示画面情報など)を記録部24に記録する。
In step S8, the
In step S9, the current internal state changed by the
ステップS10では、プログラム制御部21が状態遷移グラフ管理テーブル25と実行系列テーブル27に、一つ前の状態を示す「遷移元状態」、選択した関数に対応する「実行関数」、現在の状態に対応する「遷移先状態」を記録する。
In step S10, the
図6のBの場合、初期状態から状態1に遷移するとき、プログラム制御部21により実行系列テーブル27の「遷移元状態」に初期状態に対応する「初期状態」が、「実行関数」に開始関数に対応する「開始」が、「遷移先状態」に現在の状態に対応する「状態1」が、記録される。また、状態1から状態2に遷移するとき、プログラム制御部21により実行系列テーブル27の「遷移元状態」に状態1に対応する「状態1」、「実行関数」に商品選択関数に対応する「商品選択」、「遷移先状態」に現在の状態に対応する「状態2」が、記録される。
In the case of B in FIG. 6, when transitioning from the initial state to the
ステップS10の処理を完了するとステップS2に移行する。また、ステップ3でステップS5に移行し、ステップS5の処理によりステップS6に移行する場合は、上記ステップS6以降の処理を行い、ステップS11に移行する場合には以下の処理を行う。
When the process of step S10 is completed, the process proceeds to step S2. When the process proceeds to step S5 in
ステップS11では、プログラム制御部21が実行系列テーブル27から現在の状態が遷移元になっている行を削除する。図7のAに示すように状態2において商品選択をしても状態2に戻るような場合、プログラム制御部21が図7のBに示すように「状態2」「商品選択」「状態2」から構成される行を削除する。なお、現在の状態が遷移元になっているとは、プログラムで使用する変数の値が変わらない場合などである。
In step S <b> 11, the
ステップS12では、プログラム制御部21が一つ前の状態を現在の状態にする。図7のBの場合、一つ前の状態が「状態2」であるので「状態2」の状態に遷移する。
ステップS13では、プログラム制御部21が現在の状態に実行可能な関数(選択肢)が残っているかを判定し、残っていればステップS7に移行し、残っていなければS14に移行する。例えば、図7のAの場合であれば、状態2において入力完了関数に対応する「入力完了」が、図7のCの実行選択肢テーブル26に記録されているのでステップS7に移行する。
In step S12, the
In step S13, the
ステップS14では、プログラム制御部21が現在の状態が初期状態(実行選択肢テーブル26が空)かを判定し、初期状態であればプログラムモデル検査を終了し、初期状態でない場合はステップS11に移行する。
In step S14, the
(実行可能関数絞込処理の説明)
実行可能関数絞込部23の実行回数による選択肢の絞込みの動作について説明する。図8のAは、実行可能関数絞込部23の実行回数による選択肢の絞込みのフローを示す図である。
(Explanation of executable function narrowing process)
An operation for narrowing down options according to the number of executions of the executable
ステップS21では、実行可能関数絞込部23が実行系列テーブル27から各実行関数が呼び出された回数を集計して、実行回数テーブル28を更新する。
例えば、実行系列テーブル27の更新は次のように行われる。まず、図9の初期状態から状態1に遷移し現在の状態が状態1のとき、実行系列テーブル27の「実行関数」には「開始」のみが記録されている。実行可能関数絞込部23は、実行回数テーブル28の「関数」に「開始」を記録するとともに、「開始」に対応する開始関数が1回実行されたことを実行回数テーブル28の「実行回数」に記録する。
In step S <b> 21, the executable
For example, the execution sequence table 27 is updated as follows. First, when the state transitions from the initial state of FIG. 9 to
次に、図9に示す状態1から状態5に入力完了関数を選択して遷移すると、実行系列テーブル27の「実行関数」には「開始」に加え「入力完了」が記録されるため、実行可能関数絞込部23は、実行回数テーブル28の「関数」に「入力完了」を記録する。また、「入力完了」が1回実行されたことを実行回数テーブル28の「実行回数」に記録する。
Next, when an input completion function is selected and transitioned from
次に、図9に示す状態5から状態2に商品選択関数を選択して遷移すると、実行系列テーブル27の「実行関数」にさらに「商品選択」が加えて記録されるため、実行可能関数絞込部23は、実行回数テーブル28の「関数」に「商品選択」を記録する。また、「入力完了」が1回実行されたことを実行回数テーブル28の「実行回数」に記録する。
Next, when a product selection function is selected and transitioned from
上記のように実行回数テーブル28を更新することにより、現在の状態が状態2に至ったとき、実行回数テーブル28が図8のCに示すように、「開始」「入力完了」「商品選択」に対応する実行回数にそれぞれ「1」「1」「1」が記録される。
When the current state reaches
ステップS22では、実行可能関数絞込部23が実行選択肢テーブル26から現在の状態に対応する行を1つ選択する。
ステップS23では、実行可能関数絞込部23がステップS22で選択した行の「選択肢」に記録されている関数をキーに実行回数テーブル28から、その関数の実行回数を取得する。
In step S <b> 22, the executable
In step S23, the executable
ステップS24では、実行可能関数絞込部23がステップS22で選択した関数の実行回数が、予め設定した指定回数(実行回数上限値)以上であるかを判定する。指定回数以上であればステップS25に移行し、指定回数に達していなければステップS27に移行する。
In step S24, it is determined whether the number of executions of the function selected by the executable
ステップS25では、実行可能関数絞込部23が実行抑止関数テーブル29に現在の状態と選択肢から除外した関数を記録する。
ステップS26では、実行可能関数絞込部23が実行選択肢テーブル26からステップS22で選択した行を削除する。
In step S <b> 25, the executable
In step S26, the executable
ステップS27では、実行可能関数絞込部23が実行選択肢テーブル26の現在の状態に対応する全ての行を処理したかを判定する。
例えば、図9の状態2に遷移すると、実行選択肢テーブル26の記録内容は図8のDに示すような状態になる。ステップS22では、実行可能関数絞込部23が図8のDの実行選択肢テーブル26から状態2に対応する「状態2」「入力完了」または「状態2」「商品選択」を有する行のどちらかを選択する。本例では「状態2」「入力完了」を選択する。
In step S <b> 27, it is determined whether the executable
For example, when the state transits to the
ステップS23では、実行可能関数絞込部23が「入力完了」をキーにして、実行回数テーブル28の「入力完了」に対応する「実行回数」に記録されている「1」を取得する。ステップS24では、「入力完了」に対応する実行回数「1」と予め設定されている実行回数上限値「1」を比較し、実行回数が実行回数上限値に達しているためステップS25に移行する。ステップS25では、実行可能関数絞込部23が、入力完了関数が既に実行された関数であると判断して、実行選択肢テーブル26から「状態2」「入力完了」の行を削除する。ステップS26では、実行可能関数絞込部23が実行抑止関数テーブル29の「状態」「抑止関数」に対応する箇所に「状態2」「入力完了」をそれぞれ記録する。ステップS27では、実行可能関数絞込部23が実行選択肢テーブル26の現在の状態に対応するすべての行を処理したかを判定する。本例では実行選択肢テーブル26にまだ「状態2」「商品選択」があるためステップS22に移行する。
In step S <b> 23, the executable function narrowing down
実行選択肢テーブル26の「状態2」「商品選択」についても、上記と同じようにステップS22〜S27の処理を行う。その結果、実行抑止関数テーブル29、実行選択肢テーブル26が図8のE、Fに示すように更新され、実行可能関数絞込処理を終了する。
なお、図9の「×」は抑止された関数であることを示す。
For “
Note that “x” in FIG. 9 indicates a inhibited function.
(実行可能関数絞込処理の実行抑止再評価の説明)
図10は、図4のステップS5(実行可能関数絞込処理)の動作を示すフロー図である。
図4のステップS3において、状態遷移グラフ管理テーブル25に記録されている状態のためステップS5に移行したとき、ステップS31〜S38の処理を行う。
(Explanation of execution suppression re-evaluation of executable function screening processing)
FIG. 10 is a flowchart showing the operation of step S5 (executable function narrowing process) in FIG.
In step S3 of FIG. 4, when the process proceeds to step S5 due to the state recorded in the state transition graph management table 25, the processes of steps S31 to S38 are performed.
図11を用いて実行可能関数絞込処理の実行抑止再評価の説明をする。図11は、ステップS5に移行したとき、初期状態−状態5−状態2に至るプログラムモデル検査を実施し、その後バックトラックして状態1において商品選択関数を実行し状態2へ遷移したことを示す図である。
Execution suppression re-evaluation of the executable function narrowing process will be described with reference to FIG. FIG. 11 shows that when the process proceeds to step S5, a program model check from initial state-
ステップS31では、実行可能関数絞込部23が実行抑止関数テーブル29に現在の状態に対応する行があるか判定する。実行抑止関数テーブル29に現在の状態があればステップS32に移行し、なければ図4のステップS11に移行する。
In step S31, the executable
例えば、現在の状態が状態2であれば、実行可能関数絞込部23が図11のBの実行抑止関数テーブル29の「状態」に「状態2」があるかを検索する。図11のBの実行抑止関数テーブル29には「状態2」があるためステップS32に移行する。
For example, if the current state is
ステップS32では、ステップ4と同じように実行可能関数絞込部23が実行回数による選択肢の絞込みを行う。
図12のAは、実行回数により関数の実行抑止を行った状態に再度到達した場合の実行可能関数絞込部23の実行回数による選択肢の絞込みのフローを示す図である。
In step S32, as in step 4, the executable
FIG. 12A is a diagram illustrating a flow of narrowing down options according to the number of execution times of the executable
ステップS21では、実行可能関数絞込部23が、図12のBの実行系列テーブル27から各実行関数が呼び出された回数を集計して図12のCの実行回数テーブル28を更新する。状態2において実行された関数は、図12のBの実行系列テーブル27に記録された「開始」「商品選択」に対応付けられた関数である。図12のCの実行回数テーブル28には、「開始」「商品選択」がそれぞれ1回実行されているので「実行回数」にそれぞれ「1」が記録される。
In step S21, the executable
ステップS22では、実行可能関数絞込部23が現在の状態で実行可能な関数(選択肢)を実行選択肢テーブル26から1つ選択する。本例では、状態2に対応する選択肢として実行選択肢テーブル26に「入力完了」「商品選択」があるため、「状態2」「商品選択」を有する行を選択する。
In step S <b> 22, the executable
ステップS23では、ステップS22で選択した行の選択肢をキーに実行回数テーブル28から、その関数の実行回数を取得する。
ステップS24では、実行可能関数絞込部23がステップS22で選択した関数の実行回数が、予め設定した指定回数(実行回数上限値)以上であるかを判定する。本例では、実行回数上限値「1」に商品選択関数の実行回数「1」が達しているためステップS25に移行し、達していなければステップS27に移行する。
In step S23, the number of executions of the function is acquired from the number-of-executions table 28 using the row option selected in step S22 as a key.
In step S24, it is determined whether the number of executions of the function selected by the executable
ステップS25では、実行可能関数絞込部23が実行抑止関数テーブル29に現在の状態と選択肢「商品選択」を記録する。
ステップS26では、実行可能関数絞込部23が実行選択肢テーブル26からステップS22で選択した行を削除する。
In step S <b> 25, the executable
In step S26, the executable
ステップS25、S26の処理をした結果、実行抑止関数テーブル29、実行選択肢テーブル26は、図12のE、Fに示すような状態になる。
ステップS27では、実行可能関数絞込部23が実行選択肢テーブル26の現在の状態に対応する全ての行を処理したかを判定する。本例では、実行選択肢テーブル26の「状態2」「入力完了」が残っているのでステップS22に移行する。
As a result of the processing in steps S25 and S26, the execution suppression function table 29 and the execution option table 26 are in a state as shown in E and F of FIG.
In step S <b> 27, it is determined whether the executable
ステップS22に移行した後、実行選択肢テーブル26の「状態2」「入力完了」についても、上記と同じようにステップS22〜S27の処理を行う。ステップS27において実行選択肢テーブル26の全ての行に対して処理を行えば、実行可能関数絞込処理を終了して図10のAのステップS33に移行する。
After shifting to step S22, the processing of steps S22 to S27 is performed in the same manner as described above for “
ステップS33では、実行可能関数絞込部23が実行抑止関数テーブル29に現在の状態に対応する行があるか判定し、現在の状態に対応する行があればステップS34に移行し、なければステップS6に移行する。本例では、図12のEに示されているように現在の実行抑止関数テーブル29には、現在の状態である状態2に対応する「状態2」「入力完了」を有する行と「状態2」「商品選択」を有する行があるのでステップS34に移行する。
In step S33, the executable
ステップS34では、実行可能関数絞込部23が実行選択肢テーブル26から現在の状態に対応する行を1つ選択する。本例では、図12のFに示されるように現在の実行選択肢テーブル26から現在の状態である状態2に対応する「状態2」「入力完了」を選択する。
In step S <b> 34, the executable
ステップS35では、実行可能関数絞込部23がステップS34で選択した行の選択肢と現在の状態に対応する行が実行抑止関数テーブル29にあるか判定し、ある場合にはステップS36に移行し、ない場合はステップS37に移行する。本例では、図12のFに示したように現在の実行選択肢テーブル26に、現在の状態である状態2に対応する「状態2」「入力完了」が、現在の実行抑止関数テーブル29にあるためステップS36に移行する。
In step S35, it is determined whether or not the executable
ステップS36では、実行可能関数絞込部23が対応する実行抑止関数テーブル29の行を削除する。本例では、図12のEに示す実行抑止関数テーブル29から「状態2」「入力完了」を有する行を削除する。その結果、図13に示すように実行抑止関数テーブル29が更新される。
In step S36, the executable
ステップS37では、実行可能関数絞込部23が選択した実行選択肢テーブル26の行を削除する。つまり、抑止されていないので既にこの状態から実行済みであると判断できるため実行選択肢テーブル26から「状態2」「入力完了」を有する行を削除する。
In step S37, the row of the execution option table 26 selected by the executable
ステップS38では、実行可能関数絞込部23が実行選択肢テーブル26の全ての行の処理をしたか判定し、全ての行に対して処理が終了すれば図4のステップS6に移行し、未処理の行が残っていればステップS34に移行する。
In step S38, it is determined whether the executable
上記のように実行可能関数絞込処理をすることで、プログラムモデル検査中の関数の実行系列において、同じ関数の予め設定した回数以上の呼出を抑止することができる。且つ、実行可能関数絞込処理と実行抑止再評価をすることにより、抑止した関数を実行すべきかを実行済み状態到達時に再度評価することで、関数の選択順序の違いによる探索結果の違いをなくし、関数の実行を過剰に抑止することなくモデル検査の探索範囲を抑えることができる。
よって、大規模なプログラムに対するプログラムモデル検査が現実的な時間で実施できるようになる。
By executing the executable function narrowing-down process as described above, it is possible to prevent the same function from being called more than a preset number in the execution sequence of the function being checked. In addition, by executing executable function narrowing processing and execution suppression re-evaluation, it is possible to eliminate differences in search results due to differences in the function selection order by re-evaluating whether the suppressed function should be executed when the completed state is reached. The search range of model checking can be suppressed without excessively suppressing the execution of functions.
Therefore, program model checking for a large-scale program can be performed in a realistic time.
(実施例2)
実施例2は、実行可能関数絞込処理を実施する際に、関数ごとに実行回数の実行回数上限値を設定するものである。関数ごとに予め実行回数上限値を記録実行回数上限テーブルに記録し、関数ごとに予め実行回数上限値に基づいて、現在の状態における実行可能な関数の実行を抑止するか否かを判定する。
(Example 2)
In the second embodiment, when the executable function narrowing process is performed, the upper limit value of the number of executions is set for each function. For each function, the execution number upper limit value is recorded in advance in the recording execution number upper limit table, and it is determined for each function in advance whether execution of an executable function in the current state is to be suppressed based on the execution number upper limit value.
図14は実施例2におけるプログラムモデル検査装置40の構成を示す図である。実施例2では、プログラムモデル検査装置40の記録部24に実行回数上限テーブル41を有し、実行可能関数絞込部23が実行回数上限値を取得して、関数ごとの実行回数が最適になるように設定する。
FIG. 14 is a diagram illustrating the configuration of the program
実行回数上限テーブル41は、プログラムモデル検査で実行される関数に対応する関数名などを記録する「関数」、関数ごとに実行回数の上限値を設定する「実行回数上限」を有している。なお、「実行回数上限」への上限値の入力はユーザが行う。 The execution number upper limit table 41 has a “function” that records a function name corresponding to a function executed in the program model check, and an “execution number upper limit” that sets an upper limit value for the number of executions for each function. Note that the user inputs the upper limit value in the “execution count upper limit”.
図15のAに実施例2の動作を示すフロー図を示す。ステップS21〜S23では実施例1と同じように処理を行う。
ステップS41では、実行可能関数絞込部23がステップS22で選択した関数の上限を実行回数上限テーブル41から取得する。例えば、図15のBに示すように実行回数上限テーブル41に、「関数」として「開始」「入力完了」・・・「終了」、「実行回数上限」として「開始」「入力完了」・・・「終了」に対応する「1」「3」・・・「1」が記録されているとする。ステップS23で「入力完了」の実行回数が取得されていれば、実行可能関数絞込部23が実行回数上限テーブル41の「入力完了」に対応する実行回数上限値を取得する。
FIG. 15A is a flowchart showing the operation of the second embodiment. In steps S21 to S23, processing is performed in the same manner as in the first embodiment.
In step S41, the executable
ステップS24では、ステップS41で取得した実行回数と実行回数上限値を比較して、実行回数が実行回数上限値以上であるかを判定する。実行回数が実行回数上限値以上であればステップS25に移行し、実行回数上限値より小さければステップS27に移行する。なお、図15のBに示されている「無制限」ついては上限値がないことを意味しており、必ずステップS25に移行し、購入関数が指定された場合は何度でも実行する。 In step S24, the execution count acquired in step S41 is compared with the execution count upper limit value to determine whether the execution count is equal to or greater than the execution count upper limit value. If the number of executions is greater than or equal to the upper limit of execution times, the process proceeds to step S25, and if smaller than the upper limit of execution times, the process proceeds to step S27. Note that “unlimited” shown in FIG. 15B means that there is no upper limit value, and the process always moves to step S25, and is executed any number of times when a purchase function is designated.
ステップS25以降は、実施例1と同じように処理を行う。
上記のように実行回数上限値を関数ごとに設定することにより、関数実行抑止を制御できるので、目的の関数の動作を詳しく調べることができる。
After step S25, processing is performed in the same manner as in the first embodiment.
As described above, the function execution inhibition can be controlled by setting the upper limit number of executions for each function, so that the operation of the target function can be examined in detail.
(実施例3)
実施例3は、プログラムモデル検査終了後、実行抑止関数テーブル29にm箇所以上の状態で抑止された関数がある場合、実行回数上限テーブル41の中の対応する関数の実行回数上限値を増やして、再度プログラムモデル検査を実行するものである。なお、mは1以上の整数である。
(Example 3)
In the third embodiment, after the program model check is completed, when there are functions inhibited in m or more places in the execution inhibition function table 29, the execution number upper limit value of the corresponding function in the execution number upper limit table 41 is increased. The program model check is executed again. Note that m is an integer of 1 or more.
図16は、実施例3におけるプログラムモデル検査装置50の構成を示す図である。実施例3のプログラムモデル検査装置50は、実施例2の機能にさらに、記録部24の実行回数上限テーブル41を制御するとともに、再度プログラムモデル検査の実行を指示するモデル検査再実行部51を備える。
FIG. 16 is a diagram illustrating a configuration of the program
モデル検査再実行部51は、実行抑止関数テーブル29にm箇所以上の状態で抑止された関数がある場合、実行回数上限テーブル41の中の対応する関数の実行回数上限値を予め設定した値に更新する。また、モデル検査再実行部51は、更新した実行回数上限テーブル41を利用して再度プログラムモデル検査を実行する指示をプログラム実行部22に通知する。
The model
図17に実施例3の動作を示すフロー図を示す(モデル検査再実行処理)。
ステップS51では、1回目のプログラムモデル検査が完了したことを、モデル検査再実行部51が検知する。
FIG. 17 is a flowchart showing the operation of the third embodiment (model check re-execution process).
In step S51, the model checking
ステップS52では、モデル検査再実行部51が実行抑止関数テーブル29の「抑止関数」に基づいて抑止された関数ごとの集計を行い、集計の結果、予め設定した値よりm箇所以上の状態で抑止されている関数を検出する。
In step S52, the model checking
ステップS53では、モデル検査再実行部51が実行回数上限テーブル41の該当する関数の実行回数上限値を変更する。
ステップS52、S53の動作について図18、19を用いて説明する。
In step S53, the model checking
Operations in steps S52 and S53 will be described with reference to FIGS.
例えば、1回目のプログラムモデル検査を行ったとき、図18のAに示すような状態遷移をしたとし、1回目のプログラムモデル検査が完了した時点の実行抑止関数テーブル29の記録内容が図18のBに示されるようになったとする。また、図18のBの実行抑止関数テーブル29の結果を得たときの実行回数上限テーブル41が図18のCに示す設定であったとする。なお、図18のA、B、Cに示される「a」「b」「c」は関数を示している。 For example, when the first program model check is performed, the state transition as shown in FIG. 18A is performed, and the recorded content of the execution suppression function table 29 at the time when the first program model check is completed is shown in FIG. Suppose that it comes to be shown by B. Further, it is assumed that the execution number upper limit table 41 when the result of the execution suppression function table 29 of B of FIG. 18 is obtained has the setting shown in C of FIG. Note that “a”, “b”, and “c” shown in A, B, and C of FIG. 18 indicate functions.
図18のBにおいて、モデル検査再実行部51が実行抑止関数テーブル29の「抑止関数」に記録されているa関数に基づいて「状態2」「状態5」においてa関数が抑止されていることを検出する。モデル検査再実行部51が、a関数が2箇所の状態で抑止されているため、a関数に関連付けて「2」を記録する。
In B of FIG. 18, the model
次に、モデル検査再実行部51が、予め設定されている実行回数上限値に加算する値である「1」とa関数に対応する実行回数上限値を「1」を加算して「2」を算出する。そして、図19のCに示すように実行回数上限テーブル41のa関数に対応する実行回数上限値を「1」から「2」に変更する。
なお、本例では実行回数上限値に加算する値は「1」にしているが限定されるものではなく、ユーザが設定してもよい。
Next, the model checking
In this example, the value added to the upper limit of the number of executions is set to “1”, but the value is not limited and may be set by the user.
ステップS53では、モデル検査再実行部51が実行回数上限テーブル41の実行回数上限値の変更が完了したことを検知して、2回目のプログラムモデル検査を実行する指示を通知する。
In step S <b> 53, the model checking
プログラムモデル検査装置50はプログラムモデル検査を実行する。その結果、図19のAに示すように、状態2、状態5から状態3に移行し、状態3から状態4(d関数を実行)に移行し、状態4から終了(e関数を実行)する新しい状態遷移についてプログラムモデル検査を実行することができる。
ステップS54では、プログラムモデル検査装置50が2回目のプログラムモデル検査が完了する。
The program
In step S54, the program
上記のように実行回数上限テーブル41の実行回数上限値を、実行抑止関数テーブル29の抑止関数ごとの集計結果に基づいて行うことにより、1回目(図18のA、B)と2回目(図19のA、B)に示すように実行回数上限値の設定に起因した、検査対象の関数が実行されなくなる現象を避けることができる。そのため、実行回数の制限を安全に行うことができる。また、全ての実行系列のなかで、実行回数制限数までの実行が保証される。 As described above, the upper limit of the number of executions in the execution number upper limit table 41 is performed based on the total result for each inhibition function in the execution inhibition function table 29, so that the first time (A and B in FIG. 18) and the second time (FIG. As shown in 19 A and B), it is possible to avoid the phenomenon that the function to be inspected is not executed due to the setting of the upper limit of the number of executions. Therefore, it is possible to safely limit the number of executions. In addition, the execution up to the limited number of executions is guaranteed in all execution series.
(本実施例がコンピュータプログラムとして実現される場合の構成)
図20は、上記実施形態の装置を実現できるコンピュータのハードウェア構成の一例を示す図である。
コンピュータのハードウェア90は、CPU91、記録部92(24)(ROM、RAM、ハードディスクドライブなど)、記録媒体読取装置93、入出力インタフェース94(入出力I/F)、通信インタフェース95(通信I/F)などを備えている。また、上記各構成部はバス96によってそれぞれ接続されている。
(Configuration when this embodiment is realized as a computer program)
FIG. 20 is a diagram illustrating an example of a hardware configuration of a computer that can implement the apparatus according to the embodiment.
The
CPU91は、記録部92に格納されている上記説明したプログラムモデル検査を実行するプログラム実行処理と、プログラム制御処理、実行可能関数絞込処理、実行抑止再評価処理、モデル検査再実行処理(図4、8、10、12、15、17に示した処理)を実行する。
The
記録部92は、CPU91が実行するプログラムやデータが記録されている。また、ワークエリアなどとして使用される。
記録媒体読取装置93は、CPU91の制御にしたがって記録媒体93aに対するデータのリード/ライトを制御する。そして、記録媒体93a、記録媒体読取装置93の制御で書き込まれたデータを記憶したり、記録媒体93aに記憶されたデータを読み取らせたりする。また、着脱可能な記録媒体93aは、コンピュータで読み取り可能な記録媒体として、磁気記録装置、光ディスク、光磁気記録媒体、半導体メモリなどがある。磁気記録装置には、ハードディスク装置(HDD)などがある。光ディスクには、DVD(Digital Versatile Disc)、DVD−RAM(Random Access Memory)、CD−ROM(Compact Disc Read Only Memory)、CD−R(Recordable)/RW(ReWritable)などがある。光磁気記録媒体には、MO(Magneto-Optical disk)などがある。
The
The recording
入出力インタフェース94には、入出力装置94a(マウス、キーボード、ディスプレイなど)が接続され、ユーザが入力した情報を受信し、バス96を介してCPU91に送信する。また、CPU91からの命令に従ってディスプレイの画面上に操作情報などを表示する。
An input /
通信インタフェース95は、必要に応じ、他のコンピュータとの間のLAN接続やインターネット接続や無線接続のためのインタフェースである。また、他の装置に接続され、外部装置からのデータの入出力を制御する。
The
このようなハードウェア構成を有するコンピュータを1台または2台以上用いることによって、上記説明した各種処理機能(実施例で説明した処理(フローチャートなど))が実現される。その場合システムが有すべき機能の処理内容を記述したプログラムが提供される。そのプログラムをコンピュータで実行することにより、上記処理機能がコンピュータ上で実現される。処理内容を記述したプログラムは、コンピュータで読み取り可能な記録媒体93aに記録しておくことができる。 By using one or more computers having such a hardware configuration, the various processing functions described above (the processing described in the embodiments (such as flowcharts)) are realized. In that case, a program describing the processing contents of the functions that the system should have is provided. By executing the program on a computer, the above processing functions are realized on the computer. The program describing the processing contents can be recorded in a computer-readable recording medium 93a.
プログラムを流通させる場合には、例えば、そのプログラムが記録されたDVD、CD−ROMなどの可搬型記録媒体が販売される。また、プログラムをサーバコンピュータの記憶装置に格納しておき、ネットワークを介して、サーバコンピュータから他のコンピュータにそのプログラムを転送することもできる。 When distributing the program, for example, a portable recording medium such as a DVD or a CD-ROM in which the program is recorded is sold. It is also possible to store the program in a storage device of a server computer and transfer the program from the server computer to another computer via a network.
プログラムを実行するコンピュータは、例えば、可搬型記録媒体に記録されたプログラムもしくはサーバコンピュータから転送されたプログラムを、自己の記憶装置に格納する。そして、コンピュータは、自己の記憶装置からプログラムを読み取り、プログラムに従った処理を実行する。なお、コンピュータは、可搬型記録媒体から直接プログラムを読み取り、そのプログラムに従った処理を実行することもできる。また、コンピュータは、サーバコンピュータからプログラムが転送されるごとに、逐次、受け取ったプログラムに従った処理を実行することもできる。 The computer that executes the program stores, for example, the program recorded on the portable recording medium or the program transferred from the server computer in its own storage device. Then, the computer reads the program from its own storage device and executes processing according to the program. The computer can also read the program directly from the portable recording medium and execute processing according to the program. Further, each time the program is transferred from the server computer, the computer can sequentially execute processing according to the received program.
また、本発明は、上記実施の形態に限定されるものでなく、本発明の要旨を逸脱しない範囲内で種々の改良、変更が可能である。 The present invention is not limited to the above-described embodiment, and various improvements and modifications can be made without departing from the gist of the present invention.
1 ドライバ、
2 検査対象プログラム、
3 データベーススタブ、
4 ネットワークスタブ、
5 プログラムモデル検査装置、
6 入力データ、
7 プロパティ、
21 プログラム制御部、
22 プログラム実行部、
23 実行可能関数絞込部、
24 記録部、
25 状態遷移グラフ管理テーブル、
26 実行選択肢テーブル、
27 実行系列テーブル、
28 実行回数テーブル、
29 実行抑止関数テーブル、
40 プログラムモデル検査装置、
41 実行回数上限テーブル、
50 プログラムモデル検査装置、
51 モデル検査再実行部、
90 ハードウェア、
91 CPU、
92 記録部、
93 記録媒体読取装置、
93a 記録媒体、
94 入出力インタフェース、
94a 入出力装置、
95 通信インタフェース、
96 バス、
1 driver,
2 Program to be inspected,
3 Database stub,
4 Network stub,
5 Program model checking device,
6 Input data,
7 properties
21 Program control unit,
22 program execution unit,
23 Executable function narrowing down part,
24 recording section,
25 State transition graph management table,
26 execution option table,
27 execution sequence table,
28 Execution count table,
29 Execution suppression function table,
40 Program model checking device,
41 Execution count upper limit table,
50 program model checking device,
51 Model inspection re-execution unit,
90 hardware,
91 CPU,
92 recording section,
93 recording medium reader,
93a recording medium,
94 I / O interface,
94a I / O device,
95 communication interface,
96 buses,
Claims (3)
前記プログラムモデル検査装置が、
現在の状態から実行可能な関数の実行回数が、前記実行回数上限値以上である場合に、該関数の実行を抑止して該関数実行系列の検査を終了し、該関数を該現在の状態に関連付けて実行を抑止する関数を定義した実行抑止関数テーブルに記録するステップと、
他の関数実行系列において、現在の状態への遷移がすでに行われているとき、前記実行抑止関数テーブルに該現在の状態と該現在の状態から実行可能な関数との組み合わせがあるか否かを判定する判定ステップと、
前記判定ステップにおいて前記組み合わせがある場合にのみ該関数を実行するステップと、
を実行することを特徴とするプログラムモデル検査方法。 A program model in which a program model checking device executes a function that can be executed from each state in a test target program having a plurality of function execution sequences and whose execution count within the function execution sequence is less than the upper limit of execution counts. An inspection method,
The program model checking device is
When the number of executions of a function that can be executed from the current state is equal to or greater than the upper limit value of the number of executions, the execution of the function is suppressed and the inspection of the function execution sequence is terminated, and the function is brought into the current state. A step of recording in the execution suppression function table in which the functions to suppress execution in association are defined;
In another function execution sequence, when a transition to the current state has already been made, whether or not there is a combination of the current state and a function executable from the current state in the execution suppression function table A determination step for determining;
Executing the function only when there is the combination in the determining step;
A program model checking method comprising:
コンピュータに、
現在の状態から実行可能な関数の実行回数が、前記実行回数上限値以上である場合に、該関数の実行を抑止して該関数実行系列の検査を終了し、該関数を該現在の状態に関連付けて実行を抑止する関数を定義した実行抑止関数テーブルに記録する処理と、
他の関数実行系列において、現在の状態への遷移がすでに行われているとき、前記実行抑止関数テーブルに該現在の状態と該現在の状態から実行可能な関数との組み合わせがあるか否かを判定する判定処理と、
前記判定処理において前記組み合わせがある場合にのみ該関数を実行する処理と、
を実行させることを特徴とするプログラムモデル検査プログラム。 A program model checking program that executes a function that can be executed from each state in a test target program having a plurality of function execution series, and that has an execution count within the function execution series that is less than the upper limit of execution counts.
On the computer,
When the number of executions of a function that can be executed from the current state is equal to or greater than the upper limit value of the number of executions, the execution of the function is suppressed and the inspection of the function execution sequence is terminated, and the function is brought into the current state. Processing to record in the execution suppression function table that defines the functions to suppress execution in association with each other;
In another function execution sequence, when a transition to the current state has already been made, whether or not there is a combination of the current state and a function executable from the current state in the execution suppression function table A determination process for determining;
A process of executing the function only when there is the combination in the determination process;
A program model checking program characterized in that
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009152826A JP5321286B2 (en) | 2009-06-26 | 2009-06-26 | Program model checking method, program model checking program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009152826A JP5321286B2 (en) | 2009-06-26 | 2009-06-26 | Program model checking method, program model checking program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2011008628A true JP2011008628A (en) | 2011-01-13 |
JP5321286B2 JP5321286B2 (en) | 2013-10-23 |
Family
ID=43565181
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2009152826A Expired - Fee Related JP5321286B2 (en) | 2009-06-26 | 2009-06-26 | Program model checking method, program model checking program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5321286B2 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2014063415A (en) * | 2012-09-24 | 2014-04-10 | Mitsubishi Electric Corp | Test case automatic generation device and test case automatic generation program |
WO2019142266A1 (en) * | 2018-01-17 | 2019-07-25 | 三菱電機株式会社 | Test case generation device, test case generation method, and test case generation program |
US11994977B2 (en) | 2019-03-25 | 2024-05-28 | Mitsubishi Electric Corporation | Test case generation apparatus, test case generation method, and computer readable medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2004005399A (en) * | 2002-04-05 | 2004-01-08 | Sharp Corp | Method and device for testing software |
JP2007018378A (en) * | 2005-07-08 | 2007-01-25 | I L C:Kk | Debugging support system, method, target program, and host program |
-
2009
- 2009-06-26 JP JP2009152826A patent/JP5321286B2/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2004005399A (en) * | 2002-04-05 | 2004-01-08 | Sharp Corp | Method and device for testing software |
JP2007018378A (en) * | 2005-07-08 | 2007-01-25 | I L C:Kk | Debugging support system, method, target program, and host program |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2014063415A (en) * | 2012-09-24 | 2014-04-10 | Mitsubishi Electric Corp | Test case automatic generation device and test case automatic generation program |
WO2019142266A1 (en) * | 2018-01-17 | 2019-07-25 | 三菱電機株式会社 | Test case generation device, test case generation method, and test case generation program |
JPWO2019142266A1 (en) * | 2018-01-17 | 2020-04-16 | 三菱電機株式会社 | Test case generation device, test case generation method, and test case generation program |
US11347628B2 (en) | 2018-01-17 | 2022-05-31 | Mitsubishi Electric Corporation | Test case generation apparatus, test case generation method, and computer readable medium |
US11994977B2 (en) | 2019-03-25 | 2024-05-28 | Mitsubishi Electric Corporation | Test case generation apparatus, test case generation method, and computer readable medium |
Also Published As
Publication number | Publication date |
---|---|
JP5321286B2 (en) | 2013-10-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4941040B2 (en) | Test specification generation program and test specification generation device | |
JP5198132B2 (en) | State transition test support device, state transition test support program, and state transition test support method | |
KR20090084905A (en) | Method and system for graphical user interface testing | |
CN105446874A (en) | Method and device for detecting resource configuration file | |
US7512913B2 (en) | Designing apparatus, designing method, and program thereof | |
CN106484389A (en) | Stream of action sectional management | |
JP5321286B2 (en) | Program model checking method, program model checking program | |
US20130326466A1 (en) | Human Readable Software Program Test Step | |
JP6120607B2 (en) | Requirement detection apparatus and requirement detection program | |
US8015523B2 (en) | Method and system for sequential netlist reduction through trace-containment | |
JP5799823B2 (en) | Test data generation device, test data generation program, and test data generation method | |
JP2013003854A (en) | Test data generation program, test data generation method and test data generation device | |
JP2008305019A (en) | Simulation device, simulation method and program | |
WO2013058252A1 (en) | Model examination support method, model examination support program, and model examination support device | |
US6745374B2 (en) | Algorithms for determining path coverages and activity | |
JP5319643B2 (en) | Software product line development support apparatus and method | |
JP2019091130A (en) | Question presentation control program, retrieval method, and retrieval device | |
KR102417677B1 (en) | Similar circuit searching method and apparatus for verifing circuit | |
CN111259063B (en) | Method and device for realizing data export in API mode | |
JPWO2018154784A1 (en) | Influence extraction device, influence extraction program and influence extraction method | |
JP5417359B2 (en) | Document evaluation support system and document evaluation support method | |
JP2013012082A (en) | Test data generation program, test data generation method, and test data generation device | |
JP6959513B2 (en) | Analytical device and analysis method | |
Velozo et al. | Evaluation of a Mobile Software Development Company | |
JP2008191796A (en) | Analysis device, analysis method and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20120309 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20130612 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20130618 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20130701 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |