JP7737556B2 - Computer and test pattern creation method - Google Patents
Computer and test pattern creation methodInfo
- Publication number
- JP7737556B2 JP7737556B2 JP2024526191A JP2024526191A JP7737556B2 JP 7737556 B2 JP7737556 B2 JP 7737556B2 JP 2024526191 A JP2024526191 A JP 2024526191A JP 2024526191 A JP2024526191 A JP 2024526191A JP 7737556 B2 JP7737556 B2 JP 7737556B2
- Authority
- JP
- Japan
- Prior art keywords
- variables
- test pattern
- physical
- test
- internal
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/26—Functional testing
- G06F11/263—Generation of test inputs, e.g. test vectors, patterns or sequences ; with adaptation of the tested hardware for testability with external testers
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Description
本発明は、ソースコードテストするテストパターン作成方法に関する。 The present invention relates to a method for creating test patterns for source code testing.
自動車の操作や運動に関わる制御技術の電子化は、年々増加している。1台の自動車に搭載されるECU(Elctronic Control Unit)と称される車載電子制御装置の数は数十個になり、これらECUに実装されるソフトウェア(以下、ソースコードと称する)の全体のサイズは、100万行から1000万行に及んでいる。The use of electronics in control technologies related to the operation and movement of automobiles is increasing year by year. A single automobile is equipped with dozens of electronic control units (ECUs) and the total size of the software (hereafter referred to as source code) implemented in these ECUs ranges from 1 million to 10 million lines.
このようにソースコードの開発規模は増加する一方で、その開発期間の短縮が要求されている。そのため、短期間開発におけるソースコードの品質維持及び向上が、自動車メーカやサプライヤの大きな課題となっている。 As the scale of source code development increases, there is also a demand to shorten development times. As a result, maintaining and improving the quality of source code during short-term development has become a major challenge for automakers and suppliers.
本技術分野の背景技術として、以下の先行技術がある。特許文献1(特開2014-63415号公報)及び特許文献2(特開2009-14406号公報)がある。特許文献1(特開2014-63415号公報)には、ソフトウェアのテスト仕様を生成するテストケース自動生成装置において、プログラムコードの分岐箇所に到達したか否かを記録する記録文を前記分岐箇所に挿入する分岐記録文挿入手段と、1ステップ分のプログラムコードを複数ステップ分連結する複数ステップ連結手段と、前記複数ステップ分連結されたプログラムコードを実行した場合に前記分岐箇所に到達するか否かを解析する解析手段と、を備えることを特徴とするテストケース自動生成装置が記載されている。 The following prior art exists as background art in this technical field. Patent Document 1 (JP 2014-63415 A) and Patent Document 2 (JP 2009-14406 A) are cited. Patent Document 1 (JP 2014-63415 A) describes an automatic test case generation device that generates software test specifications, characterized in that it includes a branch record statement insertion means that inserts a record statement into the branch point in program code that records whether the branch point has been reached, a multi-step linking means that links one step of program code for multiple steps, and an analysis means that analyzes whether the branch point will be reached when the multi-step linked program code is executed.
また、特許文献2(特開2009-14406号公報)には、センサ信号を取り込んでアクチュエータ駆動信号を出力する電子制御ユニットの自動検査装置であって、前記電子制御ユニットにより実行される処理の中から、検査対象となる制御分岐点の分岐条件を取得する分岐条件取得手段と、前記分岐条件が前記電子制御ユニットにおいて実行されるための運転パターンを出力する運転パターン発生手段と、前記電子制御ユニットの本来の制御対象である実機が、前記運転パターンに沿って動作する際に、前記アクチュエータ駆動信号を受けて生成するセンサ信号と同等の信号を、擬似センサ信号として生成するシミュレータと、前記電子制御ユニットに前記擬似センサ信号を供給し、また、前記電子制御ユニットから発せられるアクチュエータの駆動信号を受信するための信号授受手段と、前記電子制御ユニットにおける処理結果および/または前記シミュレータにおける処理結果が正常であるか否かをコンピュータのハードウェア資源を用いて検査する検査手段と、を備えることを特徴とする電子制御ユニットの自動検査装置が記載されている。 Patent document 2 (JP 2009-14406 A) describes an automatic testing device for an electronic control unit that takes in sensor signals and outputs actuator drive signals, comprising: a branch condition acquisition means that acquires the branch conditions of a control branch point to be tested from among the processes executed by the electronic control unit; an operation pattern generation means that outputs an operation pattern for executing the branch conditions in the electronic control unit; a simulator that generates a pseudo sensor signal that is equivalent to the sensor signal generated in response to the actuator drive signal when the actual machine that is the original control target of the electronic control unit operates in accordance with the operation pattern; a signal exchange means that supplies the pseudo sensor signal to the electronic control unit and receives the actuator drive signal emitted from the electronic control unit; and an inspection means that uses computer hardware resources to inspect whether the processing results in the electronic control unit and/or the processing results in the simulator are normal.
特開2014-63415号公報に記載されたテストケース自動生成装置では、検査対象のECUをHILS(Hardware In the Loop Simulation)を用いて自動検査するため、ECUとHILSとの間で疑似センサ信号とアクチュエータの駆動信号とを送受信して、ECUが本来の制御対象である実機に接続されている場合と同様に作動する。そして、その際に作成されるECU処理結果が正常であるか否かによって、ECUが実機との間で信号を送受信しながら動作する際に正常に機能するか否かを自動的に検査できる。 The automatic test case generation device described in JP 2014-63415 A automatically tests the ECU under test using Hardware In-the-Loop Simulation (HILS), sending and receiving pseudo sensor signals and actuator drive signals between the ECU and the HILS, causing the ECU to operate in the same way as if it were connected to the actual device it is intended to control. Then, depending on whether the ECU processing results created at this time are normal, it can be automatically tested to see whether the ECU functions normally when operating while sending and receiving signals to and from the actual device.
ECUには、車両を制御するための種々のソースコードが記憶されている。これらのソースコードは多数の制御分岐点を含んでおり、これにより複雑な条件設定を可能としている。よって、ソースコードの品質を維持するためには、全ての制御分岐点の検査が望ましいが、ECUのデバッグ検査で使用するテストケースは人手で作成されることが多い。すなわち、作成者の主観に基づいてテストケースが作成されるため、作成者によってテストケースの品質にばらつきが生じる。この場合、テストケースの不備により悪いテスト結果が出て、テスト効率が低下する。 ECUs store various source codes for controlling vehicles. These source codes contain numerous control branch points, which allow for complex condition settings. Therefore, to maintain the quality of the source code, it is desirable to inspect all control branch points, but the test cases used in ECU debug inspections are often created manually. In other words, test cases are created based on the creator's subjective judgment, resulting in variations in the quality of test cases depending on the creator. In this case, poor test results are produced due to defects in the test cases, reducing testing efficiency.
特開2014-63415号公報は、分岐点などを検出し、テストケースの作成を自動化する方法を提案しているが、この提案はソースコードの機能遷移を確認するためのものであり、疑似センサ信号やアクチュエータの駆動信号をECUとHILSとの間で送受信するための物理的な意味を持つテストパターンの作成が困難である。 JP 2014-63415 A proposes a method for detecting branching points and automating the creation of test cases, but this proposal is intended to check the functional transitions of source code, and it is difficult to create test patterns that have physical meaning for sending and receiving pseudo sensor signals and actuator drive signals between the ECU and HILS.
また、特開2009-14406号公報は、検査すべき制御分岐点(例えばIF分など)をソースコードから検出し、当該分岐点における分岐条件及びその想定結果を実行リストとし、当該実行リストに従ってHILSによってシミュレーションが実行するテストパターンを自動的に作成する方法を提案している。しかし、実際には、多くの場合、ソースコード中の値は物理値と異なる内部値であり、内部値のビット当たりのレートを考慮して物理的な値に変換する必要があるが、特開2009-14406号公報には具体的な方法が記載されていない。 In addition, Japanese Patent Application Laid-Open No. 2009-14406 proposes a method for automatically generating test patterns that are executed by simulation using HILS according to an execution list, which identifies control branch points (e.g., IF statements) to be inspected from source code, creates an execution list of the branch conditions at the branch points and their expected results, and then uses HILS to execute the simulation. However, in reality, in many cases, values in the source code are internal values that differ from physical values, and need to be converted to physical values taking into account the bit rate of the internal values. However, Japanese Patent Application Laid-Open No. 2009-14406 does not disclose a specific method for doing this.
本発明は前述した課題を解決するためになされたもので、ソースコード中の内部値と物理値を適切に結びつけ、電子制御ユニットを検査するテストパターンを自動的に作成することを目的とする。 The present invention has been made to solve the above-mentioned problems, and aims to automatically create test patterns for testing electronic control units by appropriately linking internal values in source code with physical values.
本願において開示される発明の代表的な一例を示せば以下の通りである。すなわち、シミュレータの制御モデルで制御プログラムをテストするためのテストパターンを作成する計算機であって、前記制御プログラムで使用される変数の物理的な意味を表すリンクデータを格納するリンクデータ保持部と、前記制御プログラムの分岐処理又は演算処理をテストするための物理的な意味を有さない内部変数で記述されたテストケースを作成するテストケース作成部と、前記リンクデータを使用して、前記テストケースで使用される内部変数を物理的な意味を有する閾値及び変数に変換し、前記物理的な意味を有する変数で記述されたテストパターンを作成するテストパターン作成部と、を備えることを特徴とする。A representative example of the invention disclosed in this application is as follows: A computer that creates test patterns for testing a control program using a simulator's control model, comprising: a link data storage unit that stores link data representing the physical meanings of variables used in the control program; a test case creation unit that creates test cases written with internal variables that do not have physical meaning for testing branching or arithmetic processing of the control program; and a test pattern creation unit that uses the link data to convert the internal variables used in the test cases into thresholds and variables that have physical meaning, and creates test patterns written with the variables that have physical meaning.
本発明の一態様によれば、内部値で構成される制御プログラムのソースコードから作成されるテストケースから、物理的な意味を有する信号が必要となるHILS用のテストパターンを作成できる。前述した以外の課題、構成及び効果は、以下の実施例の説明によって明らかにされる。According to one aspect of the present invention, test patterns for HILS, which require signals with physical meaning, can be created from test cases created from the source code of a control program composed of internal values. Other issues, configurations, and advantages will become clearer from the description of the following examples.
以下、本発明の実施例を図面を参照して説明する。本実施例にかかるHILS(Hardware In the Loop Simulation)を用いた自動テスト環境は、物理的な意味を有さない内部値で構成されたソースコードから作成されたテストケースでも、情報リンクデータベースを介することによって、HILSを動作させる物理的な意味を持つテストパターンを作成し、効率的なテストを実現する。 An embodiment of the present invention will be described below with reference to the drawings. The automated testing environment using HILS (Hardware In the Loop Simulation) according to this embodiment enables efficient testing by creating test patterns with physical meaning that operate HILS through an information link database, even for test cases created from source code consisting of internal values that have no physical meaning.
まず、図1を参照して本実施例のHILSを用いた自動テスト環境について説明する。図1は、本実施例による内部値で構成されるソースコード30を物理的な信号で動作されるHILSにてテストするシステムの概略構成図である。図1では、HILSが車両モデル11と運転モデル12で構成される。本実施例のHILS10は電気的な接続線を介してECU(車載電子制御装置、Electric Control Unit)20に接続されている。また、HILS10は、電気的な接続線を介しパーソナルコンピュータ(PC)70と接続される。First, we will explain the automatic testing environment using the HILS of this embodiment with reference to Figure 1. Figure 1 is a schematic diagram of a system that tests source code 30 composed of internal values according to this embodiment using a HILS operated by physical signals. In Figure 1, the HILS is composed of a vehicle model 11 and a driving model 12. The HILS 10 of this embodiment is connected to an ECU (Electric Control Unit) 20 via electrical connection lines. The HILS 10 is also connected to a personal computer (PC) 70 via electrical connection lines.
HILS10は、ECU20の本来の制御対象である車両と同様に、ECU20との間で信号を授受しつつ、所望のシミュレーションを実現するためのシミュレーションシステムである。PC70にはECU20で動作するソースコード30が記憶される。また、ソースコード30を解析し、自動的にテストケースを作成するテストケース自動作成ツール40と、テストケース自動作成ツール40によって作成された内部値で構成されるテストケースに物理的な意味を与えるリンクデータベース60を介して、HILS10を動作させるテストパターンを作成するテストパターン自動作成ツール50が含まれる。 HILS10 is a simulation system that performs desired simulations by exchanging signals with ECU20, just like the vehicle that ECU20 is intended to control. Source code 30 that runs on ECU20 is stored in PC70. It also includes an automatic test case creation tool 40 that analyzes the source code 30 and automatically creates test cases, and an automatic test pattern creation tool 50 that creates test patterns that run HILS10 via a link database 60 that gives physical meaning to test cases made up of internal values created by automatic test case creation tool 40.
HILS10は、車両モデル11と運転モデル12とを含む。運転モデル12は、運転者による運転操作を模擬するモデルであり、供給されたテストパターンに適合した車速を実現するためのアクセル開度を算出し、そのアクセル開度に関する情報を車両モデル11に出力する。 HILS10 includes a vehicle model 11 and a driving model 12. The driving model 12 is a model that simulates driving operations by a driver, calculates the accelerator opening to achieve a vehicle speed that matches the supplied test pattern, and outputs information about the accelerator opening to the vehicle model 11.
車両モデル11は、車両の機能を模擬するモデルである。例えば、車両に搭載されるエンジンの実機には、排気空燃比を計測するためのA/Fセンサ、クランク角を計測するためのクランク角センサ、吸入空気量Gaを計測するためのエアフロメータなど、種々のセンサが搭載され、燃料噴射弁などのアクチュエータが搭載される。車両モデル11は、運転モデル12から出力されるアクセル開度の情報や、ECU20から出力されるアクチュエータ信号に従って、エンジンの実機やアクチュエータの動きを模擬し、かつ、実機において生成される種々のセンサ信号と同様の信号を模擬センサ信号として生成する。 Vehicle model 11 is a model that simulates the functions of a vehicle. For example, the actual engine installed in a vehicle is equipped with various sensors, such as an A/F sensor for measuring the exhaust air-fuel ratio, a crank angle sensor for measuring the crank angle, and an air flow meter for measuring the intake air amount Ga, as well as actuators such as fuel injection valves. Vehicle model 11 simulates the movement of the actual engine and actuators in accordance with accelerator opening information output from driving model 12 and actuator signals output from ECU 20, and generates simulated sensor signals similar to the various sensor signals generated in the actual engine.
車両モデル11において生成される擬似センサ信号は、ワイヤーハーネスを介してECU20に供給される。車両モデル11からECU20に供給される擬似センサ信号は、例えば、A/Fセンサの擬似信号(排気空燃比の擬似信号)や吸入空気量Gaの擬似信号など、燃料噴射量(燃料噴射時間TAU)を算出するためにECU20が必要とする信号、又は、クランク角センサの擬似信号など、ECU20の処理をHILSシステム10の処理と同期させるために必要な信号などを含む。The pseudo sensor signals generated in the vehicle model 11 are supplied to the ECU 20 via a wire harness. The pseudo sensor signals supplied from the vehicle model 11 to the ECU 20 include signals required by the ECU 20 to calculate the fuel injection amount (fuel injection time TAU), such as a pseudo signal from an A/F sensor (a pseudo signal from the exhaust air-fuel ratio) or a pseudo signal from the intake air amount Ga, or signals required to synchronize the processing of the ECU 20 with the processing of the HILS system 10, such as a pseudo signal from a crank angle sensor.
ECU20は、車両モデル11から供給された擬似センサ信号に基づいて、内燃機関の制御に必要な所定の処理を実行し、処理によって生成されるアクチュエータ信号を再び車両モデル11に出力する。本実施例のECU20は、例えば、吸入空気量や排気空燃比A/Fなどの擬似センサ信号に従って、燃料噴射時間を算出する処理や、適切なタイミングで燃料噴射時間だけ燃料噴射弁を開弁するための噴射信号をアクチュエータ駆動信号として出力する処理などを実行する。 The ECU 20 performs predetermined processing required for controlling the internal combustion engine based on the pseudo sensor signals supplied from the vehicle model 11, and outputs the actuator signals generated by the processing back to the vehicle model 11. In this embodiment, the ECU 20 performs processing such as calculating the fuel injection time according to pseudo sensor signals such as intake air volume and exhaust air-fuel ratio A/F, and outputting an injection signal as an actuator drive signal to open the fuel injection valve for the fuel injection time at the appropriate timing.
次に、HILS10を利用したシミュレーションにおいて、制御分岐点における処理を実行するための動作について説明する。ここでは、先ず、運転パターンの特定動作について説明する。本実施例のHILS10は、入力された車両の運転条件に従って、本来の制御対象である実機を模擬したシミュレーションを実行する。従って、HILS10によるシミュレーションにおいて制御分岐点における処理が実行されるように車両の運転条件が特定される。具体的には、HILS10は、PC70が記憶しているCU20の制御用ソースコードから検査すべき制御分岐点(例えば、IF文など)を検出して、当該分岐点における分岐条件及びその想定結果が実行リストとしてPC70内に記憶される。そして、HILS10は、当該実行リストに従ってHILS10におけるシミュレーションが実行されるように、車両の運転条件としての目標車速、目標回転数を特定する。Next, we will explain the operation for executing processing at a control branch point in a simulation using HILS10. Here, we will first explain the operation for specifying a driving pattern. In this embodiment, HILS10 executes a simulation that simulates the actual vehicle, which is the original control target, according to the input vehicle driving conditions. Therefore, the vehicle driving conditions are specified so that processing at the control branch point is executed in the simulation by HILS10. Specifically, HILS10 detects a control branch point (e.g., an IF statement) to be inspected from the control source code of CU20 stored in PC70, and the branch conditions at the branch point and their expected results are stored in PC70 as an execution list. HILS10 then specifies the target vehicle speed and target rotation speed as vehicle driving conditions so that the simulation in HILS10 is executed according to the execution list.
次に、図2を参照して、本実施例において実行される処理の具体的内容について説明する。 Next, referring to Figure 2, the specific details of the processing performed in this embodiment will be explained.
ステップS1では、HILS用PC70内に格納された制御プログラムのソースコード30から、制御分岐点(IF文など)が検出され、その分岐条件(変数、閾値)及び想定結果が抽出される。ステップS2では、抽出された分岐条件がテストケースとしてPC70内に保持される。なお、前述したように、ここで用いられるソースコード30は内部値で構成されているため、内部値によるテストケースである。In step S1, control branch points (such as IF statements) are detected from the control program source code 30 stored in the HILS PC 70, and their branch conditions (variables, thresholds) and expected results are extracted. In step S2, the extracted branch conditions are stored in the PC 70 as test cases. As mentioned above, the source code 30 used here is composed of internal values, so it is a test case using internal values.
ステップS3では、内部値で作成されたテストケースからリンクデータベース60を用いて物理的な信号に変換し、ステップS4において、PC70が、変換された物理的な信号によってHILS10を動作させるテストパターンを作成し、保持する。 In step S3, the test case created using internal values is converted into a physical signal using the link database 60, and in step S4, the PC 70 creates and stores a test pattern that operates the HILS 10 using the converted physical signal.
ステップS5では、ステップS4で作成されたテストパターンを用いてHILS10によるテストを実行する。 In step S5, a test is performed using HILS10 using the test pattern created in step S4.
図3は、HILS10を使用して分岐条件検査を実行するルーチンを構成するソースコード30の例である。ソースコード30の入出力は入力変数と出力変数で構成される。この入力変数と出力変数は内部値で表現され、内部値はレートを通じて物理値に換算される。このため、この入力変数と出力変数は、ソースコード内では直接物理値とは異なり、物理的な意味を持たず、信号の属性が特定されない値である。ソースコード30は、この内部値を使用して各処理や分岐処理を実行する。 Figure 3 is an example of source code 30 that constitutes a routine that performs branch condition testing using HILS10. The input and output of source code 30 consist of input and output variables. These input and output variables are expressed as internal values, which are converted to physical values through rates. Therefore, unlike direct physical values within the source code, these input and output variables have no physical meaning and are values for which signal attributes are not specified. Source code 30 uses these internal values to perform various processes and branching operations.
次に、図4を参照して、本実施例の処理の具体的内容について説明する。図4は、HILS10を使用して分岐条件検査を実行する処理のフローチャートである。Next, the specific details of the processing of this embodiment will be explained with reference to Figure 4. Figure 4 is a flowchart of the processing for performing branch condition checking using HILS10.
図4に示すルーチンでは、先ず、制御分岐点における分岐条件及びその想定結果を抽出する(ステップ100からステップ102)。ここでは、具体的には、HILS用PC70内に格納された制御用ソースコードから、制御分岐点(IF文など)を検出し、その分岐条件及び想定結果を抽出する。抽出された分岐条件及び想定結果は、テストケースの実行リストとしてPC70内に格納される。In the routine shown in Figure 4, first, the branch conditions and their expected results at the control branch points are extracted (steps 100 to 102). Specifically, control branch points (such as IF statements) are detected from the control source code stored in the HILS PC 70, and their branch conditions and expected results are extracted. The extracted branch conditions and expected results are stored in the PC 70 as an execution list of the test cases.
図5は、ソースコード内の内部値(制御プログラム信号)とHILS10で動作する物理的な信号の関係を記述するリンクデータベース60の構成例を示す図である。 Figure 5 shows an example configuration of a link database 60 that describes the relationship between internal values (control program signals) in the source code and physical signals operating in HILS 10.
前述のとおり、プログラム信号欄に記述される内部値で作成されるテストケースは物理的な意味や属性を有さないため、HILS10で動作させるテストパターンにできないが、レートと属性を物理信号と関連付けられればテストパターンにできる。よって、リンクデータベース60には内部値の情報(RAM(Random Access Memory)、レート及び単位)と、その内部値の物理的な属性が記憶される。また、それらの信号がHILS10で使用されるテストパターンの信号の情報が記憶されており、内部値として記憶された情報と関連付けられる。テストケースで使用され、物理的な意味や属性を有さない内部値(変数、閾値)は、HILS10で動作させるテストパターンの変数や閾値と線形変換可能な関係にあり、変換係数がレート欄に記述される。また、同じ物理変数(例えば、エンジン回転数)でも、制御プログラムにおける複数の内部値が使用されることがある。物理属性が同じ場合、HILSで動作させるテストパターンの信号は一つであるため、同じ物理属性の複数の内部値を異なるレート値によって一つの物理属性の信号と関連付ける。As mentioned above, test cases created using internal values written in the program signal column have no physical meaning or attributes and therefore cannot be used as test patterns to be run in HILS10. However, they can be used as test patterns if rates and attributes are associated with physical signals. Therefore, the link database 60 stores internal value information (RAM (Random Access Memory), rate, and unit) and the physical attributes of those internal values. Furthermore, information on the signals of test patterns used in HILS10 is stored and associated with the stored information as internal values. Internal values (variables, thresholds) used in test cases that do not have physical meaning or attributes are linearly convertible with the variables and thresholds of test patterns run in HILS10, and the conversion coefficients are written in the rate column. Furthermore, multiple internal values may be used in the control program for the same physical variable (e.g., engine speed). When the physical attributes are the same, there is only one test pattern signal run in HILS, so multiple internal values of the same physical attribute are associated with a single physical attribute signal using different rate values.
図6は、リンクデータベース60を用いてテストケースの内部値と関連付けられたHILS10で動作する物理的な意味を持つテストパターンのフローチャートである。 Figure 6 is a flowchart of test patterns with physical meanings that run in HILS 10 and are associated with internal values of test cases using the link database 60.
図6に示すルーチンでは、制御分岐点における分岐条件及びその想定結果を抽出する(ステップ300からステップ302)。ここでは、具体的には、HILS用PC70内に格納されたテストケースから、制御分岐点(IF文など)を検出し、その分岐条件が抽出される。抽出された分岐条件は、テストパターンの実行リストとしてPC70内に格納される。In the routine shown in Figure 6, the branch conditions and their expected results at control branch points are extracted (steps 300 to 302). Specifically, control branch points (such as IF statements) are detected from test cases stored in the HILS PC 70, and their branch conditions are extracted. The extracted branch conditions are stored in the PC 70 as an execution list of the test pattern.
図7は、PC70内に格納されるテストパターンをHILS10で動作させるために出力される信号のタイムチャートである。 Figure 7 is a time chart of the signals output to operate the test patterns stored in PC70 in HILS10.
図6に示すテストパターンにおける分岐条件は下記A~Dであり、A~Dの分岐条件に対応する信号が図7に示すタイミングでPC70から出力され、HILS10でテストが実行される。
A:エンジン回転、水温条件及び判定時間の各条件をS200でNに分岐
B:S201でNに分岐
C:S202でNに分岐
D:全条件Y
The branch conditions in the test pattern shown in FIG. 6 are A to D below, and signals corresponding to the branch conditions A to D are output from the PC 70 at the timings shown in FIG.
A: Branch to N at S200 for engine speed, water temperature condition, and judgment time. B: Branch to N at S201. C: Branch to N at S202. D: Y for all conditions.
以上、本発明について、HILSを用いた実施例を説明したが、本発明はMILSにも適用できる。 The above describes an embodiment of the present invention using HILS, but the present invention can also be applied to MILS.
以上に説明したように、本発明の実施例では、制御プログラムのソースコード30から作成されるテストケースの内部値を変数名、物理属性、物理値に変換するレートを格納するリンクデータベース60と関連付け、リンクデータベース60を参照してHILS10で動作可能な物理的な信号で構成されるテストパターンを作成するので、制御プログラムのソースコード30から、HILS10で動作させるテストパターンを作成できる。 As described above, in an embodiment of the present invention, the internal values of test cases created from the control program source code 30 are associated with a link database 60 that stores variable names, physical attributes, and rates for converting physical values, and test patterns consisting of physical signals that can be operated in HILS10 are created by referring to the link database 60, so that test patterns that can be operated in HILS10 can be created from the control program source code 30.
また、同じ物理変数(例えば、エンジン回転数)を意味する複数の内部値が制御プログラムで使用される場合でも、異なるレート値によって一つの物理属性の信号と関連付け、HILSで動作させるテストパターンの一つの信号に集約できる。 Also, even if multiple internal values representing the same physical variable (e.g., engine speed) are used in a control program, they can be associated with a single physical attribute signal using different rate values and consolidated into a single signal in the test pattern run by HILS.
なお、本発明は前述した実施例に限定されるものではなく、添付した特許請求の範囲の趣旨内における様々な変形例及び同等の構成が含まれる。例えば、前述した実施例は本発明を分かりやすく説明するために詳細に説明したものであり、必ずしも説明した全ての構成を備えるものに本発明は限定されない。また、ある実施例の構成の一部を他の実施例の構成に置き換えてもよい。また、ある実施例の構成に他の実施例の構成を加えてもよい。また、各実施例の構成の一部について、他の構成の追加・削除・置換をしてもよい。 The present invention is not limited to the above-described embodiments, and includes various modifications and equivalent configurations within the spirit of the appended claims. For example, the above-described embodiments have been described in detail to clearly explain the present invention, and the present invention is not necessarily limited to configurations that include all of the described configurations. Furthermore, part of the configuration of one embodiment may be replaced with the configuration of another embodiment. Furthermore, the configuration of another embodiment may be added to the configuration of one embodiment. Furthermore, part of the configuration of each embodiment may be added, deleted, or replaced with other configurations.
また、前述した各構成、機能、処理部、処理手段等は、それらの一部又は全部を、例えば集積回路で設計する等により、ハードウェアで実現してもよく、プロセッサがそれぞれの機能を実現するプログラムを解釈し実行することにより、ソフトウェアで実現してもよい。 Furthermore, each of the aforementioned configurations, functions, processing units, processing means, etc. may be realized in hardware, for example by designing some or all of them as integrated circuits, or may be realized in software by a processor interpreting and executing a program that realizes each function.
各機能を実現するプログラム、テーブル、ファイル等の情報は、メモリ、ハードディスク、SSD(Solid State Drive)等の記憶装置、又は、ICカード、SDカード、DVD等の記録媒体に格納することができる。 Information such as programs, tables, files, etc. that realize each function can be stored in storage devices such as memory, hard disks, SSDs (Solid State Drives), or recording media such as IC cards, SD cards, and DVDs.
また、制御線や情報線は説明上必要と考えられるものを示しており、実装上必要な全ての制御線や情報線を示しているとは限らない。実際には、ほとんど全ての構成が相互に接続されていると考えてよい。 Furthermore, the control lines and information lines shown are those considered necessary for explanation, and do not necessarily represent all control lines and information lines necessary for implementation. In reality, it is safe to assume that almost all components are interconnected.
10…HILSシステム、11…車両モデル、12…運転モデル、20…ECU、30…ソースコード、40…テストケース自動作成ツール、50…テストパターン自動作成ツール、60…リンクデータベース、70…HILS用PC 10...HILS system, 11...vehicle model, 12...driving model, 20...ECU, 30...source code, 40...automatic test case creation tool, 50...automatic test pattern creation tool, 60...link database, 70...HILS PC
Claims (7)
前記制御プログラムで使用される変数の物理的な意味を表すリンクデータを格納するリンクデータ保持部と、
前記制御プログラムの分岐処理又は演算処理をテストするための物理的な意味を有さない内部変数で記述されたテストケースを作成するテストケース作成部と、
前記リンクデータを使用して、前記テストケースで使用される内部変数を物理的な意味を有する閾値及び変数に変換し、前記物理的な意味を有する変数で記述されたテストパターンを作成するテストパターン作成部と、を備えることを特徴とする計算機。 A computer that generates test patterns for testing a control program using a control model of a simulator,
a link data storage unit for storing link data representing the physical meanings of variables used in the control program;
a test case creation unit that creates test cases described with internal variables that have no physical meaning for testing branching or arithmetic processing of the control program;
a test pattern creation unit that uses the link data to convert internal variables used in the test case into thresholds and variables having physical meanings, and creates a test pattern described with the variables having physical meanings.
前記物理的な意味を有さない内部変数と、前記物理的な意味を有する変数とは線形変換可能な関係にあって、
前記リンクデータ保持部は、前記物理的な意味を有さない内部変数と、前記物理的な意味を有する変数との変換係数を保持することを特徴とする計算機。 2. The computer of claim 1,
The internal variable having no physical meaning and the variable having physical meaning are in a linearly transformable relationship,
The computer is characterized in that the link data storage unit stores a conversion coefficient between the internal variable having no physical meaning and the variable having a physical meaning.
前記テストパターン作成部は、
前記制御プログラムから、分岐処理の内部変数及びその閾値を抽出し、
前記リンクデータ保持部に保持された変換係数を参照して、前記分岐処理の内部変数及び閾値を物理的な意味を有する変数及び閾値に変換し、
前記物理的な意味を有する変数及び閾値で記述されたテストパターンを生成することを特徴とする計算機。 3. The computer of claim 2,
The test pattern generation unit
Extracting internal variables of branch processing and their thresholds from the control program;
converting the internal variables and thresholds of the branching process into variables and thresholds having physical meanings by referring to the conversion coefficients stored in the link data storage unit;
A computer that generates test patterns described by variables and thresholds having physical meanings.
前記制御プログラムは、車載電子制御装置で実行されるためのものであることを特徴とする計算機。 2. The computer of claim 1,
The control program is a computer program that is executed by an on-vehicle electronic control unit.
前記テストパターン作成方法を実行する計算機は、所定の演算処理を実行する演算装置と、前記演算装置に接続される記憶デバイスとを有し、
前記記憶デバイスは、前記制御プログラムで使用される変数の物理的な意味を表すリンクデータを格納し、
前記テストパターン作成方法は、
前記演算装置が、前記制御プログラムの分岐処理又は演算処理をテストするための物理的な意味を有さない内部変数で記述されたテストケースを作成するテストケース作成手順と、
前記演算装置が、前記リンクデータを使用して、前記テストケースで使用される内部変数を物理的な意味を有する変数に変換し、前記物理的な意味を有する閾値及び変数で記述されたテストパターンを作成するテストパターン作成手順と、を含むことを特徴とするテストパターン作成方法。 1. A test pattern generation method for generating a test pattern for testing a control program using a control model of a simulator, comprising:
The computer that executes the test pattern generation method includes an arithmetic unit that executes predetermined arithmetic processing, and a storage device that is connected to the arithmetic unit;
the storage device stores link data that represents the physical meaning of variables used in the control program;
The test pattern creation method includes:
a test case creation procedure in which the arithmetic device creates test cases described with internal variables that have no physical meaning for testing branching or arithmetic processing of the control program;
a test pattern creation procedure in which the computing device uses the link data to convert internal variables used in the test case into variables having physical meanings, and creates a test pattern described with thresholds and variables having physical meanings.
前記物理的な意味を有さない内部変数と、前記物理的な意味を有する変数とは線形変換可能な関係にあって、
前記記憶デバイスは、前記物理的な意味を有さない内部変数と、前記物理的な意味を有する変数との変換係数を保持することを特徴とするテストパターン作成方法。 6. The test pattern creation method according to claim 5,
The internal variable having no physical meaning and the variable having physical meaning are in a linearly transformable relationship,
The test pattern generating method according to the present invention, wherein the storage device stores conversion coefficients between the internal variables that do not have physical meaning and the variables that have physical meaning.
前記テストパターン作成手順では、
前記演算装置が、前記制御プログラムから、分岐処理の内部変数及びその閾値を抽出し、
前記演算装置が、前記記憶デバイスに保持された変換係数を参照して、前記分岐処理の内部変数及び閾値を物理的な意味を有する変数及び閾値に変換し、
前記演算装置が、前記物理的な意味を有する変数及び閾値で記述されたテストパターンを生成することを特徴とするテストパターン作成方法。 7. The test pattern creation method according to claim 6,
In the test pattern generation procedure,
the arithmetic unit extracts an internal variable of a branch process and a threshold value thereof from the control program;
the arithmetic unit converts the internal variables and thresholds of the branching process into variables and thresholds having physical meanings by referring to the conversion coefficients stored in the storage device;
A test pattern generating method, characterized in that the arithmetic unit generates a test pattern described by the variables and threshold values having physical meanings.
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/JP2022/023431 WO2023238372A1 (en) | 2022-06-10 | 2022-06-10 | Computer and method for creating test pattern |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPWO2023238372A1 JPWO2023238372A1 (en) | 2023-12-14 |
| JP7737556B2 true JP7737556B2 (en) | 2025-09-10 |
Family
ID=89117807
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2024526191A Active JP7737556B2 (en) | 2022-06-10 | 2022-06-10 | Computer and test pattern creation method |
Country Status (2)
| Country | Link |
|---|---|
| JP (1) | JP7737556B2 (en) |
| WO (1) | WO2023238372A1 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US12596640B2 (en) * | 2023-12-22 | 2026-04-07 | Woven By Toyota, Inc. | System and method for managing a test for testing an embedded system of a vehicle |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2009014406A (en) * | 2007-07-02 | 2009-01-22 | Toyota Motor Corp | Automatic inspection device for electronic control unit |
-
2022
- 2022-06-10 JP JP2024526191A patent/JP7737556B2/en active Active
- 2022-06-10 WO PCT/JP2022/023431 patent/WO2023238372A1/en not_active Ceased
Non-Patent Citations (1)
| Title |
|---|
| 久代紀之ほか,仕様書からのテストケース設計プロセスの定義とテストケース生成支援ツール,FIT2018 第17回情報科学技術フォーラム 講演論文集 第1分冊,日本,一般社団法人電子情報通信学会,2018年09月12日,15~21ページ |
Also Published As
| Publication number | Publication date |
|---|---|
| JPWO2023238372A1 (en) | 2023-12-14 |
| WO2023238372A1 (en) | 2023-12-14 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US7415389B2 (en) | Calibration of engine control systems | |
| JP5290199B2 (en) | How to simulate engine operation | |
| Ramaswamy et al. | A case study in hardware-in-the-loop testing: Development of an ECU for a hybrid electric vehicle | |
| US8683442B2 (en) | Software test case generation from a partial design model | |
| US6061283A (en) | Semiconductor integrated circuit evaluation system | |
| JP2014203314A (en) | ECU simulation device | |
| JP2000082094A (en) | Semiconductor integrated circuit design verification system | |
| JP2009014406A (en) | Automatic inspection device for electronic control unit | |
| WO2018003495A1 (en) | Ecu simulation device | |
| JP7737556B2 (en) | Computer and test pattern creation method | |
| Beine et al. | Development of safety-critical software using automatic code generation | |
| Boulanger | Requirements engineering in a model-based methodology for embedded automotive software | |
| Lee et al. | Towards a seamless development process for automotive engine-control system | |
| Murphy et al. | Best practices for verification, validation, and test in model-based design | |
| Damji et al. | Automated Model-Based calibration for drivability using a virtual engine test cell | |
| Shaout et al. | Model based approach for automotive embedded systems | |
| US12468870B2 (en) | Method and system for carrying out a simulation | |
| Drenth et al. | Consistent simulation environment with FMI based tool chain | |
| Butts et al. | 15 AUTOMOTIVE POWERTRAIN CONTROLLER DEVELOPMENT USING CACSD | |
| US20250005218A1 (en) | Method, Device, Vehicle and Computer Program for Modeling and Monitoring a Warming-Up Behavior of a Vehicle Component | |
| Zhou et al. | Hardware software co-design for automotive CPS using architecture analysis and design language | |
| Nanjundaswamy et al. | Development and calibration of on-board-diagnostic strategies using a micro-HiL approach | |
| Beck et al. | Towards Change-Aware Testing of Multi-Domain Cyber-Physical Systems: Challenges and Future Directions | |
| Syed et al. | Improving the efficiency of production level algorithm development for an SUV HEV powertrain | |
| Zheng et al. | A hardware-in-the-loop test bench for production transmission controls software quality validation |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20240725 |
|
| 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: 20250805 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20250829 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 7737556 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |