WO2023238372A1 - 計算機、及びテストパターン作成方法 - Google Patents

計算機、及びテストパターン作成方法 Download PDF

Info

Publication number
WO2023238372A1
WO2023238372A1 PCT/JP2022/023431 JP2022023431W WO2023238372A1 WO 2023238372 A1 WO2023238372 A1 WO 2023238372A1 JP 2022023431 W JP2022023431 W JP 2022023431W WO 2023238372 A1 WO2023238372 A1 WO 2023238372A1
Authority
WO
WIPO (PCT)
Prior art keywords
test pattern
variables
physical meaning
test
control program
Prior art date
Application number
PCT/JP2022/023431
Other languages
English (en)
French (fr)
Inventor
陽一郎 山岸
Original Assignee
日立Astemo株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 日立Astemo株式会社 filed Critical 日立Astemo株式会社
Priority to PCT/JP2022/023431 priority Critical patent/WO2023238372A1/ja
Publication of WO2023238372A1 publication Critical patent/WO2023238372A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing
    • G06F11/263Generation of test inputs, e.g. test vectors, patterns or sequences ; with adaptation of the tested hardware for testability with external testers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software

Definitions

  • the present invention relates to a test pattern creation method for testing source code.
  • ECUs Electronic Control Units
  • source code software
  • Patent Document 1 Japanese Patent Application Publication No. 2014-634105
  • Patent Document 2 Japanese Patent Application Publication No. 2009-14406
  • Patent Document 1 Japanese Unexamined Patent Publication No. 2014-63415 discloses that in an automatic test case generation device that generates software test specifications, a record statement for recording whether or not a branch point of a program code has been reached is written at the branch point.
  • An automatic test case generation device is described, which is characterized by comprising: an analysis means for analyzing.
  • Patent Document 2 Japanese Unexamined Patent Publication No. 2009-14406 discloses an automatic inspection device for an electronic control unit that takes in a sensor signal and outputs an actuator drive signal, which includes a process executed by the electronic control unit.
  • a branch condition acquisition means for acquiring a branch condition of a control branch point to be inspected;
  • an operation pattern generation means for outputting an operation pattern for executing the branch condition in the electronic control unit; and
  • a simulator that generates a signal equivalent to a sensor signal generated in response to the actuator drive signal as a pseudo sensor signal when the actual machine, which is the original control target, operates in accordance with the operation pattern;
  • a signal exchange means for supplying the pseudo sensor signal to the unit and receiving the actuator drive signal emitted from the electronic control unit, and a processing result in the electronic control unit and/or a processing result in the simulator is normal.
  • An automatic testing device for an electronic control unit is described, which is characterized in that it is equipped with a testing means for testing whether or not the above is the case using the hardware resources of a computer.
  • JP2014-63415A Japanese Patent Application Publication No. 2009-14406
  • test case automatic generation device described in Japanese Patent Application Publication No. 2014-63415 automatically tests the ECU to be tested using HILS (Hardware In the Loop Simulation), so pseudo sensor signals and The ECU transmits and receives actuator drive signals and operates in the same way as when the ECU is connected to the actual machine that is originally to be controlled. Then, depending on whether the ECU processing result created at that time is normal or not, it is possible to automatically check whether the ECU functions normally when operating while transmitting and receiving signals with the actual machine.
  • HILS Hard In the Loop Simulation
  • the ECU stores various source codes for controlling the vehicle. These source codes contain many control branch points, which enable complex condition settings. Therefore, in order to maintain the quality of the source code, it is desirable to test all control branch points, but test cases used in ECU debugging tests are often created manually. That is, since test cases are created based on the subjectivity of the creator, the quality of the test cases varies depending on the creator. In this case, poor test results may occur due to deficiencies in test cases, reducing test efficiency.
  • Japanese Patent Application Publication No. 2014-63415 proposes a method for detecting branch points and automating the creation of test cases. It is difficult to create a physically meaningful test pattern for transmitting and receiving signals and actuator drive signals between the ECU and the HILS.
  • Japanese Patent Laid-Open No. 2009-14406 discloses that a control branch point to be inspected (for example, an IF part, etc.) is detected from the source code, a branch condition at the branch point and its expected result is set as an execution list, and HILS is executed according to the execution list. proposed a method to automatically create test patterns to be executed by simulation.
  • the values in the source code are internal values that are different from physical values, and it is necessary to convert them into physical values by considering the rate per bit of the internal values.
  • No. 2009-14406 does not describe a specific method.
  • the present invention was made in order to solve the above-mentioned problems, and its purpose is to appropriately link internal values and physical values in a source code and automatically create a test pattern for testing an electronic control unit.
  • a typical example of the invention disclosed in this application is as follows. That is, a computer that creates a test pattern for testing a control program using a control model of a simulator, and a link data holding unit that stores link data representing the physical meaning of variables used in the control program; a test case creation unit that creates a test case written with internal variables that have no physical meaning for testing branch processing or arithmetic processing of the control program; and a test pattern creation unit that converts internal variables used in the test into thresholds and variables that have physical meaning, and creates a test pattern described using the variables that have physical meaning. .
  • a test pattern for HILS that requires a signal with physical meaning can be created from a test case created from a source code of a control program configured with internal values.
  • FIG. 1 is a schematic configuration diagram of a test environment according to the present embodiment.
  • 3 is a flowchart of processing executed in this embodiment. This is an example of source code in which a branch condition test using HILS is performed. It is a flowchart of processing by a test case. It is a figure showing an example of composition of a link database. It is a flowchart of processing using a test pattern. 3 is a time chart of output signals for operating a test pattern in HILS.
  • the automatic test environment using HILS allows test cases created from source code consisting of internal values that have no physical meaning to be tested via the information link database. By doing this, test patterns with physical meaning for operating HILS are created and efficient tests are realized.
  • HILS Hard In the Loop Simulation
  • FIG. 1 is a schematic configuration diagram of a system for testing a source code 30 composed of internal values according to this embodiment using a HILS operated by physical signals.
  • 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 an electrical connection line. Further, the HILS 10 is connected to a personal computer (PC) 70 via an electrical connection line.
  • ECU Electronic Control Unit
  • PC personal computer
  • the HILS 10 is a simulation system for realizing a desired simulation while exchanging signals with the ECU 20, similar to the vehicle that is originally controlled by the ECU 20.
  • a source code 30 that operates on the ECU 20 is stored in the PC 70.
  • an automatic test case creation tool 40 that analyzes the source code 30 and automatically creates test cases, and gives physical meaning to the test cases that are made up of internal values created by the automatic test case creation tool 40.
  • An automatic test pattern creation tool 50 that creates test patterns for operating the HILS 10 via the link database 60 is included.
  • the HILS 10 includes a vehicle model 11 and a driving model 12.
  • the driving model 12 is a model that simulates the driving operation by the driver, and calculates the accelerator opening degree to achieve a vehicle speed that matches the supplied test pattern, and outputs information regarding the accelerator opening degree to the vehicle model 11. do.
  • the vehicle model 11 is a model that simulates the functions of a vehicle.
  • an actual engine installed in a vehicle includes an A/F sensor to measure the exhaust air-fuel ratio, a crank angle sensor to measure the crank angle, an air flow meter to measure the intake air amount Ga, etc. It is equipped with various sensors and actuators such as fuel injection valves.
  • the vehicle model 11 simulates the movement of the actual engine and actuator according to the accelerator opening information output from the driving model 12 and the actuator signal output from the ECU 20, and also simulates various sensor signals generated in the actual engine. A signal similar to that is generated as a simulated sensor signal.
  • a pseudo sensor signal generated in the vehicle model 11 is supplied to the ECU 20 via a wire harness.
  • the pseudo sensor signal supplied from the vehicle model 11 to the ECU 20 includes, for example, a pseudo signal of an A/F sensor (a pseudo signal of an exhaust air-fuel ratio), a pseudo signal of an intake air amount Ga, and a fuel injection amount (fuel injection time TAU).
  • the ECU 20 executes predetermined processing necessary for controlling the internal combustion engine based on the pseudo sensor signal supplied from the vehicle model 11, and outputs the actuator signal generated by the processing to the vehicle model 11 again.
  • the ECU 20 of this embodiment calculates the fuel injection time according to pseudo sensor signals such as intake air amount and exhaust air-fuel ratio A/F, and opens the fuel injection valve for the fuel injection time at an appropriate timing. Processing such as outputting the injection signal for the actuator drive signal as an actuator drive signal is executed.
  • the HILS 10 of this embodiment executes a simulation simulating an actual machine, which is the original control target, according to the input driving conditions of the vehicle. Therefore, the driving conditions of the vehicle are specified so that the processing at the control branch point is executed in the simulation by the HILS 10.
  • the HILS 10 detects a control branch point (for example, an IF statement) to be inspected from the control source code of the CU 20 stored in the PC 70, and determines the branch condition and its expected result at the branch point. It is stored in the PC 70 as an execution list.
  • the HILS 10 specifies the target vehicle speed and target rotation speed as driving conditions of the vehicle so that the simulation in the HILS 10 is executed according to the execution list.
  • step S1 control branch points (IF statements, etc.) are detected from the source code 30 of the control program stored in the HILS PC 70, and their branch conditions (variables, thresholds) and assumed results are extracted.
  • step S2 the extracted branch condition is held in the PC 70 as a test case. Note that, as described above, the source code 30 used here is composed of internal values, so this is a test case using internal values.
  • 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 a test pattern for operating the HILS 10 using the converted physical signal. and hold.
  • step S5 a test by HILS10 is performed using the test pattern created in step S4.
  • FIG. 3 is an example of source code 30 configuring a routine that uses the HILS 10 to execute a branch condition check.
  • the input/output of the source code 30 is composed of input variables and output variables. These input variables and output variables are expressed as internal values, and the internal values are converted into physical values through rates. Therefore, unlike direct physical values in the source code, these input variables and output variables have no physical meaning and are values whose signal attributes are not specified.
  • the source code 30 uses this internal value to execute each process and branch process.
  • FIG. 4 is a flowchart of processing for executing a branch condition check using the HILS 10.
  • step 100 to 102 branch conditions and their assumed results at control branch points are extracted (steps 100 to 102).
  • a control branch point (such as an IF statement) is detected from the control source code stored in the HILS PC 70, and its branch condition and expected result are extracted.
  • the extracted branch conditions and expected results are stored in the PC 70 as a test case execution list.
  • FIG. 5 is a diagram showing a configuration example of a link database 60 that describes the relationship between internal values (control program signals) in the source code and physical signals operating in the HILS 10.
  • test cases created with internal values written in the program signal column have no physical meaning or attributes, so they cannot be made into test patterns that operate on HILS10, but rates and attributes can be associated with physical signals. If possible, it can be used as a test pattern. Therefore, the link database 60 stores information on internal values (RAM (Random Access Memory), rate, and unit) and physical attributes of the internal values. Further, information on signals of test patterns used in the HILS 10 is stored, and these signals are associated with information stored as internal values. Internal values (variables, thresholds) that are used in test cases and have no physical meaning or attributes are in a linearly convertible relationship with the variables and thresholds of the test pattern operated on HILS10, and the conversion coefficient is displayed in the rate column. Described.
  • multiple internal values in the control program may be used.
  • the physical attributes are the same, only one test pattern signal is operated by HILS, so a plurality of internal values of the same physical attribute are associated with the signal of one physical attribute by different rate values.
  • FIG. 6 is a flowchart of a physically meaningful test pattern that operates on the HILS 10 that is associated with internal values of test cases using the link database 60.
  • branch conditions at control branch points and their assumed results are extracted (steps 300 to 302).
  • a control branch point (such as an IF statement) is detected from a test case stored in the HILS PC 70, and its branch condition is extracted.
  • the extracted branch conditions are stored in the PC 70 as a test pattern execution list.
  • FIG. 7 is a time chart of signals output to operate the test pattern stored in the PC 70 on the HILS 10.
  • the branch conditions in the test pattern shown in FIG. 6 are the following A to D, and signals corresponding to the branch conditions A to D are output from the PC 70 at the timing shown in FIG. 7, and the test is executed by the HILS 10.
  • the internal values of test cases created from the source code 30 of the control program are associated with the link database 60 that stores variable names, physical attributes, and rates for converting into physical values. Since a test pattern composed of physical signals that can be operated on the HILS 10 is created by referring to the link database 60, a test pattern that can be operated on the HILS 10 can be created from the source code 30 of the control program.
  • the present invention is not limited to the embodiments described above, and includes various modifications and equivalent configurations within the scope of the appended claims.
  • the embodiments described above have been described in detail to explain the present invention in an easy-to-understand manner, and the present invention is not necessarily limited to having all the configurations described.
  • a part of the configuration of one embodiment may be replaced with the configuration of another embodiment.
  • the configuration of one embodiment may be added to the configuration of another embodiment.
  • other configurations may be added, deleted, or replaced with a part of the configuration of each embodiment.
  • each of the above-mentioned configurations, functions, processing units, processing means, etc. may be realized in part or in whole by hardware, for example by designing an integrated circuit, and a processor realizes each function. It may also be realized by software by interpreting and executing a program.
  • Information such as programs, tables, files, etc. that implement each function can be stored in a storage device such as a memory, hard disk, or SSD (Solid State Drive), or in a recording medium such as an IC card, SD card, or DVD.
  • a storage device such as a memory, hard disk, or SSD (Solid State Drive), or in a recording medium such as an IC card, SD card, or DVD.
  • control lines and information lines shown are those considered necessary for explanation, and do not necessarily show all control lines and information lines necessary for implementation. In reality, almost all configurations can be considered interconnected.

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)

