V2.4 2011-07
Testing a composition of multiple software components with DaVinci Component Tester
Testing atomic AUTOSAR software components with DaVinci Component Tester
Functions
The core of DaVinci Component Tester is an emulator that executes the SWCs on a PC. This does not require an AUTOSAR RTE (Runtime Environment) or basic software. The finely tuned emulator simu-lates the AUTOSAR-ECU environment for the SWC under test with realistic behavior. The emulation covers full RTE functionality and lets you test any AUTOSAR Release 3.0 and 3.1 SWCs using functions such as:
> Setting data elements of receiver ports
> Reading data elements from sender ports
> Calling up server ports
> Controlling mode ports
> Setting calibration data
> Executing runnables with non-blocking API calls (Category I)
> Executing runnables with blocking API accesses (Category II)
> Handling internal communication between multiple SWCs
> Simulating errors such as timeout or empty queue
All you need to configure the test setup or experiments is the SWC description (AUTOSAR XML file). Based on the SWC Description, DaVinci Component Tester provides a structured API that can be used by an external tool to access the SWC. The external test tool handles control of the test, e.g. by programming test cases, and evaluation of the test.
Operating Modes
DaVinci Component Tester offers two operating modes, which depend on its intended use. They affect execution of the SWC’s runnable entities:
> Programmed execution mode
You can implement execution of the runnable entities in an explicit test case. This execution mode is used in unit tests with focus on detailed inspection of the implementation.
> Automatic execution mode
DaVinci Component Tester executes the runnable entities inde-pendently according to the trigger specification, e.g. periodi-cally every 10 ms. Therefore DaVinci Component Tester synchro-nizes itself to the time base of your test tool. This execution mode is used for integration testing of complex SWCs or in experimental startup of a SWC during development (Rapid Prototyping).
Special functions
> Instruction line support for automated tests
> Checking API consistency of the SWC Description and SWC implementation file
> Programming callbacks in the test environment for specific reaction to an API call of the SWC under test
> Generating the header file of SWCs (Contract Phase Generator) for compiling the SWC implementation with the Microsoft Compiler
Service Emulator
DaVinci Component Tester contains an emulator for the standard services of an AUTOSAR ECU. This emulator simulates the behavior of the services in an abstracted form.
When a test or experiment is set up, the SWC’s service ports are automatically connected to the service emulator. There is no need to explicitly consider the service ports in the test environment, allowing you to focus entirely on the SWC’s application ports. This reduces the complexity of the test environments considerably.
The service emulator may be accessed at any time. For example, you can preset a block with a certain value that is read out by the SWC from nonvolatile memory, or you can check the value changed by the SWC. Similarly, users can control or monitor the current state of the ECU Manager from a test case.
The service emulator supports AUTOSAR standard services of the following basic software modules:
> EcuM (ECU Manager)
> DEM (Diagnostic Event Manager)
> FiM (Function Inhibition Manager)
> NvM (Non-Volatile Memory Manager)
> ComM (Communication Manager)
> WdgM (Watchdog Manager)
Interface to CANoe
You can use DaVinci Component Tester in combination with CANoe to execute integration tests of SWCs. While CANoe controls the test flow, DaVinci Component Tester automatically handles execution of the runnable entities. Therefore DaVinci Component Tester synchronizes itself to the simulation time of CANoe.
You describe the test environment in CANoe, e.g. with the help of the Test Feature Set. All other CANoe functions are available as well; such as panels, analysis windows and integration of MATLAB models for an environment simulation.
Functional principle: Interfacing DaVinci Component Tester to CANoe
Interface to NUnit
You can execute unit tests of SWCs in conjunction with the open source tool NUnit. This is done by implementing the test cases in any desired .NET language such as C#. The test cases typically show the following pattern: Set input vector, execute runnables, read output vector and check it. NUnit handles test execution and reporting.
Microsoft Visual Studio is used to program the test cases. In implementing the test cases, you are supported by programming assistance integrated in the development environment (Intelli-Sense). For example, a user could easily program access to a receiver port by listing all of the SWC’s receiver ports and selecting the desired port from the list.
Integration in your test environment
Due to its open interfaces, DaVinci Component Tester can be inte-grated in your development environment or test tool chain, making it AUTOSAR-capable. Vector offers support in integration of DaVinci Component Tester.
Scope of Delivery
DaVinci Component Tester consists of the following components:
> SUT Executable Generator:
Instruction line tool for preparing the SCW under test as an executable system under test (SUT). Inputs are the SCW
imple-mentation compiled by the Microsoft Compiler and the SWC Description (AUTOSAR XML).
> Contract Phase Generator:
Instruction line tool for generating the SWC’s header file
> Emulator (including Service Emulator):
.NET DLL for executing SUT executables
> NUnit Adapter:
Interfaces the emulator to NUnit. Interfacing is via a .NET Assembly with a structured API for access to the SWC.
> CANoe Adapter:
Interfaces the emulator to CANoe. Interfacing is via a .NET Node, which you integrate in your CANoe configuration. The SWC’s input and output data elements are mapped via CANoe system variables.
> Sample projects
> Manual as PDF document
System Requirements
> MS Visual Studio 2005 or 2008 (Express, Standard or Profes-sional Edition). The ProfesProfes-sional Edition is required for debugging in combination with NUnit.
> Windows XP or Windows 7 (32- or 64-Bit)
> CANoe 7.1 or higher
> Alternative: NUnit 2.4.7 or higher (available at:
http://www.nunit.org)
Functional principle: Interfacing DaVinci Component Tester to NUnit
V2.5 2012-02
Overview of advantages
> Convenient configuration of MICROSAR basic software
> Easy integration of your own basic software
> Workflow support for typical OEM and TIER1 project situations