JP2006024006A - Test case generation device, test case generation program, model base development program, device and program for diagnosing validity of source code generation, and method for developing model base - Google Patents
Test case generation device, test case generation program, model base development program, device and program for diagnosing validity of source code generation, and method for developing model base Download PDFInfo
- Publication number
- JP2006024006A JP2006024006A JP2004201861A JP2004201861A JP2006024006A JP 2006024006 A JP2006024006 A JP 2006024006A JP 2004201861 A JP2004201861 A JP 2004201861A JP 2004201861 A JP2004201861 A JP 2004201861A JP 2006024006 A JP2006024006 A JP 2006024006A
- Authority
- JP
- Japan
- Prior art keywords
- model
- source code
- test case
- program
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/10—Requirements analysis; Specification techniques
Abstract
Description
本発明は、モデルに基づいて生成されたソースコードの処理内容に基づいて、そのソースコードのテストケースを生成するテストケース生成装置およびプログラム、モデルからソースコードの生成が妥当性を診断するソースコード生成妥当性診断装置およびプログラム、ならびにモデルベース開発プログラムに関する。 The present invention relates to a test case generation apparatus and program for generating a test case of a source code based on the processing content of the source code generated based on the model, and source code for diagnosing the validity of the source code generation from the model. The present invention relates to a generation validity diagnosis apparatus and program, and a model-based development program.
現在、例えば車両のエンジンECUの作動等、信号入出力制御のためのプログラムにおいては、開発者が直接そのプログラムのソースコードを記述せず、目的とするプログラムの機能を、より作成が簡易で視認性の良い「モデル」という形態で記述する場合がある(例えば特許文献1参照)。 Currently, in the program for signal input / output control such as the operation of the engine ECU of the vehicle, the developer does not write the source code of the program directly, and the function of the target program can be created more easily and visually. In some cases, it is described in the form of a good “model” (for example, see Patent Document 1).
開発者は、このモデルに対応したプログラム開発環境がインストールされたワークステーション、パーソナルコンピュータ等を用い、このモデルによって定義されたデータの入出力のシミュレーションを行い、また、モデルから自動的にソースコードを生成する。 The developer uses a workstation, personal computer, etc., with a program development environment that supports this model, and simulates the input / output of the data defined by this model. Generate.
モデルからソースコードを生成するようなプログラム開発は、モデルベース開発と呼ばれる。このモデルベース開発においてソースコードを生成するためのコード生成ツール、シミュレーションのためのシミュレーションツール等のプログラムは、統合環境としてのモデルベース開発プログラムの一部として提供されることが多い。 Program development that generates source code from a model is called model-based development. In this model-based development, programs such as a code generation tool for generating source code and a simulation tool for simulation are often provided as part of a model-based development program as an integrated environment.
モデルベース開発に対応したプログラム開発環境としては、例えば、Mathworks(登録商標)社のMatlab(登録商標)がある。Matlab(登録商標)においては、開発者はMatlab(登録商標)に対する付加機能を提供するソフトウェアであるSimulink(登録商標)を用いて、目的とするデータ入出力を表現するモデルを記述する。 As a program development environment corresponding to model-based development, there is Matlab (registered trademark) of Mathworks (registered trademark), for example. In Matlab (registered trademark), a developer describes a model that expresses target data input / output using Simulink (registered trademark), which is software that provides an additional function to Matlab (registered trademark).
モデルは、データ演算、データ入力およびデータ出力のうち少なくともいずれか1つの機能を実現する機能単位としてのブロック、およびブロック間の入出力関係を示す結線の組み合わせとして記述される。すなわち、複数のブロックが結線によって繋ぎ合わされることにより、車両制御等のデータ入出力を表現する集合体がモデルである。 The model is described as a combination of a block as a functional unit that realizes at least one of data calculation, data input, and data output, and a connection indicating an input / output relationship between the blocks. In other words, an aggregate that represents data input / output such as vehicle control by connecting a plurality of blocks by connection is a model.
このようなモデルベース開発環境においては、モデルやソースコードの品質評価を行うことが多い。品質評価とは、当該モデル、ソースコードが、プログラムの製品としてどのような品質を有しているかを、種々の基準から評価することをいう。品質評価の基準としては、例えばモデル中に実行されない分岐先があるか否か(すなわちカバレッジ)等がある。 In such a model-based development environment, quality evaluation of models and source code is often performed. Quality evaluation means evaluating the quality of the model and source code as a program product based on various criteria. The quality evaluation criteria include, for example, whether or not there is a branch destination that is not executed in the model (that is, coverage).
これらの品質評価には、モデルからソースコードへの変換が意図した通り適正に行われているか、すなわち、モデルによって記述された入出力の機能がソースコードに正しく反映されているか、を判断するという目的もある。 In these quality assessments, it is judged whether the conversion from the model to the source code is performed properly as intended, that is, whether the input / output functions described by the model are correctly reflected in the source code. There is also a purpose.
ソースコードの品質評価を行うためのツールとしては、ATG(Automatic Test case Generation)と呼ばれるものがある。ATGは、ソースコードの内容(例えば命令分岐の条件等)を解析し、できるだけ多くの命令分岐先の処理が実行されるようなテスト用入力データ(以降テストケースと記す)を生成する機能を有する。
しかし、このようなソースコードの内容のみに基づいて生成されるテストケースは、そのソースコードの元となったモデルの作成時に開発者が想定した入力データの性質(例えば範囲、精度)を反映しているとは言えない。したがって、ソースコードの内容のみに基づいて生成されるテストケースが、ソースコードの実行テストのためには不足がある場合、またはソースコードの実行のためには不必要なものを有している場合等が発生する可能性がある。 However, test cases generated based only on the contents of such source code reflect the nature (eg, range and accuracy) of the input data assumed by the developer when creating the model from which the source code was based. I can't say that. Therefore, when the test cases generated based only on the contents of the source code are insufficient for the execution test of the source code, or there are things that are unnecessary for the execution of the source code Etc. may occur.
本発明は上記点に鑑み、モデルに基づいて生成されたソースコードのためのテストケースを、よりモデル開発者の意図を反映したものにすることを第1の目的とする。 In view of the above points, the first object of the present invention is to make the test case for the source code generated based on the model more reflective of the intention of the model developer.
また、ATGによって生成されたテストケースは、ソースコードの内容に基づいたテストケースであることを踏まえ、このテストケースを入力として、そのソースコードの元となるモデルのシミュレーションを行うことで、モデルに基づくソースコードの生成の妥当性の診断を行うことを第2の目的とする。 In addition, based on the fact that the test case generated by ATG is a test case based on the contents of the source code, this test case is used as an input, and the model that is the source code is simulated, The second object is to diagnose the validity of the generation of the source code based on it.
上記第1の目的を達成するための本発明の特徴は、テストケース生成装置が、モデルに基づいて生成されたソースコードを読み出し、また、そのモデル内の情報を読み出し、読み出したソースコードの処理内容および読み出したモデル内の情報に基づいて、そのソースコードのテストケースを生成するようになっていることである。 A feature of the present invention for achieving the first object is that the test case generation device reads source code generated based on a model, reads information in the model, and processes the read source code The test case of the source code is generated based on the contents and the information in the read model.
このようになっていることで、テストケースは、ソースコードの内容に加え、そのモデル内の情報に基づいて生成されるので、よりモデル開発者の意図を反映したものとなっている。 In this way, since the test case is generated based on the information in the model in addition to the contents of the source code, it more reflects the intention of the model developer.
また、読み出す対象となるモデル内の情報は、具体的には、当該モデルへの入力データの許容上限値および許容下限値のうち少なくとも1つであるようになっていてもよい。このようになっていることで、生成されるテストケースは、許容上限値および許容下限値のいずれか1つが勘案されたものとなる。 In addition, the information in the model to be read may be specifically at least one of an allowable upper limit value and an allowable lower limit value of input data to the model. As a result, the generated test case takes into account one of the allowable upper limit value and the allowable lower limit value.
また、読み出す対象となるモデル内の情報は、具体的には、当該モデルへの入力データの精度情報であるようになっていてもよい。このようになっていることで、生成されるテストケースは、この精度情報が勘案されたものとなる。 In addition, the information in the model to be read may be specifically accuracy information of input data to the model. As a result, the generated test case takes into account this accuracy information.
また、このような第1の特徴を有するテストケース生成装置として実現された発明は、そのテストケース生成装置の機能を演算装置に実現させるためのプログラムとしても実現可能である。 The invention realized as a test case generation device having such a first feature can also be realized as a program for causing an arithmetic unit to realize the function of the test case generation device.
そして、そのようなプログラムは、制御の処理動作を記述するモデルに基づいてソースコードを生成する機能を演算装置に実現させるモデルベース開発プログラムの構成要素となり得る。 Such a program can be a component of a model-based development program that causes an arithmetic unit to realize a function of generating a source code based on a model describing a control processing operation.
また、上記第1の目的を達成するための本発明の第2の特徴は、テストケース生成装置が、モデルに基づいて生成されたソースコードを読み出し、また、モデルのシミュレーション状況解析結果を読み出し、読み出したソースコードの処理内容および読み出した解析結果の情報に基づいて、そのソースコードのテストケースを生成するようになっていることである。 The second feature of the present invention for achieving the first object described above is that the test case generation device reads the source code generated based on the model, and reads the simulation state analysis result of the model. The test case of the source code is generated based on the processing content of the read source code and the information of the read analysis result.
このようになっていることで、テストケースは、ソースコードの内容に加え、そのソースコードの元となったモデルのシミュレーション状況解析結果に基づいて生成されるので、よりモデル開発者の意図を反映したものとなっている。 In this way, the test case is generated based on the simulation status analysis result of the model that the source code is based on in addition to the contents of the source code, so it more reflects the intention of the model developer. It has become.
具体的には、対象となるモデルが、前段にあるモデルの処理結果の出力を入力として受けるようになっている場合は、シミュレーション状況解析結果として、その前段のモデルの当該出力データの情報を読み出し、その出力データの情報に基づいて、ソースコードのテストケースを生成するようになっていてもよい。このようになっていることで、生成されるテストケースは、そのテストケースの対象となるソースコードの元のモデルへの入力データの情報が勘案されたものとなる。 Specifically, when the target model receives the output of the processing result of the previous model as an input, the information of the output data of the previous model is read as the simulation status analysis result. The test case of the source code may be generated based on the information of the output data. In this way, the generated test case takes into account the information of the input data to the original model of the source code that is the target of the test case.
また、読み出す対象となる解析結果は、具体的には、当該入力データの上限値および下限値のうち少なくとも1つであるようになっていてもよい。このようになっていることで、生成されるテストケースは、当該モデルが入力を受けるデータの上限値および下限値のいずれか1つが勘案されたものとなる。 The analysis result to be read may be specifically at least one of an upper limit value and a lower limit value of the input data. In this way, the generated test case takes into account any one of the upper limit value and the lower limit value of data that the model receives input.
また、このような第2の特徴を有するテストケース生成装置として実現された発明は、そのテストケース生成装置の機能を演算装置に実現させるためのプログラムとしても実現可能である。 The invention realized as a test case generation device having the second feature as described above can also be realized as a program for causing an arithmetic unit to realize the function of the test case generation device.
そして、そのようなプログラムは、制御の処理動作を記述するモデルに基づいてソースコードを生成する機能を演算装置に実現させるモデルベース開発プログラムの構成要素となり得る。 Such a program can be a component of a model-based development program that causes an arithmetic unit to realize a function of generating a source code based on a model describing a control processing operation.
また、上記第2の目的を達成する本発明の第3の特徴は、ソースコード生成妥当性診断装置が、モデルから生成されたソースコードの内容に基づいて生成されたテストケースが前記モデルへ入力されることで行われた前記モデルのシミュレーションの結果に基ついて、そのソースコード生成の妥当性についての表示用の情報を記憶媒体に記憶させるようになっていることである。 The third feature of the present invention that achieves the second object described above is that the source code generation validity diagnosis device inputs a test case generated based on the contents of the source code generated from the model to the model. Based on the result of the simulation of the model performed as described above, the display information about the validity of the source code generation is stored in the storage medium.
このようにすることで、モデルに基づくソースコードの生成の妥当性の表示が行われる。 By doing so, the validity of the source code generation based on the model is displayed.
具体的には、ソースコード生成妥当性診断装置は、上記のテストケースがモデルへ入力されることで行われたモデルのシミュレーションの結果として、そのシミュレーションによって実行されなかったモデルの部分の情報を読み出し、この実行されなかったモデルの部分の情報に基づいて、前記ソースコード生成の妥当性についての表示用の情報を記憶媒体に記憶させるようになっていてもよい。 Specifically, the source code generation validity diagnostic device reads out information on the part of the model that was not executed by the simulation as a result of the simulation of the model performed by inputting the above test case into the model. The display information about the validity of the source code generation may be stored in a storage medium based on the information of the model portion that has not been executed.
また、このような第3の特徴を有するソースコード生成不適正部分表示装置として実現された発明は、そのソースコード生成不適正部分表示装置の機能を演算装置に実現させるためのプログラムとしても実現可能である。 Further, the invention realized as the source code generation inappropriate partial display device having the third feature as described above can also be realized as a program for causing the arithmetic unit to realize the function of the source code generation inappropriate partial display device. It is.
そして、そのようなプログラムは、制御の処理動作を記述するモデルに基づいてソースコードを生成する機能を演算装置に実現させるモデルベース開発プログラムの構成要素となり得る。 Such a program can be a component of a model-based development program that causes an arithmetic unit to realize a function of generating a source code based on a model describing a control processing operation.
また、本発明は、制御の処理動作を記述するモデルに基づいてソースコードを生成する手順と、生成されたソースコードを読み出す手順と、当該モデル内の情報を読み出す手順と、読み出されたソースコードの処理内容および読み出されたモデル内の情報に基づいて、当該ソースコードのテストケースを生成する手順と、生成されたテストケースを入力として、当該モデルのシミュレーションを行う手順と、を備えたモデルベース開発方法としても把握することができる。 In addition, the present invention provides a procedure for generating source code based on a model that describes a processing operation of control, a procedure for reading the generated source code, a procedure for reading information in the model, and a read source Based on the processing contents of the code and the information in the read model, a procedure for generating a test case of the source code and a procedure for simulating the model with the generated test case as an input are provided. It can also be understood as a model-based development method.
また、本発明は、制御の処理動作を記述するモデルに基づいてソースコードを生成する手順と、当該モデルのシミュレーションを行う手順と、当該モデルのシミュレーション状況の解析を行う手順と、生成されたソースコードを読み出す手順と、当該モデルのシミュレーション状況解析結果を読み出す手順と、読み出されたソースコードの処理内容および読み出された解析結果に基づいて、ソースコードのテストケースを生成する手順と、を備えたモデルベース開発方法としても把握することができる。 In addition, the present invention provides a procedure for generating source code based on a model describing a processing operation of control, a procedure for performing simulation of the model, a procedure for analyzing simulation status of the model, and a generated source A procedure for reading the code, a procedure for reading the simulation status analysis result of the model, and a procedure for generating a test case of the source code based on the processing content of the read source code and the read analysis result. It can also be understood as a model-based development method provided.
以下、本発明の一実施形態について説明する。図1に、本実施形態に係るモデル自動結合装置としてのパーソナルコンピュータ1の構成を示す。このパーソナルコンピュータ1は、ディスプレイ11、入力装置12、RAM13、ROM14、HDD(ハードディスクドライブ)15、CPU(演算装置に相当する)16等から構成される。
Hereinafter, an embodiment of the present invention will be described. FIG. 1 shows a configuration of a
ディスプレイ11は、CPU16から受けた映像信号を、ユーザ(開発者)に対して映像として表示する。
The
入力装置12は、キーボード、マウス等から構成され、ユーザが操作することにより、その操作に応じた信号をCPU16に出力する。
The
RAM13は読み出し、書き込み可能な揮発性メモリであり、ROM14は読み出し専用の不揮発性メモリであり、HDD15は読み出し、書き込み可能な不揮発性メモリである。ROM14、HDD15には、CPU16が読み出して実行するプログラム等があらかじめ記憶されている。またHDD15には、後述するモデルが記憶されている。
The
RAM13は、CPU16がROM14、HDD15に記憶されたプログラムを実行する際に、そのプログラムを一時的に保存するための記憶領域、および作業用のデータを一時的に保存するための記憶領域として用いられる。
The
CPU16は、パーソナルコンピュータ1に電源が投入されることによって起動すると、ROM14から所定のブートプログラムを読み出して実行し、このブートプログラムに規定されるオペレーティングシステム(以下OSと記す)その他のプログラムをHDD15から読み出して実行することにより、起動処理を行う。起動処理以後、電源が遮断されるまで、CPU16は、入力装置12からの信号、OSによって予め定められたスケジュール等に基づいて、HDD15に記録されている各種プログラムを当該OS上のプロセスとして実行する。また、上記の起動処理およびプロセスにおいて、CPU16は必要に応じて入力装置12から信号の入力を受け付け、またディスプレイ11に映像信号を出力し、またRAM13、HDD15に対してデータの読み出し/書き込みの制御を行う。
When the
本実施形態のCPU16は、車両制御のためのECUにおいて実行させるCソースコードをモデルから生成するための統合開発環境として、後述するプログラム群を実行するようになっている。
The
以下、CPU16がプログラムを実行することによって行う処理を、そのプログラム自体が行う処理であるとして説明を行う。
Hereinafter, the processing performed by the
図2に、この統合開発環境としてのモデルベース開発プログラム100の構成を示す。モデルベース開発プログラム100は、自動コード生成プログラム110、モデル情報抽出プログラム120、自動テストケース生成プログラム130、Cソースコード実行プログラム140、モデルシミュレーションプログラム150、モデルシミュレーション状況解析プログラム160、実行結果比較プログラム170、および結果表示プログラム180のプログラム群から構成される。これらプログラム群は、それぞれユーザの入力装置12を用いた実行開始の操作に基づいて、その実行が開始される。
FIG. 2 shows the configuration of the model-based
自動コード生成プログラム110は、ユーザによってよって作成され、HDD15に記憶されているモデル210を読み出し、この読み出したモデル210の示すデータ入出力処理を実現するための処理が記述されたCソースコードを生成する。自動コード生成プログラムの例としては、Mathworks(登録商標)社のReal Time Workshop(登録商標)がある。なお、モデルは、モデルエディタ等のモデル作成用プログラムをCPU16が実行し、その実行時にユーザがモデル作成のための作業を入力装置12を用いて行うことで、作成されるようなっていてもよい。このようなモデルエディタもモデルベース開発プログラム100に含まれていてもよい。
The automatic
ここで、モデルについて説明する。モデルは、時系列の中でのデータ演算、データ入力およびデータ出力のうち少なくともいずれか1つの機能を表すブロック、およびブロック間の入出力関係を示す結線の組み合わせとして記述される。モデルの例としては、Mathworks(登録商標)社のSimulink(登録商標)モデルがある。 Here, the model will be described. The model is described as a combination of blocks representing at least one of the functions of data calculation, data input and data output in time series, and a connection indicating an input / output relationship between the blocks. An example of the model is the Simulink (registered trademark) model of Mathworks (registered trademark).
図3に、モデルの一例を図示する。図2中の図形31〜42がブロックを表し、これらブロック間を繋ぐ矢印線が結線を表す。 FIG. 3 illustrates an example of the model. The figures 31 to 42 in FIG. 2 represent blocks, and the arrow lines connecting these blocks represent the connections.
入力ブロック31、32は、外部からのデータの入力を受け、その受けたデータを結線の後段(矢印側)に出力する機能を表す。定数ブロック33〜36は、時間的に変化しない定数を結線の後段に出力する機能を表す。定数の具体的な値は、定数ブロック毎に開発者が設定することができる。2項加算ブロック37は、2つの結線を介して受けたデータを加算して結線の後段に出力する機能を表す。遅延ブロック38は、結線を介して受けたデータを所定時間分遅延させて結線の後段に出力する機能を表す。
The input blocks 31 and 32 represent a function of receiving external data input and outputting the received data to the subsequent stage of connection (arrow side). The constant blocks 33 to 36 represent functions for outputting constants that do not change with time to the subsequent stage of the connection. The specific value of the constant can be set by the developer for each constant block. The
スイッチブロック39、40は、結線を介して受けた条件入力のデータの値が1であるかそれ以外であるかに応じて、他の2つの結線を介して受けた2つの選択入力データのうちいずれかを結線の後段に出力する機能を表す。図3中においては、スイッチブロック39、40への入力の結線のうち、中段の結線が条件入力を示し、上段および下段の結線が選択入力を示している。 The switch blocks 39 and 40, depending on whether the value of the condition input data received through the connection is 1 or other than that, of the two selection input data received through the other two connections This represents the function to output either of them after the connection. In FIG. 3, among the input connections to the switch blocks 39 and 40, the middle connection indicates the condition input, and the upper and lower connections indicate the selection input.
比較ブロック41は、結線を介して受けた2つの入力データを比較し、第1の入力データが第2のデータよりも大きければ値が1のデータを、そうでなければ値がゼロのデータを、結線の後段に出力する機能を表す。
The
出力ブロック42は、結線を介して受けたデータを外部に出力する機能を有する。
The
このようなブロック31〜42および結線の組み合わせから成る図3のモデルにおいては、入力ブロック31へ外部から入力されたデータの値が1以外であり続ける限り、スイッチブロック39からは、遅延ブロック38による遅延時間毎に1だけ増える値が出力され、その出力が1000未満ならば、定数ブロック350の出力である760の値が外部に出力され、1000以上ならば、入力ブロック32へ外部から入力された値が外部に出力される。また、入力ブロック31へ外部から入力されたデータの値が1の場合、スイッチブロック39の出力はゼロにリセットされる。
In the model of FIG. 3 composed of such a combination of
このように、モデルは、複数のブロックが結線によって繋ぎ合わされることで構成され、その繋ぎ合わせの構造によって、外部とのデータ入出力を表現するようになっている。 In this manner, the model is configured by connecting a plurality of blocks by connection, and expresses data input / output with the outside by the connection structure.
なお、本実施形態においては、モデルは、各ブロックへの入力データの許容最大値、許容最小値、および精度の情報を所定の形式で埋め込むことができるようになっている。例えば、上記のモデルエディタによって、入力装置12を用いて各ブロックの付加情報を入力することができるようになっていてもよい。この場合、所定の形式とは、付加情報中の所定の項目として記憶されることをいう。なお、この情報は、自動コード生成プログラム110によって生成されるCソースコードの表す処理内容には反映されない。
In the present embodiment, the model can embed information on the maximum allowable value, minimum allowable value, and accuracy of input data to each block in a predetermined format. For example, the additional information of each block may be input using the
図4に、自動コード生成プログラム110が図3に示したモデルに基づいて生成したCソースコードを示す。このCソースコードにおいては、入力ブロック31、32がそれぞれ変数In1、In2として表現され、出力ブロック42が変数Outとして表現され、スイッチブロック39の機能がifブロック45によって表現され、スイッチブロック40、比較ブロック41、出力ブロック42の機能がifブロック46によって表現されている。
FIG. 4 shows C source code generated by the automatic
モデル情報抽出プログラム120は、自動コード生成プログラム110によって生成されたCソースコードの元となるモデル210をHDD15から読み出し、その読み出したモデルの各ブロックに埋め込まれた入力データの許容最大値、許容最小値、および精度の情報を読み出し、その読み出したデータを自動テストケース生成プログラム130に渡す。
The model
なお、本実施形態において、あるプログラムが他のプログラムにデータを渡すとは、渡し元のプログラムがHDD15またはRAM13中に、渡し先のプログラムが読み出すことになっている所定の形式(格納領域、ファイル名)で、当該データを記憶させることをいう。
In the present embodiment, when a program transfers data to another program, the transfer source program reads the predetermined program (storage area, file, etc.) that the transfer destination program reads into the
自動テストケース生成プログラム130は、モデルシミュレーション状況解析プログラム160およびモデル情報抽出プログラム120から渡されたデータ、および自動コード生成プログラム110によって生成されたCソースコードに基づいて、テストケース230を生成し、HDD15に記憶させる。テストケースとは、モデル、および自動コード生成プログラム110によって当該モデルから生成されたCソースコードの品質を検査するための処理(例えばカバレッジテスト)の実行において、その品質検査が十分となるよう、当該モデルやソースコードに入力するテスト用データである。品質検査が十分となるようなテストケースとは、例えば、できる限りそのモデルの全てのブロックまたはCソースコードの全ての命令文が実行されるようなバラエティを持った入力データである。なお、品質検査は、生成されたCソースコード全体について行う場合と、そのCソースコードに含まれる関数等の所定の実行単位部分毎に独立に行われる場合がある。ここでいう入力データとは、品質検査が行われる対象の部分に入力されるデータをいう。この自動テストケース生成プログラム130の処理の詳細については後述する。なお、モデルの一部も、ブロックと結線の組み合わせとなっているので、モデルであるということができる
Cソースコード実行プログラム140は、自動コード生成プログラム110によって生成されたCソースコードの実行単位に記載された処理内容を実行する。この実行の目的の1つは、上記の品質検査である。そして、その実行の際、入力データは自動テストケース生成プログラム130によって生成されたテストケース230を用いる。そしてCソースコード実行プログラム140は、実行したCソースコードの実行単位による出力データ、および実行した命令文の時系列的なリストを、実行結果データ240として、HDD15に記憶させる。
The automatic test
モデルシミュレーションプログラム150は、自動コード生成プログラム110によって生成されたCソースコードの元となるモデル210をHDD15から読み出し、そのモデルのシミュレーションを実行する。シミュレーションとは、そのモデルの表現するデータの入出力の時間変化をパーソナルコンピュータ1上で再現する処理をいう。なお、モデルのシミュレーションにおいても、モデル全体ではなく、その実行単位毎にシミュレーションを行ってもよい。
The
なお、Cソースコード実行プログラム140で実行するソースコードの実行単位は、モデルシミュレーションプログラム150で実行するモデルの実行単位部分から生成されるソースコードである。すなわち、Cソースコード実行プログラム140で実行されるCソースコードの実行単位と、モデルシミュレーションプログラム150で実行されるモデルの実行単位とは対応している。
The source code execution unit executed by the C source
このシミュレーションにおいて、外部からのデータの入力としては、自動テストケース生成プログラム130によって生成されたテストケース230用いる。そしてモデルシミュレーションプログラム150は、そのモデルのシミュレーションによる外部への出力データ、ならびに各ブロック毎の実行時間および入出力データを、実行結果データ240として、HDD15に記憶させ、さらにモデルシミュレーション状況解析プログラム160に渡す。なお、スイッチブロック等については、選択入力のうちどちらを出力したかの情報も実行結果データ240に含める。
In this simulation, the
モデルシミュレーション状況解析プログラム160は、モデルシミュレーションプログラム150から渡された実行結果データを解析し、自動コード生成プログラム110によって生成されたCソースコードの妥当性、すなわちモデルベース開発プログラム100の処理の妥当性を判断し、さらに、テストケース生成用データを生成し、それを自動テストケース生成プログラム130に渡す。このモデルシミュレーション状況解析プログラム160の処理の詳細については後述する。
The model simulation
実行結果比較プログラム170は、Cソースコード実行プログラム140およびモデルシミュレーションプログラム150によってHDD15に記憶された実行結果データ240を読み出し、その実行結果を比較し、その比較結果を結果表示プログラム180に渡す。なお、比較とは、モデルシミュレーションプログラム150がシミュレーションを行ったモデルと、自動コード生成プログラム110がそのモデルに基づいて生成したCソースコードの、それぞれの実行結果のデータの比較をいう。比較項目としては、同じ入力データに対してそれぞれのモデル、Cソースコードが出力したデータがある。そして実行結果比較プログラム170は、比較の結果、それぞれが合致しているか否かの合否判定を行い、その合否判定の情報も結果表示プログラム180に渡す。
The execution
結果表示プログラム180は、実行結果比較プログラム170およびモデルシミュレーション状況解析プログラム160から渡されたデータをディスプレイ11に出力する。
The
次に、上述のモデルシミュレーション状況解析プログラム160の具体的な処理について説明する。図5に、このモデルシミュレーション状況解析プログラム160のフローチャートを示す。モデルシミュレーション状況解析プログラム160は、まずステップ605で、モデルシミュレーションプログラム150によって渡された実行結果データを読み出す。
Next, specific processing of the above-described model simulation
続いてステップ610で、この実行結果のデータに基づいて、当該モデルのうち、実行されなかった部分を抽出する。実行されなかった部分とは、実行時間がゼロのブロック、および、スイッチブロックにおいて全く出力されなかった選択入力の部分をいう。
Subsequently, in
続いてステップ620で、ステップ610で抽出した、スイッチブロックにおいて全く出力されなかった選択入力の部分のうち、その部分を有するスイッチブロックの条件入力データが定数となっているものを、抽出した部分のグループから除外する。なお、当該部分を有するスイッチブロックの条件入力に結線を介して出力しているものが定数ブロックの場合にのみ、当該部分を除外するようになっていてもよい。
Subsequently, in
このように、実行されなかった部分を抽出し、さらにそのうち、条件入力データが定数となっているスイッチブロックに含まれる部分を除外することで、結果として、ソースコードの生成が妥当でないと推定される部分が抽出される。 In this way, the part that was not executed is extracted, and the part included in the switch block whose condition input data is a constant is excluded. As a result, it is estimated that the source code generation is not valid. Are extracted.
これは、自動テストケース生成プログラム130によって生成されたテストケースは、当該Cソースコードの全ての分岐をできる限り実行するようなバリエーションを有しているはずであり、そのようなテストケースをモデルに入力したにもかかわらず、実行されなかった部分があるということは、自動コード生成プログラム110の当該モデル部分の処理に妥当でない部分があった可能性が高いという推定に基づくものである。なお、条件入力データが定数となっている部分について除外するのは、元々モデル中のスイッチブロックへの条件入力データが定数ならば、自動コード生成プログラム110の処理が妥当であっても、入力するテストケースの値に関わらずそのスイッチブロックの一方の選択入力は出力されないからである。
This is because the test case generated by the automatic test
続いてステップ630で、ステップ610、620の処理により抽出された、Cソースコードの生成が妥当でないと推定される部分が1つでもあるか否かを判定し、あれば、Cソースコードの生成が妥当でない旨の表示用のデータを結果表示プログラム180に渡す。
Subsequently, in
続いてステップ640で、ステップ605で読み出した実行結果データのうち、各ブロックの入出力データの情報を、シミュレーション状況解析結果として、自動テストケース生成プログラム130に渡す。
Subsequently, in
ステップ640の後、モデルシミュレーション状況解析プログラム160の処理は終了する。
After
続いて、自動テストケース生成プログラム130の処理の詳細について説明する。自動テストケース生成プログラム130は、まずステップ405で、今回テストケースを生成する対象となる実行単位部分のCソースコード220をHDD15から読み出す。
Next, details of the process of the automatic test
続いてステップ410で、読み出したCソースコードの解析を行う。具体的には、Cソースコードに外部から(関数の引数等によって)入力することができる入力データの数、型等を特定し、また、Cソースコード中、どのような変数の条件でif文等の分岐が行われ、その条件の変数は、入力データによってどのように変化するか等の特定を行う。
In
続いてステップ420では、モデル情報抽出プログラム120によって渡されたモデル情報、すなわち、当該Cソースコードに相当するモデル実行単位への入力データの許容最大値、許容最小値、および精度の情報を読み出す。
Subsequently, in step 420, the model information passed by the model
続いてステップ430では、モデル実行状況解析結果を取得する。具体的には、モデルシミュレーション状況解析プログラム160のステップ640によって渡された各ブロックの入出力データの情報を読み出す。
In
続いてステップ440では、ステップ410の解析結果に加え、これらモデル情報およびモデル実行状況解析結果に基づいて、テストケースを生成する。具体的には、まず、ステップ410の解析結果のみに基づいて、Cソースコード中の条件分岐先ができるだけ多く実行されるような入力データの値の群を特定する。
Subsequently, in
そして、次に、ステップ420で取得したモデル情報に基づいて、上記特定した入力データの値の群が、当該入力データについてのモデル情報中の許容最大値より大きいものを有している場合、その許容最大値より大きい値を、許容最大値より小さい値に変更する。また、上記特定した入力データ群の値が、当該入力データについてのモデル情報中の許容最小値より小さいものを有している場合、その許容最小値より小さい値を、許容最小値より大きい値に変更する。ただし、上記の変更を行う際には、この変更によって実行されなくなる条件分岐先が最も少なくなるように変更する。 Then, based on the model information acquired in step 420, if the group of values of the identified input data has a value larger than the allowable maximum value in the model information for the input data, Change the value greater than the maximum allowable value to a value smaller than the maximum allowable value. Further, when the value of the specified input data group has a value smaller than the allowable minimum value in the model information for the input data, a value smaller than the allowable minimum value is set to a value larger than the allowable minimum value. change. However, when the above change is made, the change is made so that the number of conditional branch destinations that are not executed by this change is minimized.
また、ある入力について、分岐先が切り替わる境目となる値が判っている場合、その境界値から、モデル情報中の精度と同じ値だけ上下に変化させた値を入力データに加える。例えば、ある入力データの値が0.5を超えると、Cソースコード中のある条件分岐において一方の分岐先が実行され、その値が0.5以下だと、他方の分岐先が実行されるような場合において、その入力データについての精度情報が0.1の値を有していれば、その入力データのテストケースとして、0.49および0.51を含めるようにする。 In addition, when a value that becomes a boundary at which a branch destination is switched is known for a certain input, a value obtained by changing the boundary value up and down by the same value as the accuracy in the model information is added to the input data. For example, if the value of some input data exceeds 0.5, one branch destination is executed in a certain conditional branch in the C source code, and if the value is 0.5 or less, the other branch destination is executed. In such a case, if the accuracy information about the input data has a value of 0.1, 0.49 and 0.51 are included as test cases for the input data.
また更に、モデル情報中に許容最大値または許容最小値の情報が含まれていない入力データについては、モデル実行状況解析結果を用いて、入力データの値の変更を行う。具体的には、ステップ430で取得した、各ブロックへの入力データのうち、当該Cソースコードに相当するモデル実行単位への入力データを特定し、その入力データの上限値および下限値を特定する。なお、モデル実行状況解析結果をテストケース生成に用いるか否かは、ユーザによる設定またはCPU16で実行される他のプログラムの設定によって、切り替え可能となっている。
Furthermore, for input data that does not include information on the allowable maximum value or the allowable minimum value in the model information, the value of the input data is changed using the model execution situation analysis result. Specifically, among the input data to each block acquired in
そして、Cソースコードの解析結果に基づいて特定した入力データの値の群が、この特定した最大値より大きいものを有している場合、その最大値より大きい値を、その最大値より小さい値に変更する。また、Cソースコードの解析結果に基づいて特定した入力データ群の値が、この特定した最小値より小さいものを有している場合、その最小値より小さい値を、その最小値より大きい値に変更する。ただし、この変更を行う際には、この変更によって実行されなくなる条件分岐先が最も少なくなるように変更する。 When the group of input data values specified based on the analysis result of the C source code has a value larger than the specified maximum value, a value greater than the maximum value is set to a value smaller than the maximum value. Change to Further, when the value of the input data group specified based on the analysis result of the C source code has a value smaller than the specified minimum value, a value smaller than the minimum value is set to a value larger than the minimum value. change. However, when this change is made, the change is made so that the number of conditional branch destinations that are not executed by this change is minimized.
続いてステップ450では、この生成したテストケース230をHDD15に記憶させる。ステップ450の後、自動テストケース生成プログラム130の処理は終了する。
In
次に、図7に、結果表示プログラム180がディスプレイ11に行わせる結果表示の一例を示す。
Next, FIG. 7 shows an example of result display that the
この表示は、比較結果表示部51および妥当性診断部52から成る。比較結果表示部51は、実行結果比較プログラム170から渡された表示用のデータを表形式で表したものである。各行は、モデルおよびCソースコードへの入力値(In1,In2)、モデルの出力値、Cソースコードの出力値、これら2つの出力値の差、およびそれぞれが合致しているか否かの合否判定の項目を、この順に含んでいる。
This display includes a comparison
妥当性診断部52は、モデルシミュレーション状況解析プログラム160から渡された表示用のデータを表したものであり、それがCソースコードの生成処理が妥当である旨のデータであれば、図7のように“OK”の表示が為され、Cソースコードの生成処理が非妥当である旨のデータであれば、“NG”の表示が為される。
The
以上のようなモデルベース開発プログラム100のプログラム群の使用手順は以下説明する。なお、以下の手順によるプログラム群の実行は、ユーザが入力装置12を用いて手動で行ってもよいし、その手順によるプログラム群の実行を実現するようあらかじめHDD15に記憶されたプログラムをCPU16が実行するようになっていてもよい。使用手順は、以下の手順(1)〜手順(12)の通りである。
手順(1):自動コード生成プログラム110に、モデル210からCソースコード220を生成させる。
手順(2):モデル情報抽出プログラム120に、そのモデル210のモデル情報を抽出させる。
手順(3):自動テストケース生成プログラム130に、Cソースコード220およびモデル情報抽出プログラム120の出力に基づき、Cソースコード220全体に対するテストケース230を生成させる。このとき、モデルシミュレーション状況解析プログラム160の結果は用いないように設定する。
手順(4):モデルシミュレーションプログラム150に、このモデル210全体のシミュレーションを行わせる。
手順(5):モデルシミュレーション状況解析プログラム160に、モデル210のシミュレーション結果を対象とするシミュレーション状況解析(ステップ605〜640に相当する)を行わせ、モデル210の各ブロックにおける入出力データ情報をHDD15に記憶させる。
手順(6):自動テストケース生成プログラム130に、Cソースコード220、モデル情報抽出プログラム120の出力、モデルシミュレーション状況解析プログラム160の出力に基づいて、Cソースコード220中の一実行単位(例えば1つの関数)に対するテストケース230’を生成させる。
手順(7):Cソースコード実行プログラム140に、直前の手順(6)によって生成されたテストケース230’を入力として、上記のCソースコード220の一実行単位を実行させる。
手順(8):モデルシミュレーションプログラム150に、この一実行単位に対応するモデル210中の一実行単位のシミュレーションを行わせる。
手順(9):モデルシミュレーション状況解析プログラム160に、モデル210の上記一実行単位のシミュレーション結果を対象とするシミュレーション状況解析を行わせ、モデル210の上記一実行単位中の各ブロックにおける入出力データ情報をHDD15に記憶させる。
手順(10):モデルシミュレーション状況解析プログラム160に、モデル210の上記一実行単位のシミュレーション結果を対象とするシミュレーション状況解析を行わせ、モデル210の上記一実行単位各ブロックにおける入出力データ情報をHDD15に記憶させる。
手順(11):実行結果比較プログラム170に、直前のCソースコード実行プログラム140とモデルシミュレーションプログラム150についての実行結果データ240の比較を行わせる。
手順(12):結果表示プログラム180に、直前のモデルシミュレーション状況解析プログラム160および実行結果比較プログラム170の実行によって渡されたデータの表示を行わせる。
The procedure for using the program group of the model
Procedure (1): The automatic
Procedure (2): The model
Procedure (3): The automatic test
Step (4): The
Step (5): The model simulation
Step (6): Based on the
Procedure (7): The C source
Step (8): The
Step (9): The model simulation
Step (10): The model simulation
Procedure (11): The execution
Procedure (12): The
なお、上記の手順(6)〜手順(9)は、必要に応じて複数回繰り返してもよい。複数回としては、例えば予め決められた定数(例えば5)に基づく値であってもよいし、直前の繰り返しと今回の繰り返しで生成されたテストケースを比較し、その違いが所定の基準以下となったときの階数であってもよい。 In addition, you may repeat said procedure (6)-procedure (9) in multiple times as needed. The number of times may be, for example, a value based on a predetermined constant (for example, 5), or the test cases generated in the previous iteration and the current iteration are compared, and the difference is less than a predetermined reference. It may be the number of stories at the time.
以上のように、モデルベース開発プログラム100のプログラム群をCPU16が実行することで、パーソナルコンピュータ1は、モデルに基づいて生成されたソースコードを読み出し(図6のステップ405参照)、また、そのモデルに含まれるそのモデルへの入力データの許容上限値、許容下限値、および精度の情報を読み出し(ステップ420参照)、また、モデルのシミュレーション状況解析結果を読み出し(ステップ430参照)、読み出したソースコードの処理内容、入力データの情報、およびシミュレーション状況解析結果に基づいて、そのソースコードのテストケースを生成する(ステップ440参照)。
As described above, the
このようになっていることで、テストケースは、ソースコードの内容に加え、そのソースコードの元となったモデル中に含まれる、そのモデルへの入力データの情報、および、そのソースコードの元となったモデルのシミュレーション状況解析結果に基づいて生成されるので、よりモデル開発者の意図を反映したものとなっている。 In this way, in addition to the contents of the source code, the test case includes the information of the input data to the model included in the model that is the source code source, and the source code source. Since it is generated based on the simulation result analysis result of the model that has become, it more reflects the intention of the model developer.
なお、上記実施形態では、ソースコードの内容に加え、モデルへの入力データの情報に基づきテストケースを生成しているが、入力データの情報に限るものでなく、図3の各ブロックに含まれる情報や、ブロック同士を繋ぐ結線の情報等に基づきテストケースを生成することも考えられる。 In the above embodiment, the test case is generated based on the input data information to the model in addition to the contents of the source code. However, the test case is not limited to the input data information and is included in each block of FIG. It is also conceivable to generate a test case based on information, information on connections connecting blocks, and the like.
また、対象となるモデルが、前段にあるモデルの処理結果の出力を入力として受けるようになっている場合は、シミュレーション状況解析結果として、その前段のモデルの当該出力データの情報を読み出し、その出力データの情報に基づいて、ソースコードのテストケースを生成するようになっている。 In addition, when the target model receives the output of the processing result of the model in the previous stage as an input, the information of the output data of the previous model is read as the simulation status analysis result, and the output Based on the data information, a source code test case is generated.
また、パーソナルコンピュータ1は、自動テストケース生成プログラム130によって生成されたテストケースをモデルへの入力として行われたシミュレーションの結果を読み出し(図5のステップ605参照)、その読み出した結果に基づいて、そのソースコード生成の妥当、非妥当の表示用の情報を記憶媒体に記憶させることで、結果表示プログラム180に渡すようになっている。
Further, the
なお、上記の実施形態においては、モデルシミュレーション状況解析プログラム160は、妥当、非妥当の情報を結果表示プログラム180に出力するようになっているが、必ずしもこのようになっていなくともよい。例えば、モデルシミュレーション状況解析プログラム160をCPU16が実行することで、パーソナルコンピュータ1は、読み出されたモデルのシミュレーションの結果に基づいて、そのモデル中の、自動コード生成プログラム110の処理が妥当でないと推定される部分を抽出し、その抽出した部分の表示用の情報を記憶媒体に記憶させるようになっていてもよい。これは、例えばステップ630で、ステップ610およびステップ620で抽出された部分を表す表示用のデータを結果表示プログラム180に渡すようになっていれば実現される。
In the above-described embodiment, the model simulation
なお、上記の実施形態において、パーソナルコンピュータ1が、テストケース生成装置、コード生成妥当性診断装置に相当する。
In the above embodiment, the
また、自動テストケース生成プログラム130が、テストケース生成プログラムに相当する。
The automatic test
また、モデルシミュレーション状況解析プログラム160が、コード生成妥当性診断プログラムに相当する。
The model simulation
また、CPU16が、自動テストケース生成プログラム130のステップ405を実行することで、ソースコード読出手段として機能する。
The
また、CPU16が、自動テストケース生成プログラム130のステップ420を実行することで、モデル情報読出手段として機能する。
The
また、CPU16が、自動テストケース生成プログラム130のステップ430を実行することで、シミュレーション情報読出手段として機能する。
Further, the
また、CPU16が、自動テストケース生成プログラム130のステップ410および440を実行することで、生成手段として機能する。
Further, the
また、CPU16が、モデルシミュレーション状況解析プログラム160のステップ605を実行することで、モデルシミュレーション結果読出手段として機能する。
Further, the
また、CPU16が、モデルシミュレーション状況解析プログラム160のステップ610、620、および630を実行することで、記憶制御手段として機能する。
The
1…パーソナルコンピュータ、11…ディスプレイ、12…入力装置、13…RAM、
14…ROM、15…HDD、16…CPU、31、32…入力ブロック、
33〜36…定数ブロック、37…2項加算ブロック、38…遅延ブロック、
39、40…スイッチブロック、41…比較ブロック、42…出力ブロック、
45、46…ifブロック、51…比較結果表示部、52…妥当性診断部、
100…モデルベース開発プログラム、110…自動コード生成プログラム、
120…モデル情報抽出プログラム、130…自動テストケース生成プログラム、
140…Cソースコード実行プログラム、
150…モデルシミュレーションプログラム、
160…モデルシミュレーション状況解析プログラム、
170…実行結果比較プログラム、180…結果表示プログラム、
210…モデル、220…Cソースコード、230…テストケース、
240…実行結果データ。
DESCRIPTION OF
14 ... ROM, 15 ... HDD, 16 ... CPU, 31, 32 ... input block,
33 to 36 ... constant block, 37 ... binary add block, 38 ... delay block,
39, 40 ... switch block, 41 ... comparison block, 42 ... output block,
45, 46 ... if block, 51 ... comparison result display part, 52 ... validity diagnosis part,
100: Model-based development program, 110: Automatic code generation program,
120 ... Model information extraction program, 130 ... Automatic test case generation program,
140 ... C source code execution program,
150 ... Model simulation program,
160 ... Model simulation situation analysis program,
170 ... execution result comparison program, 180 ... result display program,
210 ... Model, 220 ... C source code, 230 ... Test case,
240: Execution result data.
Claims (16)
前記モデル内の情報を読み出すモデル情報読出手段と、
読み出された前記ソースコードの処理内容および読み出された前記モデル内の情報に基づいて、前記ソースコードのテストケースを生成する生成手段と、を備えたテストケース生成装置。 Source code reading means for reading a source code generated based on a model describing a processing operation of control;
Model information reading means for reading information in the model;
A test case generation device comprising: generation means for generating a test case of the source code based on the processing content of the read source code and the read information in the model.
前記生成手段は、読み出された前記許容上限値および前記許容下限値のうち少なくとも1つに基づいて、前記ソースコードのテストケースを生成することを特徴とする請求項1に記載のテストケース生成装置。 The model information reading means reads at least one of an allowable upper limit value and an allowable lower limit value of input data to the model,
2. The test case generation according to claim 1, wherein the generation unit generates a test case of the source code based on at least one of the read allowable upper limit value and the allowable lower limit value. apparatus.
前記生成手段は、読み出された前記精度情報に基づいて、前記ソースコードのテストケースを生成することを特徴とする請求項1または2に記載のテストケース生成装置。 The model information reading means reads accuracy information of input data to the model included in the model,
The test case generation apparatus according to claim 1, wherein the generation unit generates a test case of the source code based on the read accuracy information.
前記モデル内の情報を読み出すモデル情報読出手段、および
読み出された前記ソースコードの処理内容および読み出された前記モデル内の情報に基づいて、前記ソースコードのテストケースを生成する生成手段として、演算装置を機能させるテストケース生成プログラム。 A source code reading means for reading a source code generated based on a model describing a process for input data;
Model information reading means for reading information in the model, and generating means for generating a test case of the source code based on the processing content of the read source code and the read information in the model, A test case generation program that makes an arithmetic device function.
生成された前記ソースコードを読み出すソースコード読出手段、
前記モデル内の情報を読み出すモデル情報読出手段、および
読み出された前記ソースコードの処理内容および読み出された前記モデル内の情報に基づいて、前記ソースコードのテストケースを生成する生成手段として、演算装置を機能させるモデルベース開発プログラム。 A model-based development program for causing an arithmetic unit to realize a function of generating a source code based on a model describing a processing operation of control,
Source code reading means for reading the generated source code;
Model information reading means for reading information in the model, and generating means for generating a test case of the source code based on the processing content of the read source code and the read information in the model, A model-based development program that makes computing devices function.
前記モデルのシミュレーション状況解析結果を読み出すシミュレーション情報読出手段と、
読み出された前記ソースコードの処理内容および読み出された前記解析結果に基づいて、前記ソースコードのテストケースを生成する生成手段と、を備えたテストケース生成装置。 Source code reading means for reading a source code generated based on a model describing a processing operation of control;
Simulation information reading means for reading the simulation status analysis result of the model;
A test case generation apparatus comprising: generation means for generating a test case of the source code based on the processing content of the read source code and the read analysis result.
前記シミュレーション情報読出手段は、前記シミュレーション状況解析結果として、前記前段にあるモデルの前記出力データの情報を読み出し、
前記生成手段は、読み出された前記出力データの情報に基づいて、前記ソースコードのテストケースを生成することを特徴とする請求項6に記載のテストケース生成装置。 The model receives the output data of the processing result of the model in the previous stage as input data,
The simulation information reading means reads information on the output data of the model in the preceding stage as the simulation situation analysis result,
The test case generation apparatus according to claim 6, wherein the generation unit generates a test case of the source code based on the read information of the output data.
前記生成手段は、読み出された前記上限値および前記下限値のうち少なくとも1つに基づいて、前記ソースコードのテストケースを生成することを特徴とする請求項7に記載のテストケース生成装置。 The simulation information reading means reads at least one of an upper limit value and a lower limit value of the output data of the model in the preceding stage,
The test case generation device according to claim 7, wherein the generation unit generates a test case of the source code based on at least one of the read upper limit value and lower limit value.
前記モデルのシミュレーション状況解析結果を読み出すシミュレーション情報読出手段、および
読み出された前記ソースコードの処理内容および読み出された前記解析結果に基づいて、前記ソースコードのテストケースを生成する生成手段として、演算装置を機能させるテストケース生成プログラム。 Source code reading means for reading a source code generated based on a model describing a processing operation of control;
Simulation information reading means for reading the simulation status analysis result of the model, and generating means for generating a test case of the source code based on the processing content of the read source code and the read analysis result, A test case generation program that makes an arithmetic device function.
前記モデルに基づいて生成されたソースコードを読み出すソースコード読出手段、
前記モデルのシミュレーション状況解析結果を読み出すシミュレーション情報読出手段、および
読み出された前記ソースコードの処理内容および読み出された前記解析結果に基づいて、前記ソースコードのテストケースを生成する生成手段として、演算装置を機能させるモデルベース開発プログラム。 A model-based development program for causing an arithmetic unit to realize a function of generating a source code based on a model describing a control processing operation,
Source code reading means for reading source code generated based on the model;
Simulation information reading means for reading the simulation status analysis result of the model, and generating means for generating a test case of the source code based on the processing content of the read source code and the read analysis result, A model-based development program that makes computing devices function.
読み出された前記シミュレーションの結果に基ついて、前記ソースコード生成の妥当性についての表示用の情報を記憶媒体に記憶させる記憶制御手段と、を備えたソースコード生成妥当性診断装置。 A model simulation result reading means for reading a simulation result of the model performed by inputting a test case generated based on the content of the source code generated from the model describing the processing operation of the control to the model; ,
A source code generation validity diagnosis apparatus comprising: storage control means for storing display information about the validity of the source code generation in a storage medium based on the read simulation result.
前記記憶制御手段は、この実行されなかったモデルの部分の情報に基づいて、前記ソースコード生成の妥当性についての表示用の情報を記憶媒体に記憶させることを特徴とする請求項11に記載のソースコード生成妥当性診断装置。 The model simulation result reading means reads information on a part of the model that was not executed by the simulation as a result of the simulation of the model performed by the test case being input to the model,
12. The storage control unit according to claim 11, wherein display information about the validity of the source code generation is stored in a storage medium based on information on the part of the model that has not been executed. Source code generation validity diagnosis device.
読み出された前記シミュレーションの結果に基ついて、前記ソースコード生成の妥当性についての表示用の情報を記憶媒体に記憶させる記憶制御手段として演算装置を機能させるソースコード生成妥当性診断プログラム。 A model simulation result reading means for reading a simulation result of the model performed by inputting a test case generated based on the content of the source code generated from the model describing the processing operation of the control to the model; And a source code generation validity diagnostic program for causing an arithmetic unit to function as storage control means for storing display information about the validity of the source code generation in a storage medium based on the read result of the simulation.
制御の処理動作を記述するモデルから生成されたソースコードの内容に基づいて生成されたテストケースが前記モデルへ入力されることで行われた前記モデルのシミュレーションの結果を読み出すモデルシミュレーション結果読出手段、および
読み出された前記シミュレーションの結果に基ついて、前記ソースコード生成の妥当性についての表示用の情報を記憶媒体に記憶させる記憶制御手段として演算装置を機能させるモデルベース開発プログラム。 A model-based development program for causing an arithmetic unit to realize a function of generating a source code based on a model describing a control processing operation,
A model simulation result reading means for reading a simulation result of the model performed by inputting a test case generated based on the content of the source code generated from the model describing the processing operation of the control to the model; And a model-based development program for causing an arithmetic unit to function as storage control means for storing display information about the validity of the source code generation in a storage medium based on the read simulation result.
生成された前記ソースコードを読み出す手順と、
前記モデル内の情報を読み出す手順と、
読み出された前記ソースコードの処理内容および読み出された前記モデル内の情報に基づいて、前記ソースコードのテストケースを生成する手順と、
生成された前記テストケースを入力として、前記モデルのシミュレーションを行う手順と、を備えたモデルベース開発方法。 A procedure for generating source code based on a model that describes the processing operation of control,
A procedure for reading the generated source code;
A procedure for reading information in the model;
A procedure for generating a test case of the source code based on the processing content of the read source code and the information in the read model;
A model-based development method comprising: a procedure for simulating the model using the generated test case as an input.
前記モデルのシミュレーションを行う手順と、
前記モデルのシミュレーション状況の解析を行う手順と、
生成された前記ソースコードを読み出す手順と、
前記モデルのシミュレーション状況解析結果を読み出す手順と、
読み出された前記ソースコードの処理内容および読み出された前記解析結果に基づいて、前記ソースコードのテストケースを生成する手順と、を備えたモデルベース開発方法。
A procedure for generating source code based on a model that describes the processing operation of control,
A procedure for simulating the model;
A procedure for analyzing the simulation status of the model;
A procedure for reading the generated source code;
A procedure for reading the simulation status analysis result of the model,
A model-based development method comprising: a procedure for generating a test case of the source code based on the processing content of the read source code and the read analysis result.
Priority Applications (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004201861A JP2006024006A (en) | 2004-07-08 | 2004-07-08 | Test case generation device, test case generation program, model base development program, device and program for diagnosing validity of source code generation, and method for developing model base |
US11/156,734 US20060010429A1 (en) | 2004-07-08 | 2005-06-21 | Method, system and program for model based software development with test case generation and evaluation |
DE102005031913A DE102005031913A1 (en) | 2004-07-08 | 2005-07-07 | Method, system and program for model-based software development with test case generation and evaluation |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004201861A JP2006024006A (en) | 2004-07-08 | 2004-07-08 | Test case generation device, test case generation program, model base development program, device and program for diagnosing validity of source code generation, and method for developing model base |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2006024006A true JP2006024006A (en) | 2006-01-26 |
Family
ID=35542779
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2004201861A Pending JP2006024006A (en) | 2004-07-08 | 2004-07-08 | Test case generation device, test case generation program, model base development program, device and program for diagnosing validity of source code generation, and method for developing model base |
Country Status (3)
Country | Link |
---|---|
US (1) | US20060010429A1 (en) |
JP (1) | JP2006024006A (en) |
DE (1) | DE102005031913A1 (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008077415A (en) * | 2006-09-21 | 2008-04-03 | Toshiba Information Systems (Japan) Corp | Model base development assisting block, simulation system and automatic code generation method |
JP2008299502A (en) * | 2007-05-30 | 2008-12-11 | Denso Corp | Test case validity automatic verification program and test case validity automatic verification result display method |
JP2009282970A (en) * | 2008-05-14 | 2009-12-03 | Honeywell Internatl Inc | Method, device and system for automatic inspection generation from state chart |
JP2010511250A (en) * | 2006-11-27 | 2010-04-08 | ハネウェル・インターナショナル・インコーポレーテッド | Request-based test generation |
US8448146B2 (en) | 2011-03-31 | 2013-05-21 | Infosys Limited | Generation of functional tests for re-hosted applications |
JP2014038397A (en) * | 2012-08-10 | 2014-02-27 | Fuji Electric Co Ltd | Diagram program test data generation device, method therefor, and program |
JP2014059805A (en) * | 2012-09-19 | 2014-04-03 | Denso Corp | Test case generation device and test case generation method for model-based control device |
JP2021068285A (en) * | 2019-10-25 | 2021-04-30 | 株式会社デンソー | Automatic code generation method, coding program, electronic control device, automatic code generation program, and automatic code generation device |
JP2021117666A (en) * | 2020-01-24 | 2021-08-10 | 株式会社デンソー | Code inspection tool and code inspection method |
Families Citing this family (38)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7739256B2 (en) * | 2006-12-07 | 2010-06-15 | Norman Powell | Method for selling custom business software and software exchange marketplace |
JP2008171034A (en) * | 2007-01-05 | 2008-07-24 | Hitachi Ltd | Program creation support device, program creation support program and program creation support method |
WO2008113718A1 (en) * | 2007-03-16 | 2008-09-25 | International Business Machines Corporation | Method, system and computer program for distributing customized software products |
US7681180B2 (en) | 2007-06-06 | 2010-03-16 | Microsoft Corporation | Parameterized test driven development |
US8271934B2 (en) * | 2007-06-14 | 2012-09-18 | International Business Machines Corporation | Developing software applications with increased modularity |
US7873945B2 (en) * | 2007-06-29 | 2011-01-18 | Microsoft Corporation | Automatically generating test cases for binary code |
JP2009169828A (en) * | 2008-01-18 | 2009-07-30 | Denso Corp | Test case creation device and creation program |
US8522215B1 (en) | 2008-07-14 | 2013-08-27 | The Mathworks, Inc. | Coverage analysis for variable size signals |
US8463760B2 (en) * | 2008-09-04 | 2013-06-11 | At&T Intellectual Property I, L. P. | Software development test case management |
US8286140B2 (en) * | 2008-10-10 | 2012-10-09 | American Express Travel Related Services Company, Inc. | System, computer program, and method for a static code coverage analyzer for computer programs |
US20110083121A1 (en) * | 2009-10-02 | 2011-04-07 | Gm Global Technology Operations, Inc. | Method and System for Automatic Test-Case Generation for Distributed Embedded Systems |
US8826239B2 (en) * | 2010-10-06 | 2014-09-02 | International Business Machines Corporation | Asynchronous code testing in integrated development environment (IDE) |
CN102023922B (en) * | 2010-12-28 | 2012-09-26 | 重庆恩菲斯软件有限公司 | System and method for testing automotive electronic diagnostic software |
US8984488B2 (en) | 2011-01-14 | 2015-03-17 | Honeywell International Inc. | Type and range propagation through data-flow models |
US9632754B2 (en) | 2012-07-06 | 2017-04-25 | International Business Machines Corporation | Auto generation and linkage of source code to test cases |
WO2014080354A2 (en) * | 2012-11-21 | 2014-05-30 | Varun Aggarwal | Reporting scores on computer programming ability under a taxonomy of test cases |
CN103838559A (en) * | 2012-11-23 | 2014-06-04 | 富士通株式会社 | Method and device for combining tools |
US9513878B2 (en) * | 2012-12-21 | 2016-12-06 | Sap Se | Component integration by distribution of schema definition on heterogenous platforms |
CN104142914A (en) * | 2013-05-10 | 2014-11-12 | 富士通株式会社 | Device and method for function module combination with feedback control, data processing method and data processing equipment |
CN104281519A (en) * | 2013-07-08 | 2015-01-14 | 华为技术有限公司 | Method and equipment for detecting errors of program |
JP6316120B2 (en) * | 2014-06-30 | 2018-04-25 | 日立オートモティブシステムズ株式会社 | Test case generation system and recording medium recording test case |
US9483384B2 (en) * | 2014-11-20 | 2016-11-01 | Fujitsu Limited | Generation of software test code |
US10108536B2 (en) * | 2014-12-10 | 2018-10-23 | General Electric Company | Integrated automated test case generation for safety-critical software |
WO2016137035A1 (en) * | 2015-02-25 | 2016-09-01 | 슈어소프트테크주식회사 | Test case generation device and method, and computer-readable recording medium for recording program for executing same |
US9940222B2 (en) | 2015-11-20 | 2018-04-10 | General Electric Company | System and method for safety-critical software automated requirements-based test case generation |
US9792204B2 (en) | 2016-02-02 | 2017-10-17 | General Electric Company | System and method for coverage-based automated test case augmentation for design models |
US10025696B2 (en) | 2016-02-09 | 2018-07-17 | General Electric Company | System and method for equivalence class analysis-based automated requirements-based test case generation |
CN107608873B (en) * | 2016-07-11 | 2021-05-25 | 珠海优特电力科技股份有限公司 | Software testing method and system and testing platform |
JP7225064B2 (en) * | 2019-09-12 | 2023-02-20 | 株式会社日立ソリューションズ | Simulation method and simulation program |
EP3812885A1 (en) | 2019-10-24 | 2021-04-28 | dspace digital signal processing and control engineering GmbH | Integrated simulation code and production code generation |
CN110995547A (en) * | 2019-12-24 | 2020-04-10 | 国汽(北京)智能网联汽车研究院有限公司 | Vehicle-mounted high-speed network testing system and method |
US11379349B2 (en) * | 2020-01-03 | 2022-07-05 | International Business Machines Corporation | Verifiable testcase workflow |
US11288153B2 (en) | 2020-06-18 | 2022-03-29 | Bank Of America Corporation | Self-healing computing device |
US11132273B1 (en) | 2020-12-15 | 2021-09-28 | International Business Machines Corporation | System testing infrastructure with hidden variable, hidden attribute, and hidden value detection |
US11113167B1 (en) | 2020-12-15 | 2021-09-07 | International Business Machines Corporation | System testing infrastructure with hidden variable, hidden attribute, and hidden value detection |
US11188453B1 (en) | 2020-12-15 | 2021-11-30 | International Business Machines Corporation | Verification of software test quality using hidden variables |
US11204848B1 (en) | 2020-12-15 | 2021-12-21 | International Business Machines Corporation | System testing infrastructure with hidden variable, hidden attribute, and hidden value detection |
US11379352B1 (en) | 2020-12-15 | 2022-07-05 | International Business Machines Corporation | System testing infrastructure with hidden variable, hidden attribute, and hidden value detection |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2003054666A2 (en) * | 2001-12-19 | 2003-07-03 | Steven Sims | System and method for automated test-case generation for software |
JP2005078243A (en) * | 2003-08-29 | 2005-03-24 | Denso Corp | Microcomputer resource consumption estimating program, microcomputer resource consumption estimating device, and program generating method |
-
2004
- 2004-07-08 JP JP2004201861A patent/JP2006024006A/en active Pending
-
2005
- 2005-06-21 US US11/156,734 patent/US20060010429A1/en not_active Abandoned
- 2005-07-07 DE DE102005031913A patent/DE102005031913A1/en not_active Withdrawn
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008077415A (en) * | 2006-09-21 | 2008-04-03 | Toshiba Information Systems (Japan) Corp | Model base development assisting block, simulation system and automatic code generation method |
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 |
JP2008299502A (en) * | 2007-05-30 | 2008-12-11 | Denso Corp | Test case validity automatic verification program and test case validity automatic verification result display method |
JP2009282970A (en) * | 2008-05-14 | 2009-12-03 | Honeywell Internatl Inc | Method, device and system for automatic inspection generation from state chart |
US8448146B2 (en) | 2011-03-31 | 2013-05-21 | Infosys Limited | Generation of functional tests for re-hosted applications |
JP2014038397A (en) * | 2012-08-10 | 2014-02-27 | Fuji Electric Co Ltd | Diagram program test data generation device, method therefor, and program |
JP2014059805A (en) * | 2012-09-19 | 2014-04-03 | Denso Corp | Test case generation device and test case generation method for model-based control device |
JP2021068285A (en) * | 2019-10-25 | 2021-04-30 | 株式会社デンソー | Automatic code generation method, coding program, electronic control device, automatic code generation program, and automatic code generation device |
JP7318485B2 (en) | 2019-10-25 | 2023-08-01 | 株式会社デンソー | Automatic code generation method, code program, electronic controller, automatic code generation program, and automatic code generation device |
JP2021117666A (en) * | 2020-01-24 | 2021-08-10 | 株式会社デンソー | Code inspection tool and code inspection method |
JP7415593B2 (en) | 2020-01-24 | 2024-01-17 | 株式会社デンソー | Code inspection tools, code inspection methods |
Also Published As
Publication number | Publication date |
---|---|
DE102005031913A1 (en) | 2006-02-16 |
US20060010429A1 (en) | 2006-01-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2006024006A (en) | Test case generation device, test case generation program, model base development program, device and program for diagnosing validity of source code generation, and method for developing model base | |
US7895575B2 (en) | Apparatus and method for generating test driver | |
JP2006244073A (en) | Semiconductor design device | |
JP4427002B2 (en) | Program debugging device for semiconductor testing | |
JP2009169828A (en) | Test case creation device and creation program | |
JP2009294846A (en) | Test case generator, and test case generation program and method | |
KR20070058954A (en) | Apparatus and method for prototype development of embedded system | |
KR101110241B1 (en) | Program test device and program | |
JP2005078243A (en) | Microcomputer resource consumption estimating program, microcomputer resource consumption estimating device, and program generating method | |
CN108572892B (en) | PowerPC multi-core processor-based offline test method and device | |
WO2020194455A1 (en) | Test case generation device, test case generation method, and test case generation program | |
JP5811978B2 (en) | Test case generation apparatus and test case generation method for model-based control apparatus | |
JP4702194B2 (en) | Program development support apparatus, program development support method, and program development support program | |
JP2001060210A (en) | Lsi verification method and device and recording medium | |
JP2005301568A (en) | Display information storage controller, and program thereof | |
JP5755861B2 (en) | Test case generation apparatus, test case generation method, and test case generation program | |
JP6723483B2 (en) | Test case generation device, test case generation method, and test case generation program | |
JP2021117666A (en) | Code inspection tool and code inspection method | |
JP2008299502A (en) | Test case validity automatic verification program and test case validity automatic verification result display method | |
JP2020144509A (en) | Automatic code generation method and automatic code generating program | |
US20180088914A1 (en) | Method for supporting program creation and apparatus for supporting program creation | |
Zander-Nowicka et al. | From Functional Requirements through Test Evaluation Design to Automatic Test Data Patterns Retrieval-a Concept for Testing of Software Dedicated for Hybrid Embedded Systems. | |
JP7059827B2 (en) | Source code generator | |
JP2009181180A (en) | Inspection program, inspection method, and inspection device of program creating tool | |
JP4149047B2 (en) | Simulator |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20060913 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20081126 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20090825 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20091222 |