Abstract

シミュレータの制御モデルで制御プログラムをテストするためのテストパターンを作成する計算機であって、前記制御プログラムで使用される変数の物理的な意味を表すリンクデータを格納するリンクデータ保持部と、前記制御プログラムの分岐処理又は演算処理をテストするための物理的な意味を有さない内部変数で記述されたテストケースを作成するテストケース作成部と、前記リンクデータを使用して、前記テストケースで使用される内部変数を物理的な意味を有する閾値及び変数に変換し、前記物理的な意味を有する変数で記述されたテストパターンを作成するテストパターン作成部と、を備える。

Description

計算機、及びテストパターン作成方法
 本発明は、ソースコードテストするテストパターン作成方法に関する。
 自動車の操作や運動に関わる制御技術の電子化は、年々増加している。1台の自動車に搭載されるECU(Elctronic Control Unit)と称される車載電子制御装置の数は数十個になり、これらECUに実装されるソフトウェア(以下、ソースコードと称する)の全体のサイズは、100万行から1000万行に及んでいる。
 このようにソースコードの開発規模は増加する一方で、その開発期間の短縮が要求されている。そのため、短期間開発におけるソースコードの品質維持及び向上が、自動車メーカやサプライヤの大きな課題となっている。
 本技術分野の背景技術として、以下の先行技術がある。特許文献1(特開2014-63415号公報)及び特許文献2(特開2009-14406号公報)がある。特許文献1(特開2014-63415号公報)には、ソフトウェアのテスト仕様を生成するテストケース自動生成装置において、プログラムコードの分岐箇所に到達したか否かを記録する記録文を前記分岐箇所に挿入する分岐記録文挿入手段と、1ステップ分のプログラムコードを複数ステップ分連結する複数ステップ連結手段と、前記複数ステップ分連結されたプログラムコードを実行した場合に前記分岐箇所に到達するか否かを解析する解析手段と、を備えることを特徴とするテストケース自動生成装置が記載されている。
 また、特許文献2(特開2009-14406号公報)には、センサ信号を取り込んでアクチュエータ駆動信号を出力する電子制御ユニットの自動検査装置であって、前記電子制御ユニットにより実行される処理の中から、検査対象となる制御分岐点の分岐条件を取得する分岐条件取得手段と、前記分岐条件が前記電子制御ユニットにおいて実行されるための運転パターンを出力する運転パターン発生手段と、前記電子制御ユニットの本来の制御対象である実機が、前記運転パターンに沿って動作する際に、前記アクチュエータ駆動信号を受けて生成するセンサ信号と同等の信号を、擬似センサ信号として生成するシミュレータと、前記電子制御ユニットに前記擬似センサ信号を供給し、また、前記電子制御ユニットから発せられるアクチュエータの駆動信号を受信するための信号授受手段と、前記電子制御ユニットにおける処理結果および/または前記シミュレータにおける処理結果が正常であるか否かをコンピュータのハードウェア資源を用いて検査する検査手段と、を備えることを特徴とする電子制御ユニットの自動検査装置が記載されている。
