AUTOSAR AP Model MiL Testing Method

Autosar Adaptive Platform (AP) employs a Service-Oriented Architecture (SOA) for communication, making it suitable for high-performance computing scenarios.Through rational task allocation, it can fully leverage hardware resource advantages and improve the overall system performance. It is currently applied in various complex scenarios such as autonomous driving, smart cockpits, domain control, and vehicle central computers. Simulink also supports AUTOSAR AP models. However, due to the characteristics of AUTOSAR AP models, it is difficult to achieve MiL simulation of the models directly; functional testing can only be performed after conversion to code, which undoubtedly reduces the development efficiency of MBD. This document introduces a method for functional testing of AUTOSAR AP models using the MQTester software.

Features of Autosar AP Models

The core of AUTOSAR AP is message-driven function calls. To support message passing, Simulink has added two modules: Event Receive and Event Send, used to convert received messages into signals and outgoing signals into messages. A function type called via ports has been added to the function categories, along with two modules: Function Element and Function Element Call. These two modules must be located at the top level of the model. Calls to functions communicating via ports must be located in different models from their function prototypes. These characteristics of AP models lead to a cumbersome, complex, and inefficient manual environment setup process. Currently, using the tools built into the modeling software can only successfully establish a simulatable test environment in very limited cases, and manual setup undoubtedly significantly reduces testing efficiency.

Figure 1 shows a test environment that cannot be simulated

MQTester Solution

Automatic Test Environment Generation

MQTester accurately identifies various elements used in the AP model, selects appropriate configuration parameters, and automatically generates a simulatable test environment. Utilizing MQTester’s test case generation methods and evaluation approaches suitable for various scenarios enables efficient testing of AP models. It also fills the essential MiL testing link required for functional safety certification, saving significant time and cost associated with vehicle testing.

Addressing the characteristics of AP models, MQTester implements the following functions:

  • Automatic conversion of input signals to messages, and messages to output signals

Automatically identifies signal attributes in the model and performs signal-to-message conversion when necessary.

  • Generates function calls in a new model for functions using ports

Functions cannot be tested without function calls. MQTester automatically generates corresponding function calls for the function prototypes and adds the function inputs and outputs as signals under test via ports, allowing the setup of different test cases for functional testing and result evaluation under various conditions.

  • Generates function prototypes for isolated function calls using ports

If the called function prototype does not exist (e.g., functions developed by a third party), MQTester automatically generates a function prototype based on the call information and controls the output signal values via parameters to simulate the expected behavior of the prototype function, enabling testing of the existing model’s functionality. Leveraging MQTester’s real-time parameter modification feature, the output values of the function prototype can be simulated at any point during the testing process, supporting various scalar, array, and bus signals.

  • Automatically records global variables as observables

Global variables in the model, including those used in Stateflow, can have their signal values recorded during simulation as needed, facilitating the testing of various functional details.

  • Simulates black-box modules using fault injection

Uses MQTester’s model fault injection function to provide the required output values for black-box modules in the model or modules that require external assistance to operate correctly, in order to test the functionality of the existing model.

  • Controls function execution sequence using the Scheduler Editor

After automatically generating a complete test environment, all functions are integrated into one model, allowing the use of the Scheduler Editor to simulate various scheduling sequences for services and test the dynamic behavior of the model.

After generating the test environment, multiple test case authoring methods provided by MQTester can be used to write test cases:

  • Script-based test case authoring method(TCSD): Test cases are written according to timing sequences. Helper functions are provided to generate signals that change regularly. Signal values are inherited automatically; unchanged values do not need reassignment. This method is independent of the simulation step size, and test cases can be imported according to various simulation step sizes.
  • List-based test case authoring method(TCLD): The system automatically generates lists for inputs, outputs, observables, and calibration parameters. Users input signal values into these lists and can use various MATLAB expressions. This method also features signal value inheritance.
  • Combinatorial test cases (Equivalence class combination cases): The system automatically selects values for each signal based on various attribute constraints. Users can select multiple equivalence class values as needed. The system then automatically generates all combinations based on the selected signal values, achieving full coverage testing for various conditions.

Figure 2 shows an example of the test environment generated by MQTester

Furthermore, MQTester provides several powerful auxiliary testing functions:

The real-time parameter modification function provides the ability to modify parameters at any time during simulation. This function can be used not only to simulate the output signals of function prototypes but also for parameter debugging, making debugging straightforward and testing work efficient and convenient.

The model-level fault injection function can modify intermediate signal values at any time, making it an indispensable function for interface testing. This function can also be used to test one part of the model when another related part does not possess the correct functionality, thereby accelerating the development process. It is a necessary function for agile development.

Summary

AUTOSAR AP models are based on a service-oriented communication architecture and are widely used in complex scenarios such as autonomous driving and smart cockpits. However, their message-driven function call characteristics (such as Event Receive/Send modules, port-invoked functions, etc.) make it difficult to achieve MiL simulation directly in the traditional Simulink environment, and manual test environment setup is inefficient.

MQTester effectively solves these problems through automation: it achieves automatic construction of the test environment and provides enhanced testing capabilities to address pain points and challenges in testing; it offers diverse test case design capabilities, combining MATLAB expressions and equivalence class coverage to improve testing efficiency; its parameter modification and fault injection functions enable testing of partial model functionality, significantly accelerating development iteration.

MQTester fills the gap in MiL testing for AUTOSAR AP models and provides crucial tool support for the MBD development approach of AUTOSAR AP.

Contact Us

Zhejiang Qiusuo Software Technology Co., Ltd.

Mobile: +86 150 108 23652

WeChat: yuyongke1797448900

E-mail: yuyongke@model-soft.com 

URL: www.model-soft.com

Search

Proudly powered by Qiusuo Software

Leave a Comment

Your email address will not be published. Required fields are marked *