特開2014-63415号公報 特開2009-14406号公報
 特開2014-63415号公報に記載されたテストケース自動生成装置では、検査対象のECUをHILS(Hardware In the Loop Simulation)を用いて自動検査するため、ECUとHILSとの間で疑似センサ信号とアクチュエータの駆動信号とを送受信して、ECUが本来の制御対象である実機に接続されている場合と同様に作動する。そして、その際に作成されるECU処理結果が正常であるか否かによって、ECUが実機との間で信号を送受信しながら動作する際に正常に機能するか否かを自動的に検査できる。
 ECUには、車両を制御するための種々のソースコードが記憶されている。これらのソースコードは多数の制御分岐点を含んでおり、これにより複雑な条件設定を可能としている。よって、ソースコードの品質を維持するためには、全ての制御分岐点の検査が望ましいが、ECUのデバッグ検査で使用するテストケースは人手で作成されることが多い。すなわち、作成者の主観に基づいてテストケースが作成されるため、作成者によってテストケースの品質にばらつきが生じる。この場合、テストケースの不備により悪いテスト結果が出て、テスト効率が低下する。
 特開2014-63415号公報は、分岐点などを検出し、テストケースの作成を自動化する方法を提案しているが、この提案はソースコードの機能遷移を確認するためのものであり、疑似センサ信号やアクチュエータの駆動信号をECUとHILSとの間で送受信するための物理的な意味を持つテストパターンの作成が困難である。
 また、特開2009-14406号公報は、検査すべき制御分岐点(例えばIF分など)をソースコードから検出し、当該分岐点における分岐条件及びその想定結果を実行リストとし、当該実行リストに従ってHILSによってシミュレーションが実行するテストパターンを自動的に作成する方法を提案している。しかし、実際には、多くの場合、ソースコード中の値は物理値と異なる内部値であり、内部値のビット当たりのレートを考慮して物理的な値に変換する必要があるが、特開2009-14406号公報には具体的な方法が記載されていない。
 本発明は前述した課題を解決するためになされたもので、ソースコード中の内部値と物理値を適切に結びつけ、電子制御ユニットを検査するテストパターンを自動的に作成することを目的とする。
 本願において開示される発明の代表的な一例を示せば以下の通りである。すなわち、シミュレータの制御モデルで制御プログラムをテストするためのテストパターンを作成する計算機であって、前記制御プログラムで使用される変数の物理的な意味を表すリンクデータを格納するリンクデータ保持部と、前記制御プログラムの分岐処理又は演算処理をテストするための物理的な意味を有さない内部変数で記述されたテストケースを作成するテストケース作成部と、前記リンクデータを使用して、前記テストケースで使用される内部変数を物理的な意味を有する閾値及び変数に変換し、前記物理的な意味を有する変数で記述されたテストパターンを作成するテストパターン作成部と、を備えることを特徴とする。
 本発明の一態様によれば、内部値で構成される制御プログラムのソースコードから作成されるテストケースから、物理的な意味を有する信号が必要となるHILS用のテストパターンを作成できる。前述した以外の課題、構成及び効果は、以下の実施例の説明によって明らかにされる。
本実施例によるテスト環境の概略構成図である。 本実施例において実行される処理のフローチャートである。 HILSを使用した分岐条件検査が行われるソースコードの例である。 テストケースによる処理のフローチャートである。 リンクデータベースの構成例を示す図である。 テストパターンによる処理のフローチャートである。 テストパターンをHILSで動作させるために出力信号のタイムチャートである。
 以下、本発明の実施例を図面を参照して説明する。本実施例にかかるHILS(Hardware In the Loop Simulation)を用いた自動テスト環境は、物理的な意味を有さない内部値で構成されたソースコードから作成されたテストケースでも、情報リンクデータベースを介することによって、HILSを動作させる物理的な意味を持つテストパターンを作成し、効率的なテストを実現する。
 まず、図1を参照して本実施例のHILSを用いた自動テスト環境について説明する。図1は、本実施例による内部値で構成されるソースコード30を物理的な信号で動作されるHILSにてテストするシステムの概略構成図である。図1では、HILSが車両モデル11と運転モデル12で構成される。本実施例のHILS10は電気的な接続線を介してECU(車載電子制御装置、Electric Control Unit)20に接続されている。また、HILS10は、電気的な接続線を介しパーソナルコンピュータ(PC)70と接続される。
 HILS10は、ECU20の本来の制御対象である車両と同様に、ECU20との間で信号を授受しつつ、所望のシミュレーションを実現するためのシミュレーションシステムである。PC70にはECU20で動作するソースコード30が記憶される。また、ソースコード30を解析し、自動的にテストケースを作成するテストケース自動作成ツール40と、テストケース自動作成ツール40によって作成された内部値で構成されるテストケースに物理的な意味を与えるリンクデータベース60を介して、HILS10を動作させるテストパターンを作成するテストパターン自動作成ツール50が含まれる。
 HILS10は、車両モデル11と運転モデル12とを含む。運転モデル12は、運転者による運転操作を模擬するモデルであり、供給されたテストパターンに適合した車速を実現するためのアクセル開度を算出し、そのアクセル開度に関する情報を車両モデル11に出力する。
 車両モデル11は、車両の機能を模擬するモデルである。例えば、車両に搭載されるエンジンの実機には、排気空燃比を計測するためのA/Fセンサ、クランク角を計測するためのクランク角センサ、吸入空気量Gaを計測するためのエアフロメータなど、種々のセンサが搭載され、燃料噴射弁などのアクチュエータが搭載される。車両モデル11は、運転モデル12から出力されるアクセル開度の情報や、ECU20から出力されるアクチュエータ信号に従って、エンジンの実機やアクチュエータの動きを模擬し、かつ、実機において生成される種々のセンサ信号と同様の信号を模擬センサ信号として生成する。
 車両モデル11において生成される擬似センサ信号は、ワイヤーハーネスを介してECU20に供給される。車両モデル11からECU20に供給される擬似センサ信号は、例えば、A/Fセンサの擬似信号(排気空燃比の擬似信号)や吸入空気量Gaの擬似信号など、燃料噴射量(燃料噴射時間TAU)を算出するためにECU20が必要とする信号、又は、クランク角センサの擬似信号など、ECU20の処理をHILSシステム10の処理と同期させるために必要な信号などを含む。
 ECU20は、車両モデル11から供給された擬似センサ信号に基づいて、内燃機関の制御に必要な所定の処理を実行し、処理によって生成されるアクチュエータ信号を再び車両モデル11に出力する。本実施例のECU20は、例えば、吸入空気量や排気空燃比A/Fなどの擬似センサ信号に従って、燃料噴射時間を算出する処理や、適切なタイミングで燃料噴射時間だけ燃料噴射弁を開弁するための噴射信号をアクチュエータ駆動信号として出力する処理などを実行する。
 次に、HILS10を利用したシミュレーションにおいて、制御分岐点における処理を実行するための動作について説明する。ここでは、先ず、運転パターンの特定動作について説明する。本実施例のHILS10は、入力された車両の運転条件に従って、本来の制御対象である実機を模擬したシミュレーションを実行する。従って、HILS10によるシミュレーションにおいて制御分岐点における処理が実行されるように車両の運転条件が特定される。具体的には、HILS10は、PC70が記憶しているCU20の制御用ソースコードから検査すべき制御分岐点(例えば、IF文など)を検出して、当該分岐点における分岐条件及びその想定結果が実行リストとしてPC70内に記憶される。そして、HILS10は、当該実行リストに従ってHILS10におけるシミュレーションが実行されるように、車両の運転条件としての目標車速、目標回転数を特定する。
 次に、図2を参照して、本実施例において実行される処理の具体的内容について説明する。
 ステップS1では、HILS用PC70内に格納された制御プログラムのソースコード30から、制御分岐点(IF文など)が検出され、その分岐条件(変数、閾値)及び想定結果が抽出される。ステップS2では、抽出された分岐条件がテストケースとしてPC70内に保持される。なお、前述したように、ここで用いられるソースコード30は内部値で構成されているため、内部値によるテストケースである。
 ステップS3では、内部値で作成されたテストケースからリンクデータベース60を用いて物理的な信号に変換し、ステップS4において、PC70が、変換された物理的な信号によってHILS10を動作させるテストパターンを作成し、保持する。
 ステップS5では、ステップS4で作成されたテストパターンを用いてHILS10によるテストを実行する。
 図3は、HILS10を使用して分岐条件検査を実行するルーチンを構成するソースコード30の例である。ソースコード30の入出力は入力変数と出力変数で構成される。この入力変数と出力変数は内部値で表現され、内部値はレートを通じて物理値に換算される。このため、この入力変数と出力変数は、ソースコード内では直接物理値とは異なり、物理的な意味を持たず、信号の属性が特定されない値である。ソースコード30は、この内部値を使用して各処理や分岐処理を実行する。
 次に、図4を参照して、本実施例の処理の具体的内容について説明する。図4は、HILS10を使用して分岐条件検査を実行する処理のフローチャートである。
 図4に示すルーチンでは、先ず、制御分岐点における分岐条件及びその想定結果を抽出する(ステップ100からステップ102)。ここでは、具体的には、HILS用PC70内に格納された制御用ソースコードから、制御分岐点(IF文など)を検出し、その分岐条件及び想定結果を抽出する。抽出された分岐条件及び想定結果は、テストケースの実行リストとしてPC70内に格納される。
 図5は、ソースコード内の内部値(制御プログラム信号)とHILS10で動作する物理的な信号の関係を記述するリンクデータベース60の構成例を示す図である。
 前述のとおり、プログラム信号欄に記述される内部値で作成されるテストケースは物理的な意味や属性を有さないため、HILS10で動作させるテストパターンにできないが、レートと属性を物理信号と関連付けられればテストパターンにできる。よって、リンクデータベース60には内部値の情報(RAM(Random Access Memory)、レート及び単位)と、その内部値の物理的な属性が記憶される。また、それらの信号がHILS10で使用されるテストパターンの信号の情報が記憶されており、内部値として記憶された情報と関連付けられる。テストケースで使用され、物理的な意味や属性を有さない内部値(変数、閾値)は、HILS10で動作させるテストパターンの変数や閾値と線形変換可能な関係にあり、変換係数がレート欄に記述される。また、同じ物理変数(例えば、エンジン回転数)でも、制御プログラムにおける複数の内部値が使用されることがある。物理属性が同じ場合、HILSで動作させるテストパターンの信号は一つであるため、同じ物理属性の複数の内部値を異なるレート値によって一つの物理属性の信号と関連付ける。
 図6は、リンクデータベース60を用いてテストケースの内部値と関連付けられたHILS10で動作する物理的な意味を持つテストパターンのフローチャートである。
 図6に示すルーチンでは、制御分岐点における分岐条件及びその想定結果を抽出する(ステップ300からステップ302)。ここでは、具体的には、HILS用PC70内に格納されたテストケースから、制御分岐点(IF文など)を検出し、その分岐条件が抽出される。抽出された分岐条件は、テストパターンの実行リストとしてPC70内に格納される。
 図7は、PC70内に格納されるテストパターンをHILS10で動作させるために出力される信号のタイムチャートである。
 図6に示すテストパターンにおける分岐条件は下記A~Dであり、A~Dの分岐条件に対応する信号が図7に示すタイミングでPC70から出力され、HILS10でテストが実行される。
A:エンジン回転、水温条件及び判定時間の各条件をS200でNに分岐
B:S201でNに分岐
C:S202でNに分岐
D:全条件Y
 以上、本発明について、HILSを用いた実施例を説明したが、本発明はMILSにも適用できる。
 以上に説明したように、本発明の実施例では、制御プログラムのソースコード30から作成されるテストケースの内部値を変数名、物理属性、物理値に変換するレートを格納するリンクデータベース60と関連付け、リンクデータベース60を参照してHILS10で動作可能な物理的な信号で構成されるテストパターンを作成するので、制御プログラムのソースコード30から、HILS10で動作させるテストパターンを作成できる。
 また、同じ物理変数(例えば、エンジン回転数)を意味する複数の内部値が制御プログラムで使用される場合でも、異なるレート値によって一つの物理属性の信号と関連付け、HILSで動作させるテストパターンの一つの信号に集約できる。
 なお、本発明は前述した実施例に限定されるものではなく、添付した特許請求の範囲の趣旨内における様々な変形例及び同等の構成が含まれる。例えば、前述した実施例は本発明を分かりやすく説明するために詳細に説明したものであり、必ずしも説明した全ての構成を備えるものに本発明は限定されない。また、ある実施例の構成の一部を他の実施例の構成に置き換えてもよい。また、ある実施例の構成に他の実施例の構成を加えてもよい。また、各実施例の構成の一部について、他の構成の追加・削除・置換をしてもよい。
 また、前述した各構成、機能、処理部、処理手段等は、それらの一部又は全部を、例えば集積回路で設計する等により、ハードウェアで実現してもよく、プロセッサがそれぞれの機能を実現するプログラムを解釈し実行することにより、ソフトウェアで実現してもよい。
 各機能を実現するプログラム、テーブル、ファイル等の情報は、メモリ、ハードディスク、SSD(Solid State Drive)等の記憶装置、又は、ICカード、SDカード、DVD等の記録媒体に格納することができる。
 また、制御線や情報線は説明上必要と考えられるものを示しており、実装上必要な全ての制御線や情報線を示しているとは限らない。実際には、ほとんど全ての構成が相互に接続されていると考えてよい。
10…HILSシステム、11…車両モデル、12…運転モデル、20…ECU、30…ソースコード、40…テストケース自動作成ツール、50…テストパターン自動作成ツール、60…リンクデータベース、70…HILS用PC

Claims (7)

  1.  シミュレータの制御モデルで制御プログラムをテストするためのテストパターンを作成する計算機であって、
     前記制御プログラムで使用される変数の物理的な意味を表すリンクデータを格納するリンクデータ保持部と、
     前記制御プログラムの分岐処理又は演算処理をテストするための物理的な意味を有さない内部変数で記述されたテストケースを作成するテストケース作成部と、
     前記リンクデータを使用して、前記テストケースで使用される内部変数を物理的な意味を有する閾値及び変数に変換し、前記物理的な意味を有する変数で記述されたテストパターンを作成するテストパターン作成部と、を備えることを特徴とする計算機。
  2.  請求項1に記載の計算機であって、
     前記物理的な意味を有さない内部変数と、前記物理的な意味を有する変数とは線形変換可能な関係にあって、
     前記リンクデータ保持部は、前記物理的な意味を有さない内部変数と、前記物理的な意味を有する変数との変換係数を保持することを特徴とする計算機。
  3.  請求項2に記載の計算機であって、
     前記テストパターン作成部は、
     前記制御プログラムから、分岐処理の内部変数及びその閾値を抽出し、
     前記リンクデータ保持部に保持された変換係数を参照して、前記分岐処理の内部変数及び閾値を物理的な意味を有する変数及び閾値に変換し、
     前記物理的な意味を有する変数及び閾値で記述されたテストパターンを生成することを特徴とする計算機。
  4.  請求項1に記載の計算機であって、
     前記制御プログラムは、車載電子制御装置で実行されるためのものであることを特徴とする計算機。
  5.  シミュレータの制御モデルで制御プログラムをテストするためのテストパターンを作成するテストパターン作成方法であって、
     前記テストパターン作成方法を実行する計算機は、所定の演算処理を実行する演算装置と、前記演算装置に接続される記憶デバイスとを有し、
     前記記憶デバイスは、前記制御プログラムで使用される変数の物理的な意味を表すリンクデータを格納し、
     前記テストパターン作成方法は、
     前記演算装置が、前記制御プログラムの分岐処理又は演算処理をテストするための物理的な意味を有さない内部変数で記述されたテストケースを作成するテストケース作成手順と、
     前記演算装置が、前記リンクデータを使用して、前記テストケースで使用される内部変数を物理的な意味を有する変数に変換し、前記物理的な意味を有する閾値及び変数で記述されたテストパターンを作成するテストパターン作成手順と、を含むことを特徴とするテストパターン作成方法。
  6.  請求項5に記載のテストパターン作成方法であって、
     前記物理的な意味を有さない内部変数と、前記物理的な意味を有する変数とは線形変換可能な関係にあって、
     前記記憶デバイスは、前記物理的な意味を有さない内部変数と、前記物理的な意味を有する変数との変換係数を保持することを特徴とするテストパターン作成方法。
  7.  請求項6に記載のテストパターン作成方法であって、
     前記テストパターン作成手順では、
     前記演算装置が、前記制御プログラムから、分岐処理の内部変数及びその閾値を抽出し、
     前記演算装置が、前記記憶デバイスに保持された変換係数を参照して、前記分岐処理の内部変数及び閾値を物理的な意味を有する変数及び閾値に変換し、
     前記演算装置が、前記物理的な意味を有する変数及び閾値で記述されたテストパターンを生成することを特徴とするテストパターン作成方法。
PCT/JP2022/023431 2022-06-10 2022-06-10 計算機、及びテストパターン作成方法 WO2023238372A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2022/023431 WO2023238372A1 (ja) 2022-06-10 2022-06-10 計算機、及びテストパターン作成方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2022/023431 WO2023238372A1 (ja) 2022-06-10 2022-06-10 計算機、及びテストパターン作成方法

Publications (1)

Publication Number Publication Date
WO2023238372A1 true WO2023238372A1 (ja) 2023-12-14

Family

ID=89117807

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2022/023431 WO2023238372A1 (ja) 2022-06-10 2022-06-10 計算機、及びテストパターン作成方法

Country Status (1)

Country Link
WO (1) WO2023238372A1 (ja)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009014406A (ja) * 2007-07-02 2009-01-22 Toyota Motor Corp 電子制御ユニットの自動検査装置

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009014406A (ja) * 2007-07-02 2009-01-22 Toyota Motor Corp 電子制御ユニットの自動検査装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
KUSHIRO, NORIYUKI; AOYAMA, YUSUKE; MURAKAMI, KYOICHI: "CB-001 Definition of test case design process from specifications and test case generation support tool", PROCEEDINGS OF 17TH FORUM ON INFORMATION TECHNOLOGY (FIT2018), vol. 17, no. 1, 12 September 2018 (2018-09-12), pages 15 - 21, XP009551207 *

Similar Documents

Publication Publication Date Title
US8683442B2 (en) Software test case generation from a partial design model
US7478346B2 (en) Debugging system for gate level IC designs
Nabi et al. An overview of hardware-in-the-loop testing systems at Visteon
JP5290199B2 (ja) エンジン動作のシミュレート方法
US8108745B2 (en) On-device constrained random verification for device development
JP2009014406A (ja) 電子制御ユニットの自動検査装置
JP2000082094A (ja) 半導体集積回路設計検証システム
KR101119722B1 (ko) 반도체 시험용 프로그램 디버그 장치
CN100405323C (zh) 一种在指令级随机测试中支持ejtag测试的实现方法
CN112444731B (zh) 芯片测试方法、装置、处理器芯片及服务器
WO2007113940A1 (ja) 半導体検査装置
CN110069414A (zh) 回归测试方法及系统
WO2023238372A1 (ja) 計算機、及びテストパターン作成方法
Nanjundaswamy et al. Development and calibration of on-board-diagnostic strategies using a micro-HiL approach
Damji et al. Automated Model-Based Calibration for Drivability Using a Virtual Engine Test Cell
Drenth et al. Consistent simulation environment with FMI based tool chain
Muli et al. Virtual validation-a new paradigm in controls engineering
CN114661615A (zh) 一种fpga软件测试方法和设备
Butts et al. 15 AUTOMOTIVE POWERTRAIN CONTROLLER DEVELOPMENT USING CACSD
Zhou et al. Hardware software co-design for automotive CPS using architecture analysis and design language
CN105447220A (zh) 从fpga确定回读信号
Zheng et al. A hardware-in-the-loop test bench for production transmission controls software quality validation
US10268625B2 (en) Signal path verification device
JP2004019508A (ja) 車両用制御装置の評価方法、および車両用制御装置の評価用信号の記録装置
Nakao et al. Virtual FMEA: Simulation-Based ECU Electrical Failure Mode and Effects Analysis

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22945871

Country of ref document: EP

Kind code of ref document: A1